[PATCH] D11313: [ValueTracking] computeOverflowForSignedAdd and isKnownNonNegative

Jingyue Wu via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 11:12:28 PDT 2015


jingyue marked 5 inline comments as done.
jingyue added a comment.

All comments addressed. Thanks Philip and David!


================
Comment at: lib/Analysis/ValueTracking.cpp:3327
@@ -3318,1 +3326,3 @@
 
+static OverflowResult computeOverflowForSignedAdd(
+    Value *LHS, Value *RHS, Value *Add, const DataLayout &DL,
----------------
reames wrote:
> majnemer wrote:
> > This seems to overlap with `InstCombiner::WillNotOverflowSignedAdd`, would it make sense to consolidate this with that?
> Didn't know we had that one.  Yes, a follow up patch to consolidate would make great sense.  
ACK. Will address this in a follow-up diff. 

================
Comment at: lib/Transforms/Scalar/NaryReassociate.cpp:354
@@ -362,3 +353,3 @@
 bool NaryReassociate::maySignOverflow(AddOperator *AO, Instruction *Ctxt) {
   if (AO->hasNoSignedWrap())
     return false;
----------------
reames wrote:
> Doesn't need to be in this change, but this should be pushed inside the ValueTracking call and the wrapper function can probably completely disappear.  
Done in this patch. 


http://reviews.llvm.org/D11313





More information about the llvm-commits mailing list