[PATCH] D154953: [InstSimplify] Remove the remainder loop if we know the mask is always true

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 17 05:05:49 PDT 2023


Allen marked an inline comment as done.
Allen added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp:1950
+      Constant *Zero = ConstantInt::getNullValue(Ty);
+      return BinaryOperator::CreateAnd(Zero, Op1);
+    }
----------------
paulwalker-arm wrote:
> Allen wrote:
> > david-arm wrote:
> > > I think you can avoid the `and` by simply returning null, i.e.
> > > 
> > >   return ConstantInt::getNullValue(Ty);
> > there is compilation problem if I **return ConstantInt::getNullValue(Ty)** directly
> >    error: cannot convert 'llvm::Constant*' to 'llvm::Instruction*' in return
> I believe this suggests that rather than an InstCombine this transformation should live in InstSimplify (e.g. simplifyURemInst).
Apply your comment, thanks


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154953/new/

https://reviews.llvm.org/D154953



More information about the llvm-commits mailing list