Skip to content

Commit cde2ea3

Browse files
authored
llvm-reduce: Defer a shouldKeep call in operand reduction (#133387)
Ideally shouldKeep is only called in contexts that will successfully do something.
1 parent bd788db commit cde2ea3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/tools/llvm-reduce/deltas/ReduceOperands.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ extractOperandsFromModule(Oracle &O, ReducerWorkItem &WorkItem,
2626
for (auto &I : instructions(&F)) {
2727
if (PHINode *Phi = dyn_cast<PHINode>(&I)) {
2828
for (auto &Op : Phi->incoming_values()) {
29-
if (!O.shouldKeep()) {
30-
if (Value *Reduced = ReduceValue(Op))
29+
if (Value *Reduced = ReduceValue(Op)) {
30+
if (!O.shouldKeep())
3131
Phi->setIncomingValueForBlock(Phi->getIncomingBlock(Op), Reduced);
3232
}
3333
}

0 commit comments

Comments
 (0)