diff options
author | Simon Moll <moll@cs.uni-saarland.de> | 2022-05-30 14:38:59 +0200 |
---|---|---|
committer | Simon Moll <moll@cs.uni-saarland.de> | 2022-05-30 14:41:15 +0200 |
commit | 18c1ee04de448a6a4babbaf8e5ba42866339b466 (patch) | |
tree | cc21609d8c234339e261822a80fcada9c2899a25 /llvm/lib/CodeGen/ExpandVectorPredication.cpp | |
parent | 2e2a8a2d9082250e4aad312c6008a526f2b007c7 (diff) | |
download | llvm-18c1ee04de448a6a4babbaf8e5ba42866339b466.zip llvm-18c1ee04de448a6a4babbaf8e5ba42866339b466.tar.gz llvm-18c1ee04de448a6a4babbaf8e5ba42866339b466.tar.bz2 |
Re-land "[VP] vp intrinsics are not speculatable" with test fix
Update the llvmir-intrinsics.mlir test to account for the modified
attribute sets.
This reverts commit 2e2a8a2d9082250e4aad312c6008a526f2b007c7.
Diffstat (limited to 'llvm/lib/CodeGen/ExpandVectorPredication.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ExpandVectorPredication.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/ExpandVectorPredication.cpp b/llvm/lib/CodeGen/ExpandVectorPredication.cpp index aa52914..fbb89a7 100644 --- a/llvm/lib/CodeGen/ExpandVectorPredication.cpp +++ b/llvm/lib/CodeGen/ExpandVectorPredication.cpp @@ -118,10 +118,10 @@ static bool maySpeculateLanes(VPIntrinsic &VPI) { if (isa<VPReductionIntrinsic>(VPI)) return false; // Fallback to whether the intrinsic is speculatable. - // FIXME: Check whether the replacing non-VP code will be speculatable - // instead. VP intrinsics themselves are never speculatable because of - // UB if %evl is greater than the runtime vector length. - return isSafeToSpeculativelyExecute(cast<Operator>(&VPI)); + Optional<unsigned> OpcOpt = VPI.getFunctionalOpcode(); + unsigned FunctionalOpc = OpcOpt.getValueOr((unsigned)Instruction::Call); + return isSafeToSpeculativelyExecuteWithOpcode(FunctionalOpc, + cast<Operator>(&VPI)); } //// } Helpers @@ -481,7 +481,7 @@ struct TransformJob { }; void sanitizeStrategy(VPIntrinsic &VPI, VPLegalization &LegalizeStrat) { - // Speculatable instructions do not strictly need predication. + // Operations with speculatable lanes do not strictly need predication. if (maySpeculateLanes(VPI)) { // Converting a speculatable VP intrinsic means dropping %mask and %evl. // No need to expand %evl into the %mask only to ignore that code. |