File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -9959,13 +9959,9 @@ class InstructionsCompatibilityAnalysis {
99599959 /// MainOpcode. For Add, returns 0. For Or, it should choose between false and
99609960 /// the operand itself, since V or V == V.
99619961 Value *selectBestIdempotentValue() const {
9962- switch (MainOpcode) {
9963- case Instruction::Add:
9964- return ConstantInt::getNullValue(MainOp->getType());
9965- default:
9966- break;
9967- }
9968- llvm_unreachable("Unsupported opcode");
9962+ assert(MainOpcode == Instruction::Add && "Unsupported opcode");
9963+ return ConstantExpr::getBinOpIdentity(MainOpcode, MainOp->getType(),
9964+ !MainOp->isCommutative());
99699965 }
99709966
99719967 /// Returns the value and operands for the \p V, considering if it is original
You can’t perform that action at this time.
0 commit comments