Skip to content

Commit e82abde

Browse files
authored
[SLP][NFC] Refactor ifs into && (#156278)
1 parent 01a1351 commit e82abde

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -967,9 +967,7 @@ class BinOpSameOpcodeHelper {
967967
return false;
968968
}
969969
bool equal(unsigned Opcode) {
970-
if (Opcode == I->getOpcode())
971-
return trySet(MainOpBIT, MainOpBIT);
972-
return false;
970+
return Opcode == I->getOpcode() && trySet(MainOpBIT, MainOpBIT);
973971
}
974972
unsigned getOpcode() const {
975973
MaskType Candidate = Mask & SeenBefore;
@@ -24179,9 +24177,7 @@ class HorizontalReduction {
2417924177
// previous vectorization attempts.
2418024178
if (any_of(VL, [&V](Value *RedVal) {
2418124179
auto *RedValI = dyn_cast<Instruction>(RedVal);
24182-
if (!RedValI)
24183-
return false;
24184-
return V.isDeleted(RedValI);
24180+
return RedValI && V.isDeleted(RedValI);
2418524181
}))
2418624182
break;
2418724183
V.buildTree(VL, IgnoreList);

0 commit comments

Comments
 (0)