summaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LoopInfo.cpp
diff options
context:
space:
mode:
authorAiden Grossman <aidengrossman@google.com>2025-09-12 01:50:21 +0000
committerAiden Grossman <aidengrossman@google.com>2025-09-12 01:50:21 +0000
commit6145e2022f335eeaa4aec5ebf574fe606c6d2d48 (patch)
treee0936af0852192583a2b6a15078012da92684a9f /llvm/lib/Analysis/LoopInfo.cpp
parentcec7f8a9029a827cf550376fe1fc3a3f79ae0e82 (diff)
parent653ed062ea22e3d35b5b7ce6db391466821ca6e9 (diff)
[𝘀𝗽𝗿] changes introduced through rebaseusers/boomanaiden154/main.lit-implement-ulimit-builtin
Created using spr 1.3.6 [skip ci]
Diffstat (limited to 'llvm/lib/Analysis/LoopInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index 6ba6073cce95..a8c3173bb179 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -58,26 +58,14 @@ static cl::opt<bool, true>
// Loop implementation
//
-bool Loop::isLoopInvariant(const Value *V, bool HasCoroSuspendInst) const {
- if (const Instruction *I = dyn_cast<Instruction>(V)) {
- // FIXME: this is semantically inconsistent. We're tracking a proper fix in
- // issue #149604.
- // If V is a pointer to stack object and L contains a coro.suspend function
- // call, then V may not be loop invariant because the ramp function and
- // resume function have different stack frames.
- if (HasCoroSuspendInst && isa<AllocaInst>(I))
- return false;
- else
- return !contains(I);
- }
+bool Loop::isLoopInvariant(const Value *V) const {
+ if (const Instruction *I = dyn_cast<Instruction>(V))
+ return !contains(I);
return true; // All non-instructions are loop invariant
}
-bool Loop::hasLoopInvariantOperands(const Instruction *I,
- bool HasCoroSuspendInst) const {
- return all_of(I->operands(), [&](Value *V) {
- return isLoopInvariant(V, HasCoroSuspendInst);
- });
+bool Loop::hasLoopInvariantOperands(const Instruction *I) const {
+ return all_of(I->operands(), [&](Value *V) { return isLoopInvariant(V); });
}
bool Loop::makeLoopInvariant(Value *V, bool &Changed, Instruction *InsertPt,