Skip to content

Commit a4d759c

Browse files
committed
EarlyCSE: address reviews
1 parent da9d770 commit a4d759c

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

llvm/lib/Transforms/Scalar/EarlyCSE.cpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -966,25 +966,22 @@ class EarlyCSE {
966966
const ParseMemoryInst &Later);
967967

968968
Value *getOrCreateResult(Instruction *Inst, Type *ExpectedType) const {
969-
if (!isa<IntrinsicInst, LoadInst, StoreInst>(Inst))
970-
llvm_unreachable("Instruction not supported");
969+
assert((isa<IntrinsicInst, LoadInst, StoreInst>(Inst)) &&
970+
"Instruction not supported");
971971

972972
// The load or the store's first operand.
973973
Value *V;
974974
if (auto *II = dyn_cast<IntrinsicInst>(Inst)) {
975-
if (isHandledNonTargetIntrinsic(II->getIntrinsicID()))
976-
switch (II->getIntrinsicID()) {
977-
case Intrinsic::masked_load:
978-
V = II;
979-
break;
980-
case Intrinsic::masked_store:
981-
V = II->getOperand(0);
982-
break;
983-
default:
984-
return nullptr;
985-
}
986-
else
975+
switch (II->getIntrinsicID()) {
976+
case Intrinsic::masked_load:
977+
V = II;
978+
break;
979+
case Intrinsic::masked_store:
980+
V = II->getOperand(0);
981+
break;
982+
default:
987983
return TTI.getOrCreateResultFromMemIntrinsic(II, ExpectedType);
984+
}
988985
} else {
989986
V = isa<LoadInst>(Inst) ? Inst : cast<StoreInst>(Inst)->getValueOperand();
990987
}

0 commit comments

Comments
 (0)