Skip to content

Commit b740899

Browse files
committed
[Indvars][NFCI] Simplify assertion.
This should be semantically identical. Also avoids unused variable warnings in Release builds.
1 parent c4d10e7 commit b740899

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Scalar/IndVarSimplify.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,8 +1114,8 @@ bool WidenIV::widenWithVariantUse(NarrowIVDefUse DU) {
11141114

11151115
// The operand that is not defined by NarrowDef of DU. Let's call it the
11161116
// other operand.
1117-
unsigned ExtendOperIdx = DU.NarrowUse->getOperand(0) == NarrowDef ? 1 : 0;
1118-
assert(DU.NarrowUse->getOperand(1 - ExtendOperIdx) == DU.NarrowDef &&
1117+
assert((NarrowUse->getOperand(0) == NarrowDef ||
1118+
NarrowUse->getOperand(1) == NarrowDef) &&
11191119
"bad DU");
11201120

11211121
const OverflowingBinaryOperator *OBO =

0 commit comments

Comments
 (0)