Skip to content

Commit fb23a37

Browse files
committed
ValueTracking: Do not look at users of constants for ephemeral values
These can only be instructions
1 parent 4e9cfcf commit fb23a37

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,13 @@ static bool isEphemeralValueOf(const Instruction *I, const Value *E) {
472472
!cast<Instruction>(V)->mayHaveSideEffects() &&
473473
!cast<Instruction>(V)->isTerminator())) {
474474
EphValues.insert(V);
475-
if (const User *U = dyn_cast<User>(V))
476-
append_range(WorkSet, U->operands());
475+
476+
if (const User *U = dyn_cast<User>(V)) {
477+
for (const Use &U : U->operands()) {
478+
if (!isa<Constant>(U))
479+
WorkSet.push_back(U.get());
480+
}
481+
}
477482
}
478483
}
479484
}

0 commit comments

Comments
 (0)