diff options
author | Johannes Doerfert <johannes@jdoerfert.de> | 2023-07-27 12:19:20 -0700 |
---|---|---|
committer | Johannes Doerfert <johannes@jdoerfert.de> | 2023-07-31 13:44:52 -0700 |
commit | fa367d159a9938d8d7c8ebdf1e84864072d907e5 (patch) | |
tree | eac91987c6afb1eb8857346243ca952a2f982e0c /llvm/lib/Analysis/LoopAccessAnalysis.cpp | |
parent | 6fa8244eb6cc4d2a079c347f7c44d842fc83a913 (diff) | |
download | llvm-fa367d159a9938d8d7c8ebdf1e84864072d907e5.zip llvm-fa367d159a9938d8d7c8ebdf1e84864072d907e5.tar.gz llvm-fa367d159a9938d8d7c8ebdf1e84864072d907e5.tar.bz2 |
[IR] Mark `llvm.assume` as `memory(inaccessiblemem: write)`
It was `inaccessiblemem: readwrite` before, no need for the read.
No real benefit is expected but it can help debugging and other efforts.
Differential Revision: https://reviews.llvm.org/D156478
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index fd0e81c5..c41d6f0 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -2192,17 +2192,17 @@ void LoopAccessInfo::analyzeLoop(AAResults *AA, LoopInfo *LI, if (HasComplexMemInst) continue; + // Many math library functions read the rounding mode. We will only + // vectorize a loop if it contains known function calls that don't set + // the flag. Therefore, it is safe to ignore this read from memory. + auto *Call = dyn_cast<CallInst>(&I); + if (Call && getVectorIntrinsicIDForCall(Call, TLI)) + continue; + // If this is a load, save it. If this instruction can read from memory // but is not a load, then we quit. Notice that we don't handle function // calls that read or write. if (I.mayReadFromMemory()) { - // Many math library functions read the rounding mode. We will only - // vectorize a loop if it contains known function calls that don't set - // the flag. Therefore, it is safe to ignore this read from memory. - auto *Call = dyn_cast<CallInst>(&I); - if (Call && getVectorIntrinsicIDForCall(Call, TLI)) - continue; - // If the function has an explicit vectorized counterpart, we can safely // assume that it can be vectorized. if (Call && !Call->isNoBuiltin() && Call->getCalledFunction() && |