[PATCH] D60061: [InstCombine] ssubo X, C -> saddo X, -C

Dan Robertson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 2 13:46:59 PDT 2019


dlrobertson marked an inline comment as done and an inline comment as not done.
dlrobertson added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:2170-2171
+    }
     if (Instruction *I = foldIntrinsicWithOverflowCommon(II))
       return I;
 
----------------
dlrobertson wrote:
> lebedev.ri wrote:
> > Shouldn't we do this first?
> Originally I did this so we wouldn't run this function twice (once here and once as `sadd_with_overflow`) , but you're correct. We need to run this first so we don't miss the optimization if the first arg is the constant.
Actually this function doesn't call `cannonicalizeConstantArg0ToArg1` so this is not the case. This function should be called when `sadd_with_overflow` is run, so I can't currently think of a reason why this would need to be called first.


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

https://reviews.llvm.org/D60061





More information about the llvm-commits mailing list