[llvm] [X86][SimplifyCFG][CodeGen] Support hoisting load/store with conditional faulting (PR #95515)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 08:56:06 PDT 2024


================
@@ -5062,17 +5083,22 @@ X86TTIImpl::getMaskedMemoryOpCost(unsigned Opcode, Type *SrcTy, Align Alignment,
   std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(SrcVTy);
   auto VT = TLI->getValueType(DL, SrcVTy);
   InstructionCost Cost = 0;
-  if (VT.isSimple() && LT.second != VT.getSimpleVT() &&
+  MVT Ty = LT.second;
+  if (Ty == MVT::i16 || Ty == MVT::i32 || Ty == MVT::i64)
----------------
KanRobert wrote:

No need. `1xi16, 1xi32, 1xi64` masked ops are not legal w/o conditional faulting. If it's generated w/o cf, the `Not Implemented` error in TargetLowering.h would be triggered.

https://github.com/llvm/llvm-project/pull/95515


More information about the llvm-commits mailing list