llvm-project/llvm/lib/Transforms
Philip Reames a956cc7f08 Revert 250343 and 250344
Turns out this approach is buggy.  In discussion about follow on work, Sanjoy pointed out that we could be subject to circular logic problems.  

Consider:
 if (i u< L) leave()
 if ((i + 1) u< L) leave()
 print(a[i] + a[i+1]) 

If we know that L is less than UINT_MAX, we could possible prove (in a control dependent way) that i + 1 does not overflow.  This gives us:
 if (i u< L) leave()
 if ((i +nuw 1) u< L) leave()
 print(a[i] + a[i+1]) 

If we now do the transform this patch proposed, we end up with:
 if ((i +nuw 1) u< L) leave_appropriately()
 print(a[i] + a[i+1]) 

That would be a miscompile when i==-1.  The problem here is that the control dependent nuw bits got used to prove something about the first condition.  That's obviously invalid.

This won't happen today, but since I plan to enhance LVI/CVP with exactly that transform at some point in the not too distant future...

llvm-svn: 250430
2015-10-15 16:51:00 +00:00
..
Hello Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
IPO Sample Profiles - Adjust integer types. Mostly NFC. 2015-10-15 16:36:21 +00:00
InstCombine InstCombine: Remove ilist iterator implicit conversions, NFC 2015-10-13 16:59:33 +00:00
Instrumentation [msan] Fix crash on multiplication by a non-integer constant. 2015-10-14 00:21:13 +00:00
ObjCARC [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible 2015-09-09 17:55:00 +00:00
Scalar [ScalarOpts] Remove dead code. 2015-10-15 15:08:58 +00:00
Utils Revert 250343 and 250344 2015-10-15 16:51:00 +00:00
Vectorize [LoopVectorize] Shrink integer operations into the smallest type possible 2015-10-12 12:34:45 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile