[llvm] [DivRemPairs] Do not freeze poisons that can't be undef (PR #92627)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri May 17 19:16:54 PDT 2024


================
@@ -381,16 +381,15 @@ static bool optimizeDivRem(Function &F, const TargetTransformInfo &TTI,
       //   %mul = mul %div, 1   // %mul = undef
       //   %rem = sub %x, %mul  // %rem = undef - undef = undef
       // If X is not frozen, %rem becomes undef after transformation.
-      // TODO: We need a undef-specific checking function in ValueTracking
-      if (!isGuaranteedNotToBeUndefOrPoison(X, nullptr, DivInst, &DT)) {
+      if (!isGuaranteedNotToBeUndef(X, nullptr, DivInst, &DT)) {
----------------
dtcxzyw wrote:

Need some tests.


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


More information about the llvm-commits mailing list