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

Krzysztof Drewniak via llvm-commits llvm-commits at lists.llvm.org
Fri May 17 19:30:17 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)) {
----------------
krzysz00 wrote:

Thanks! I'll do those things (which'll probably lead to improved tests for DivRemPairs overall, from what I can tell)

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


More information about the llvm-commits mailing list