Skip to content

Commit 8c9b677

Browse files
committed
Apply suggestion from @dtcxzyw
1 parent eb47c52 commit 8c9b677

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Analysis/InstructionSimplify.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6985,12 +6985,12 @@ Value *llvm::simplifyBinaryIntrinsic(Intrinsic::ID IID, Type *ReturnType,
69856985
// VectorShuffle instruction, which is not allowed in simplifyBinOp.
69866986
OptResult = MinMaxOptResult::UseEither;
69876987
for (unsigned i = 0; i != ElemCount.getFixedValue(); ++i) {
6988-
if (!C->getAggregateElement(i)) {
6988+
auto *Elt = C->getAggregateElement(i);
6989+
if (!Elt) {
69896990
OptResult = MinMaxOptResult::CannotOptimize;
69906991
break;
69916992
}
6992-
auto ElemResult = OptimizeConstMinMax(C->getAggregateElement(i),
6993-
IID, Call, &NewConst);
6993+
auto ElemResult = OptimizeConstMinMax(Elt, IID, Call, &NewConst);
69946994
if (ElemResult == MinMaxOptResult::CannotOptimize ||
69956995
(ElemResult != OptResult &&
69966996
OptResult != MinMaxOptResult::UseEither &&

0 commit comments

Comments
 (0)