llvm-mirror/lib/CodeGen/SelectionDAG
Pete Cooper bedb6f3c4b Check for dynamic alloca's when selecting lifetime intrinsics.
TL;DR: Indexing maps with [] creates missing entries.

The long version:

When selecting lifetime intrinsics, we index the *static* alloca map with the AllocaInst we find for that lifetime.  Trouble is, we don't first check to see if this is a dynamic alloca.

On the attached example, this causes a dynamic alloca to create an entry in the static map, and returns 0 (the default) as the frame index for that lifetime.  0 was used for the frame index of the stack protector, which given that it now has a lifetime, is coloured, and merged with other stack slots.

PEI would later trigger an assert because it expects the stack protector to not be dead.

This fix ensures that we only get frame indices for static allocas, ie, those in the map.  Dynamic ones are effectively dropped, which is suboptimal, but at least isn't completely broken.

rdar://problem/18672951

llvm-svn: 220099
2014-10-17 22:59:33 +00:00
..
CMakeLists.txt llvm/lib: [CMake] Add explicit dependency to intrinsics_gen. 2012-06-24 13:32:01 +00:00
DAGCombiner.cpp SelectionDAG: Add sext_inreg optimizations 2014-10-17 14:45:25 +00:00
FastISel.cpp Remove getSubtargetImpl calls from FastISel, we can get it from 2014-10-08 23:38:33 +00:00
FunctionLoweringInfo.cpp Remove uses of the TargetMachine from FunctionLoweringInfo 2014-10-09 00:57:31 +00:00
InstrEmitter.cpp Remove the uses of getSubtargetImpl from InstrEmitter and remove 2014-10-09 01:35:29 +00:00
InstrEmitter.h Remove the uses of getSubtargetImpl from InstrEmitter and remove 2014-10-09 01:35:29 +00:00
LegalizeDAG.cpp Use the subtarget on the dag to get TargetFrameLowering rather 2014-10-09 01:35:27 +00:00
LegalizeFloatTypes.cpp ARM: fix @llvm.convert.from.fp16 on softfloat targets. 2014-07-29 09:56:38 +00:00
LegalizeIntegerTypes.cpp Optimize sext/zext insertion algorithm in back-end. 2014-09-19 05:30:35 +00:00
LegalizeTypes.cpp Make it possible for ints/floats to return different values from getBooleanContents() 2014-07-10 10:18:12 +00:00
LegalizeTypes.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
LegalizeTypesGeneric.cpp AA metadata refactoring (introduce AAMDNodes) 2014-07-24 12:16:19 +00:00
LegalizeVectorOps.cpp Teach the AArch64 backend about v4f16 and v8f16 2014-08-27 16:16:04 +00:00
LegalizeVectorTypes.cpp Allow targets to custom legalize vector insertion and extraction. 2014-09-12 22:16:11 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Makefile make -fno-rtti the default unless a directory builds with REQUIRES_RTTI. 2010-01-24 20:43:08 +00:00
ResourcePriorityQueue.cpp Remove unused argument to CreateTargetScheduleState and change 2014-10-09 01:59:35 +00:00
ScheduleDAGFast.cpp [Modules] Remove potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:02:50 +00:00
ScheduleDAGRRList.cpp Remove more calls to getSubtargetImpl from the schedulers and 2014-10-09 06:28:06 +00:00
ScheduleDAGSDNodes.cpp Remove more calls to getSubtargetImpl from the schedulers and 2014-10-09 06:28:06 +00:00
ScheduleDAGSDNodes.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
ScheduleDAGVLIW.cpp Remove more calls to getSubtargetImpl from the schedulers and 2014-10-09 06:28:06 +00:00
SDNodeDbgValue.h constify the getters in SDNodeDbgValue. 2014-10-13 20:43:47 +00:00
SelectionDAG.cpp Modernize old-style static asserts. NFC. 2014-10-12 17:56:40 +00:00
SelectionDAGBuilder.cpp Check for dynamic alloca's when selecting lifetime intrinsics. 2014-10-17 22:59:33 +00:00
SelectionDAGBuilder.h [Stackmaps] Enable invoking the patchpoint intrinsic. 2014-10-17 17:39:00 +00:00
SelectionDAGDumper.cpp Have MachineFunction cache a pointer to the subtarget to make lookups 2014-08-05 02:39:49 +00:00
SelectionDAGISel.cpp Remove uses of the TargetMachine from FunctionLoweringInfo 2014-10-09 00:57:31 +00:00
SelectionDAGPrinter.cpp Revert "Introduce a string_ostream string builder facilty" 2014-06-26 22:52:05 +00:00
TargetLowering.cpp Eliminate some deep std::vector copies. NFC. 2014-10-03 18:33:16 +00:00
TargetSelectionDAGInfo.cpp Have TargetSelectionDAGInfo take a DataLayout initializer rather than 2014-06-06 19:04:48 +00:00