llvm-project/llvm/lib/Transforms/Utils
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
..
ASanStackFrameLayout.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
AddDiscriminators.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
BasicBlockUtils.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
BreakCriticalEdges.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
BuildLibCalls.cpp Simplify IRBuilder::CreateCall* by using ArrayRef+initializer_list/braced init only 2015-05-18 22:13:54 +00:00
BypassSlowDivision.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
CMakeLists.txt TransformUtils: Introduce module splitter. 2015-08-21 02:48:20 +00:00
CloneFunction.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
CloneModule.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
CmpInstAnalysis.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
CodeExtractor.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
CtorUtils.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
DemoteRegToStack.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
FlattenCFG.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
GlobalStatus.cpp GlobalOpt does not treat externally_initialized globals correctly 2015-10-12 13:20:52 +00:00
InlineFunction.cpp [InlineFunction] Correctly inline TerminatePadInst 2015-10-13 22:08:17 +00:00
InstructionNamer.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
IntegerDivision.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
LCSSA.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
LLVMBuild.txt [PM/AA] Remove the last relics of the separate IPA library from LLVM, 2015-08-18 17:51:53 +00:00
Local.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
LoopSimplify.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
LoopUnroll.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
LoopUnrollRuntime.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
LoopUtils.cpp [LoopUtils,LV] Propagate fast-math flags on generated FCmp instructions 2015-09-21 19:41:19 +00:00
LoopVersioning.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
LowerInvoke.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
LowerSwitch.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
Makefile
Mem2Reg.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
MetaRenamer.cpp Whoops, remove trailing whitespace. 2015-08-27 05:37:12 +00:00
ModuleUtils.cpp [asan] Rename the ABI versioning symbol to '__asan_version_mismatch_check' instead of abusing '__asan_init' 2015-07-23 10:54:06 +00:00
PromoteMemoryToRegister.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
SSAUpdater.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
SimplifyCFG.cpp Revert 250343 and 250344 2015-10-15 16:51:00 +00:00
SimplifyIndVar.cpp [IndVars] Preserve LCSSA in `eliminateIdentitySCEV` 2015-10-07 17:38:31 +00:00
SimplifyInstructions.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
SimplifyLibCalls.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
SplitModule.cpp TransformUtils: Introduce module splitter. 2015-08-21 02:48:20 +00:00
SymbolRewriter.cpp Remove unnecessary includes 2015-08-08 00:41:53 +00:00
UnifyFunctionExitNodes.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
Utils.cpp
ValueMapper.cpp [opaque pointer type]: Pass explicit pointee type when building a constant GEP. 2015-08-21 20:16:51 +00:00