[PATCH] D35635: Optimize {s,u}{add,sub}.with.overflow on ARM

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 11:34:17 PDT 2017


efriedma added inline comments.


================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:4484
+  };
+  if (LHS.getOpcode() == ISD::AND &&
+      (isOneConstant(RHS) || isNullConstant(RHS)) &&
----------------
jgalenson wrote:
> efriedma wrote:
> > We should be able to optimize away the AND here using known bits; does that not happen on trunk?
> It doesn't because ARM doesn't call setBooleanContents.  If there's a way to set that correctly, it would indeed be better.  Do you think we could do that?
Really?  Wow, that's a big oversight.  We should fix that.


https://reviews.llvm.org/D35635





More information about the llvm-commits mailing list