#
acd0338c |
| 07-May-2014 |
Saleem Abdulrasool <compnerd@compnerd.org> |
ARM: fix WoA PEI instruction selection
The ARM::BLX instruction is an ARM mode instruction. The Windows on ARM target is limited to Thumb instructions. Correctly use the thumb mode tBLXr instructi
ARM: fix WoA PEI instruction selection
The ARM::BLX instruction is an ARM mode instruction. The Windows on ARM target is limited to Thumb instructions. Correctly use the thumb mode tBLXr instruction. This would manifest as an errant write into the object file as the instruction is 4-bytes in length rather than 2. The result would be a corrupted object file that would eventually result in an executable that would crash at runtime.
llvm-svn: 208152
show more ...
|
#
818e7251 |
| 06-May-2014 |
Joerg Sonnenberger <joerg@bec.de> |
If a function needs a frame pointer, but r11 (aka fp) has not been used, remove it from the list of unspilled registers. Otherwise the following attempt to keep the stack aligned by picking an extra
If a function needs a frame pointer, but r11 (aka fp) has not been used, remove it from the list of unspilled registers. Otherwise the following attempt to keep the stack aligned by picking an extra GPR register to spill will not work as it picks up r11.
llvm-svn: 208129
show more ...
|
#
7158303a |
| 01-May-2014 |
Saleem Abdulrasool <compnerd@compnerd.org> |
ARM: fix memory leak, simplify WoA stack probing
This fixes the memory leak introduced with the initial addition of support for WoA stack probing. Now that the pseudo-instruction expansion can hand
ARM: fix memory leak, simplify WoA stack probing
This fixes the memory leak introduced with the initial addition of support for WoA stack probing. Now that the pseudo-instruction expansion can handle an external symbol, use that to generate the load which simplifies the logic as well as avoids the memory leak.
llvm-svn: 207737
show more ...
|
#
25947c31 |
| 30-Apr-2014 |
Saleem Abdulrasool <compnerd@compnerd.org> |
ARM: support stack probe emission for Windows on ARM
This introduces the stack lowering emission of the stack probe function for Windows on ARM. The stack on Windows on ARM is a dynamically paged st
ARM: support stack probe emission for Windows on ARM
This introduces the stack lowering emission of the stack probe function for Windows on ARM. The stack on Windows on ARM is a dynamically paged stack where any page allocation which crosses a page boundary of the following guard page will cause a page fault. This page fault must be handled by the kernel to ensure that the page is faulted in. If this does not occur and a write access any memory beyond that, the page fault will go unserviced, resulting in an abnormal program termination.
The watermark for the stack probe appears to be at 4080 bytes (for accommodating the stack guard canaries and stack alignment) when SSP is enabled. Otherwise, the stack probe is emitted on the page size boundary of 4096 bytes.
llvm-svn: 207615
show more ...
|
Revision tags: llvmorg-3.4.1, llvmorg-3.4.1-rc2 |
|
#
98444341 |
| 19-Apr-2014 |
Alp Toker <alp@nuanti.com> |
Remove some empty statements
Cleanup only.
llvm-svn: 206710
|
Revision tags: llvmorg-3.4.1-rc1 |
|
#
16f98b25 |
| 09-Apr-2014 |
Alp Toker <alp@nuanti.com> |
Fix some doc and comment typos
llvm-svn: 205899
|
#
840beec2 |
| 04-Apr-2014 |
Craig Topper <craig.topper@gmail.com> |
Make consistent use of MCPhysReg instead of uint16_t throughout the tree.
llvm-svn: 205610
|
#
f92e8f5a |
| 04-Apr-2014 |
Jim Grosbach <grosbach@apple.com> |
ARM: Use range-based for loops in frame lowering.
No functional change.
llvm-svn: 205602
|
#
92e0fc04 |
| 03-Apr-2014 |
Oliver Stannard <oliver.stannard@arm.com> |
ARM: Use __STACK_LIMIT symbol for segmented stacks
We cannot use STACK_LIMIT, as it is not reserved for the compiler by the C spec.
llvm-svn: 205516
|
#
b14c6251 |
| 02-Apr-2014 |
Oliver Stannard <oliver.stannard@arm.com> |
ARM: Add support for segmented stacks
Patch by Alex Crichton, ILyoan, Luqman Aden and Svetoslav.
llvm-svn: 205430
|
#
3cccc45a |
| 12-Mar-2014 |
Tim Northover <tnorthover@apple.com> |
ARM: correct Dwarf output for non-contiguous VFP saves.
When the list of VFP registers to be saved was non-contiguous (so multiple vpush/vpop instructions were needed) these were being ordered oddly
ARM: correct Dwarf output for non-contiguous VFP saves.
When the list of VFP registers to be saved was non-contiguous (so multiple vpush/vpop instructions were needed) these were being ordered oddly, as in: vpush {d8, d9} vpush {d11}
This led to the layout in memory being [d11, d8, d9] which is ugly and doesn't match the CFI_INSTRUCTIONs we're generating either (so Dwarf info would be broken).
This switches the order of vpush/vpop (in both prologue and epilogue, obviously) so that the Dwarf locations are correct again.
rdar://problem/16264856
llvm-svn: 203655
show more ...
|
#
b1f25f1b |
| 07-Mar-2014 |
Rafael Espindola <rafael.espindola@gmail.com> |
Replace PROLOG_LABEL with a new CFI_INSTRUCTION.
The old system was fairly convoluted: * A temporary label was created. * A single PROLOG_LABEL was created with it. * A few MCCFIInstructions were cr
Replace PROLOG_LABEL with a new CFI_INSTRUCTION.
The old system was fairly convoluted: * A temporary label was created. * A single PROLOG_LABEL was created with it. * A few MCCFIInstructions were created with the same label.
The semantics were that the cfi instructions were mapped to the PROLOG_LABEL via the temporary label. The output position was that of the PROLOG_LABEL. The temporary label itself was used only for doing the mapping.
The new CFI_INSTRUCTION has a 1:1 mapping to MCCFIInstructions and points to one by holding an index into the CFI instructions of this function.
I did consider removing MMI.getFrameInstructions completelly and having CFI_INSTRUCTION own a MCCFIInstruction, but MCCFIInstructions have non trivial constructors and destructors and are somewhat big, so the this setup is probably better.
The net result is that we don't create temporary labels that are never used.
llvm-svn: 203204
show more ...
|
#
d55e115b |
| 05-Mar-2014 |
Oliver Stannard <oliver.stannard@arm.com> |
ARM: Correctly align arguments after a byval struct is passed on the stack
llvm-svn: 202985
|
#
b6d0bd48 |
| 02-Mar-2014 |
Benjamin Kramer <benny.kra@googlemail.com> |
[C++11] Replace llvm::next and llvm::prior with std::next and std::prev.
Remove the old functions.
llvm-svn: 202636
|
#
f6830f47 |
| 14-Feb-2014 |
Artyom Skrobov <Artyom.Skrobov@arm.com> |
Generate the DWARF stack frame decode operations in the function prologue for ARM/Thumb functions.
Patch by Keith Walker!
llvm-svn: 201423
|
#
d6a729bb |
| 06-Jan-2014 |
Tim Northover <tnorthover@apple.com> |
ARM MachO: sort out isTargetDarwin/isTargetIOS/... checks.
The ARM backend has been using most of the MachO related subtarget checks almost interchangeably, and since the only target it's had to run
ARM MachO: sort out isTargetDarwin/isTargetIOS/... checks.
The ARM backend has been using most of the MachO related subtarget checks almost interchangeably, and since the only target it's had to run on has been IOS (which is all three of MachO, Darwin and IOS) it's worked out OK so far.
But we'd like to support embedded targets under the "*-*-none-macho" triple, which means everything starts falling apart and inconsistent behaviours emerge.
This patch should pick a reasonably sensible set of behaviours for the new triple (and any others that come along, with luck). Some choices were debatable (notably FP == r7 or r11), but we can revisit those later when deficiencies become apparent.
llvm-svn: 198617
show more ...
|
Revision tags: llvmorg-3.4.0, llvmorg-3.4.0-rc3 |
|
#
a4173715 |
| 08-Dec-2013 |
Tim Northover <tnorthover@apple.com> |
ARM: fix folding of stack-adjustment (yet again).
When trying to eliminate an "sub sp, sp, #N" instruction by folding it into an existing push/pop using dummy registers, we need to account for the f
ARM: fix folding of stack-adjustment (yet again).
When trying to eliminate an "sub sp, sp, #N" instruction by folding it into an existing push/pop using dummy registers, we need to account for the fact that this might affect precisely how "fp" gets set in the prologue.
We were attempting this, but assuming that *whenever* we performed a fold it would make a difference. This is false, for example, in: push {r4, r7, lr} add fp, sp, #4 vpush {d8} sub sp, sp, #8
we can fold the "sub" into the "vpush", forming "vpush {d7, d8}". However, in that case the "add fp" instruction mustn't change, which we were getting wrong before.
Should fix PR18160.
llvm-svn: 196725
show more ...
|
#
e4def5e2 |
| 05-Dec-2013 |
Tim Northover <tnorthover@apple.com> |
ARM: fix yet another stack-folding bug
We were trying to fold the stack adjustment into the wrong instruction in the situation where the entire basic-block was epilogue code. Really, it can only eve
ARM: fix yet another stack-folding bug
We were trying to fold the stack adjustment into the wrong instruction in the situation where the entire basic-block was epilogue code. Really, it can only ever be valid to do the folding precisely where the "add sp, ..." would be placed so there's no need for a separate iterator to track that.
Should fix PR18136.
llvm-svn: 196493
show more ...
|
Revision tags: llvmorg-3.4.0-rc2 |
|
#
dee8604c |
| 02-Dec-2013 |
Tim Northover <tnorthover@apple.com> |
ARM: decide whether to use movw/movt based on "minsize" attribute.
llvm-svn: 196102
|
#
45479dcf |
| 01-Dec-2013 |
Tim Northover <tnorthover@apple.com> |
ARM: fix bug in -Oz stack adjustment folding
Previously, we clobbered callee-saved registers when folding an "add sp, #N" into a "pop {rD, ...}" instruction. This change checks whether a register we
ARM: fix bug in -Oz stack adjustment folding
Previously, we clobbered callee-saved registers when folding an "add sp, #N" into a "pop {rD, ...}" instruction. This change checks whether a register we're going to add to the "pop" could actually be live outside the function before doing so and should fix the issue.
This should fix PR18081.
llvm-svn: 196046
show more ...
|
Revision tags: llvmorg-3.4.0-rc1 |
|
#
93bcc66e |
| 08-Nov-2013 |
Tim Northover <tnorthover@apple.com> |
ARM: fold prologue/epilogue sp updates into push/pop for code size
ARM prologues usually look like: push {r7, lr} sub sp, sp, #4
If code size is extremely important, this can be optimised t
ARM: fold prologue/epilogue sp updates into push/pop for code size
ARM prologues usually look like: push {r7, lr} sub sp, sp, #4
If code size is extremely important, this can be optimised to the single instruction: push {r6, r7, lr}
where we don't actually care about the contents of r6, but pushing it subtracts 4 from sp as a side effect.
This should implement such a conversion, predicated on the "minsize" function attribute (-Oz) since I've yet to find any code it actually makes faster.
llvm-svn: 194264
show more ...
|
#
c9432eb9 |
| 04-Nov-2013 |
Tim Northover <tnorthover@apple.com> |
ARM: remove unnecessary state-tracking during frame lowering.
ResolveFrameIndex had what appeared to be a very nasty hack for when the frame-index referred to a callee-saved register. In this case i
ARM: remove unnecessary state-tracking during frame lowering.
ResolveFrameIndex had what appeared to be a very nasty hack for when the frame-index referred to a callee-saved register. In this case it "adjusted" the offset so that the address was correct if (and only if) the MachineInstr immediately followed the respective push.
This "worked" for all forms of GPR & DPR but was only ever used to set the frame pointer itself, and once this was put in a more sensible location the entire state-tracking machinery it relied on became redundant. So I stripped it.
The only wrinkle is that "add r7, sp, #0" might theoretically be slower (need an actual ALU slot) compared to "mov r7, sp" so I added a micro-optimisation that also makes emitARMRegUpdate and emitT2RegUpdate also work when NumBytes == 0.
No test changes since there shouldn't be any functionality change.
llvm-svn: 194025
show more ...
|
#
d8407458 |
| 01-Oct-2013 |
Tim Northover <tnorthover@apple.com> |
ARM: support interrupt attribute
This function-attribute modifies the callee-saved register list and function epilogue (specifically the return instruction) so that a routine is suitable for use as
ARM: support interrupt attribute
This function-attribute modifies the callee-saved register list and function epilogue (specifically the return instruction) so that a routine is suitable for use as an interrupt-handler of the specified type without disrupting user-mode applications.
rdar://problem/14207019
llvm-svn: 191766
show more ...
|
Revision tags: llvmorg-3.3.1-rc1, llvmorg-3.3.0, llvmorg-3.3.0-rc3, llvmorg-3.3.0-rc2 |
|
#
d0e34a20 |
| 20-May-2013 |
Stepan Dyatkovskiy <stpworld@narod.ru> |
PR15868 fix.
Introduction: In case when stack alignment is 8 and GPRs parameter part size is not N*8: we add padding to GPRs part, so part's last byte must be recovered at address K*8-1. We need to
PR15868 fix.
Introduction: In case when stack alignment is 8 and GPRs parameter part size is not N*8: we add padding to GPRs part, so part's last byte must be recovered at address K*8-1. We need to do it, since remained (stack) part of parameter starts from address K*8, and we need to "attach" "GPRs head" without gaps to it:
Stack: |---- 8 bytes block ----| |---- 8 bytes block ----| |---- 8 bytes... [ [padding] [GPRs head] ] [ ------ Tail passed via stack ------ ...
FIX: Note, once we added padding we need to correct *all* Arg offsets that are going after padded one. That's why we need this fix: Arg offsets were never corrected before this patch. See new test-cases included in patch.
We also don't need to insert padding for byval parameters that are stored in GPRs only. We need pad only last byval parameter and only in case it outsides GPRs and stack alignment = 8. Though, stack area, allocated for recovered byval params, must satisfy "Size mod 8 = 0" restriction.
This patch reduces stack usage for some cases: We can reduce ArgRegsSaveArea since inner N*4 bytes sized byval params my be "packed" with alignment 4 in some cases.
llvm-svn: 182237
show more ...
|
Revision tags: llvmorg-3.3.0-rc1 |
|
#
f5aa83db |
| 30-Apr-2013 |
Stepan Dyatkovskiy <stpworld@narod.ru> |
Refactoring patch. 1. VarArgStyleRegisters: functionality that emits "store" instructions for byval regs moved out into separated method "StoreByValRegs". Before this patch VarArgStyleRegisters had c
Refactoring patch. 1. VarArgStyleRegisters: functionality that emits "store" instructions for byval regs moved out into separated method "StoreByValRegs". Before this patch VarArgStyleRegisters had confused use-cases. It was used for both variadic functions and for regular functions with byval parameters. In last case it created new stack-frame and registered it as VarArg frame, that is wrong.
This patch replaces VarArgsStyleRegisters usage for byval parameters with StoreByValRegs method.
2. In ARMMachineFunctionInfo, "get/setVarArgsRegSaveSize" was renamed to "get/setArgRegsSaveSize". By the same reason. Sometimes it was used for variadic functions, and sometimes for byval parameters in regular functions. Actually, this property means the size of registers, that keeps arguments, and thats why it was renamed.
3. In ARMISelLowering.cpp, ARMTargetLowering class, in methods computeRegArea and StoreByValRegs, VARegXXXXXX was renamed to ArgRegsXXXXXX still by the same reasons.
llvm-svn: 180774
show more ...
|