[llvm] [ValueTracking] Use isSafeToSpeculativelyExecuteWithVariableReplaced() in more places (PR #109149)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 09:33:55 PDT 2024


================
@@ -476,7 +476,8 @@ Instruction *InstCombinerImpl::visitExtractElementInst(ExtractElementInst &EI) {
   // it may make the operand poison.
   BinaryOperator *BO;
   if (match(SrcVec, m_BinOp(BO)) && cheapToScalarize(SrcVec, Index) &&
-      (HasKnownValidIndex || isSafeToSpeculativelyExecute(BO))) {
+      (HasKnownValidIndex ||
+       isSafeToSpeculativelyExecuteWithVariableReplaced(BO))) {
----------------
goldsteinn wrote:

Why is it necessary here? Isn't this transform change BO to handle strictly a subset of what it was previously?

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


More information about the llvm-commits mailing list