llvm-6502/lib
Bob Wilson 5820b51546 Fix incorrect immediate size for AddrModeT2_i8s4 in rewriteT2FrameIndex.
The natural way to handle this addressing mode would be to say that it has
8 bits and gets scaled by 4, but since the MC layer is expecting the scaling
to be already reflected in the immediate value, we have been setting the
Scale to 1. That's fine, but then NumBits needs to be adjusted to reflect
the effective increase in the range of the immediate. That adjustment was
missing.

The consequence is that the register scavenger can fail.
The estimateRSStackSizeLimit() function in ARMFrameLowering.cpp correctly
assumes that the AddrModeT2_i8s4 address mode can handle scaled offsets up to
1020. Under just the right circumstances, we fail to reserve space for the
scavenger because it thinks that nothing will be needed. However, the overly
pessimistic behavior in rewriteT2FrameIndex causes some frame indexes to be
out of range and require scavenged registers, and so the scavenger asserts.

Unfortunately I have not been able to come up with a testcase for this. I
can only reproduce it on an internal branch where the frame layout and
register allocation is slightly different than trunk. We really need a
way to serialize MachineInstr-level IR to write reasonable tests for things
like this.

rdar://problem/19909005

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230233 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 16:57:19 +00:00
..
Analysis
AsmParser AsmParser: Check ConstantExpr insertvalue operands for type correctness 2015-02-23 07:13:52 +00:00
Bitcode Use common parse routine to read alignment values from bitcode 2015-02-22 19:32:03 +00:00
CodeGen [DagCombiner] Generalized BuildVector Vector Concatenation 2015-02-22 18:17:28 +00:00
DebugInfo [llvm-pdbdump] Very minor code cleanup. 2015-02-23 05:59:14 +00:00
ExecutionEngine [Orc] Remove redundant using directive. 2015-02-22 01:48:23 +00:00
Fuzzer
IR AsmParser/Writer: Handle symbolic constants in DI 'flags:' 2015-02-21 01:02:18 +00:00
IRReader
LineEditor
Linker
LTO
MC COFF: Add 'IMAGE_SCN_CNT_INITIALIZED_DATA' to all DWARF sections 2015-02-22 02:35:27 +00:00
Object [obj2yaml/yaml2obj] Add SHT_GROUP support. 2015-02-21 04:28:26 +00:00
Option
ProfileData
Support Sync the __builtin_expects for our 3 quadratically probed hash table implementations. 2015-02-23 16:41:36 +00:00
TableGen
Target Fix incorrect immediate size for AddrModeT2_i8s4 in rewriteT2FrameIndex. 2015-02-23 16:57:19 +00:00
Transforms Roll condition into an assert then wrap it 'ifndef NDEBUG' to protect from the inevitable "unused variable" warning in a non-asserts build. 2015-02-22 20:58:38 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile