llvm-6502/lib/Transforms/Utils
Michael Kuperstein 6418278e7d Fix mem2reg to correctly handle allocas only used in a single block
Currently, a load from an alloca that is used in as single block and is not preceded
by a store is replaced by undef. This is not always correct if the single block is
inside a loop.
Fix the logic so that:
1) If there are no stores in the block, replace the load with an undef, as before.
2) If there is a store (regardless of where it is in the block w.r.t the load), bail
out, and let the rest of mem2reg handle this alloca.

Patch by: gil.rapaport@intel.com
Differential Revision: http://reviews.llvm.org/D11355

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242884 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 10:29:29 +00:00
..
AddDiscriminators.cpp IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
ASanStackFrameLayout.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
BasicBlockUtils.cpp [PM/AA] Remove all of the dead AliasAnalysis pointers being threaded 2015-07-22 09:52:54 +00:00
BreakCriticalEdges.cpp [PM/AA] Remove all of the dead AliasAnalysis pointers being threaded 2015-07-22 09:52:54 +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 Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
CloneFunction.cpp [LoopDist] Move loop-versioning helper functions to Cloning, NFC 2015-07-10 18:55:09 +00:00
CloneModule.cpp [Cloning] Teach CloneModule about personality functions 2015-06-30 22:14:01 +00:00
CMakeLists.txt [LoopDist/LoopVer] Move LoopVersioning to a new module, NFC 2015-07-10 18:55:13 +00:00
CmpInstAnalysis.cpp
CodeExtractor.cpp [opaque pointer type] Start migrating GEP creation to explicitly specify the pointee type 2015-03-14 01:53:18 +00:00
CtorUtils.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
DemoteRegToStack.cpp Fix a bug in DemoteRegToStack where a reload instruction was inserted into the 2015-02-09 06:38:23 +00:00
FlattenCFG.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
GlobalStatus.cpp [CallSite] Make construction from Value* (or Instruction*) explicit. 2015-04-10 14:50:08 +00:00
InlineFunction.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +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 Simplify IRBuilder::CreateCall* by using ArrayRef+initializer_list/braced init only 2015-05-18 22:13:54 +00:00
LCSSA.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
LLVMBuild.txt
Local.cpp Update enforceKnownAlignment after the isWeakForLinker semantic change 2015-07-14 00:11:08 +00:00
LoopSimplify.cpp [PM/AA] Remove all of the dead AliasAnalysis pointers being threaded 2015-07-22 09:52:54 +00:00
LoopUnroll.cpp [PM/AA] Remove all of the dead AliasAnalysis pointers being threaded 2015-07-22 09:52:54 +00:00
LoopUnrollRuntime.cpp [PM/AA] Remove all of the dead AliasAnalysis pointers being threaded 2015-07-22 09:52:54 +00:00
LoopUtils.cpp Refactor RecurrenceInstDesc 2015-06-16 22:59:45 +00:00
LoopVersioning.cpp [LAA] Lift RuntimePointerCheck out of LoopAccessInfo, NFC 2015-07-14 22:32:44 +00:00
LowerInvoke.cpp
LowerSwitch.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
Makefile
Mem2Reg.cpp
MetaRenamer.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
ModuleUtils.cpp Implement createSanitizerCtor, common helper function for all sanitizers 2015-05-06 18:48:22 +00:00
PromoteMemoryToRegister.cpp Fix mem2reg to correctly handle allocas only used in a single block 2015-07-22 10:29:29 +00:00
SimplifyCFG.cpp don't repeat function names in comments; NFC 2015-06-24 20:40:57 +00:00
SimplifyIndVar.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
SimplifyInstructions.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
SimplifyLibCalls.cpp Change Function::getIntrinsicID() to return an Intrinsic::ID. NFC. 2015-05-20 17:16:39 +00:00
SSAUpdater.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
SymbolRewriter.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
UnifyFunctionExitNodes.cpp [LPM] Stop using the string based preservation API. It is an 2015-01-28 04:57:56 +00:00
Utils.cpp
ValueMapper.cpp [opaque pointer type] Explicitly store the pointee type of the result of a GEP 2015-06-01 03:09:34 +00:00