Rafael Espindola
90896edc6c
This commit introduces two fake instructions MORESTACK_RET and
...
MORESTACK_RET_RESTORE_R10; which are lowered to a RET and a RET
followed by a MOV respectively. Having a fake instruction prevents
the verifier from seeing a MachineBasicBlock end with a
non-terminator (MOV). It also prevents the rather eccentric case of a
MachineBasicBlock ending with RET but having successors nevertheless.
Patch by Sanjoy Das.
llvm-svn: 143062
2011-10-26 21:12:27 +00:00
Duncan Sands
2faab7dd2a
Fix a bunch of unused variable warnings when doing a release
...
build with gcc-4.6.
llvm-svn: 142350
2011-10-18 12:44:00 +00:00
Bill Wendling
dcd9c25744
More closely follow libgcc, which has code after the `ret' instruction to
...
release the stack segment and reset the stack pointer. Place the code in its own
MBB to make the verifier happy.
llvm-svn: 141859
2011-10-13 08:24:19 +00:00
Bill Wendling
a6bf25f30a
Should not add instructions to a BB after a return instruction. The machine instruction verifier doesn't like this, nor do I.
...
llvm-svn: 141856
2011-10-13 07:42:32 +00:00
Jakob Stoklund Olesen
59b2982dcf
Only run MF.verify() with EXPENSIVE_CHECKS=1.
...
llvm-svn: 140441
2011-09-24 01:11:19 +00:00
Bill Wendling
763ed58408
Reenable compact unwind by default. However, also emit the old version of unwind
...
information for older linkers.
llvm-svn: 139206
2011-09-06 23:47:14 +00:00
Bill Wendling
991a1dab16
Revert r138826 until PR10834 can be fixed.
...
llvm-svn: 139018
2011-09-02 18:15:04 +00:00
Rafael Espindola
295e404961
Spelling and grammar fixes to problems found by Duncan.
...
llvm-svn: 138858
2011-08-31 16:43:33 +00:00
Eli Friedman
4fefb0a561
Make sure we don't crash when -miphoneos-version-min is specified on x86. Hopefully this will fix gcc testsuite failures.
...
llvm-svn: 138856
2011-08-31 16:19:51 +00:00
Bill Wendling
1e8c335302
Fix off-by-one error Benjamin noticed.
...
llvm-svn: 138832
2011-08-30 21:23:24 +00:00
Bill Wendling
569b9fee87
Enable compact unwind info by default. This only applies to Darwin when CFI is
...
disabled.
llvm-svn: 138826
2011-08-30 20:54:11 +00:00
Rafael Espindola
321e47cd0b
Emit segmented-stack specific code into function prologues for
...
X86. Modify the pass added in the previous patch to call this new
code.
This new prologues generated will call a libgcc routine (__morestack)
to allocate more stack space from the heap when required
Patch by Sanjoy Das.
llvm-svn: 138812
2011-08-30 19:39:58 +00:00
Andrew Trick
68f830e252
findDeadCallerSavedReg fix: Missing NULL terminator in register arrays.
...
Fix by Ivan Baev. Sorry I don't have a unit test, but the fix is obvious so I don't want to delay it.
llvm-svn: 137404
2011-08-12 00:49:19 +00:00
Bill Wendling
7f89bce2be
The compact unwinding offsets are divided by 8 on 64-bit machines.
...
llvm-svn: 136065
2011-07-26 08:03:49 +00:00
Bill Wendling
9a3aca1f35
Update the comment. This feature is available only on Darwin at the moment. Though it's not Darwin-specific.
...
llvm-svn: 135951
2011-07-25 20:15:15 +00:00
Bill Wendling
713310d300
Changed disabled code into a flag.
...
llvm-svn: 135924
2011-07-25 18:04:49 +00:00
Bill Wendling
b910d857ef
Remove dead variable.
...
llvm-svn: 135923
2011-07-25 18:01:27 +00:00
Bill Wendling
3817554121
After we've modified the prolog to save volatile registers, generate the compact
...
unwind encoding for that function. This simply crawls through the prolog looking
for machine instrs marked as "frame setup". It can calculate from these what the
compact unwind should look like.
This is currently disabled because of needed linker support. But initial tests
look good.
llvm-svn: 135922
2011-07-25 18:00:28 +00:00
Bill Wendling
1f46862df8
Mark instructions which are part of the frame setup with the MachineInstr::FrameSetup flag.
...
llvm-svn: 135645
2011-07-21 00:44:56 +00:00
Bill Wendling
4958d250c9
Remove unused function.
...
llvm-svn: 135635
2011-07-20 23:07:42 +00:00
Bill Wendling
55eb4a26d9
Remove the now defunct getCompactUnwindEncoding method from the frame lowering code.
...
llvm-svn: 135634
2011-07-20 23:04:09 +00:00
Evan Cheng
10c6820ff4
Move getInitialFrameState from TargetFrameInfo to MCAsmInfo (suggestions for
...
better location welcome).
llvm-svn: 135438
2011-07-18 22:29:13 +00:00
Bill Wendling
ed868b039b
* Redo the permutation encoding for frameless stacks to be more like what the
...
unwind library expects.
* Comment the permutation encoding for frameless stacks.
llvm-svn: 135202
2011-07-14 22:01:34 +00:00
Bill Wendling
e896e46a8c
Add code to handle a "frameless" unwind stack.
...
The frameless unwind stack has a special encoding, the algorithm for which is in
"permuteEncode".
llvm-svn: 135103
2011-07-13 23:03:31 +00:00
Bill Wendling
e6de1eeb86
Don't emit the FDE end label if the last thing emitted was a compact unwind and
...
not the FDE
llvm-svn: 135020
2011-07-13 00:49:09 +00:00
Bill Wendling
78fce7597f
Assign variable before we test it.
...
llvm-svn: 135015
2011-07-13 00:23:39 +00:00
Bill Wendling
d61dd044e1
Fix obvious think-o.
...
llvm-svn: 135014
2011-07-13 00:20:09 +00:00
Bill Wendling
9e1528dea4
Clean up the handling of an EBP/RBP unwind frame pointer. In particular, don't
...
assert when the frame pointer is -1 (i.e., the function is "frameless").
Still to do: "frameless" unwind information.
llvm-svn: 135013
2011-07-13 00:16:14 +00:00
Bill Wendling
2b47bfeaa9
Use ArrayRef instead of a std::vector&.
...
llvm-svn: 134595
2011-07-07 04:42:01 +00:00
Bill Wendling
ba39846c2b
Add a target hook to encode the compact unwind information.
...
llvm-svn: 134577
2011-07-07 00:54:13 +00:00
Nick Lewycky
6a95970b19
Fit banner in 80-col and adjust whitespace. No functionality changes.
...
llvm-svn: 132964
2011-06-14 03:23:52 +00:00
Charles Davis
27dba856ab
Put FrameSetup flag on x86 instructions that set up the call frame. No
...
functionality change.
Later on, we'll use the flag to emit SEH pseudo-ops that describe how the
call frame was built.
llvm-svn: 132880
2011-06-12 01:45:54 +00:00
Rafael Espindola
70213c7c5f
Replace the -unwind-tables option with a per function flag. This is more
...
LTO friendly as we can now correctly merge files compiled with or without
-fasynchronous-unwind-tables.
llvm-svn: 132033
2011-05-25 03:44:17 +00:00
Rafael Espindola
59c3a084c6
Print all the moves at a given label instead of just the first one.
...
Remove previous DwarfCFI hack.
llvm-svn: 130187
2011-04-26 03:58:56 +00:00
Rafael Espindola
99831068c8
Add 129518 back with a fix for when we are producing eh just because of debug info.
...
Change ELF systems to use CFI for producing the EH tables. This reduces the
size of the clang binary in Debug builds from 690MB to 679MB.
llvm-svn: 129571
2011-04-15 15:11:06 +00:00
Chris Lattner
0304b82f80
Fix a ton of comment typos found by codespell. Patch by
...
Luis Felipe Strano Moraes!
llvm-svn: 129558
2011-04-15 05:18:47 +00:00
NAKAMURA Takumi
7aed456653
Revert r129518, "Change ELF systems to use CFI for producing the EH tables. This reduces the"
...
It broke several builds.
llvm-svn: 129557
2011-04-15 03:35:57 +00:00
Rafael Espindola
d5eed657e2
Change ELF systems to use CFI for producing the EH tables. This reduces the
...
size of the clang binary in Debug builds from 690MB to 679MB.
llvm-svn: 129518
2011-04-14 15:18:53 +00:00
NAKAMURA Takumi
cabdaca3c7
Target/X86: [PR8777][PR8778] Tweak alloca/chkstk for Windows targets.
...
FIXME: Some cleanups would be needed.
llvm-svn: 128206
2011-03-24 07:07:00 +00:00
NAKAMURA Takumi
b35d45a714
Target/X86: Always emit "push/pop GPRs" in prologue/epilogue and emit "spill/reload frames" for XMMs.
...
It improves Win64's prologue/epilogue but it would not affect ia32 and amd64 (lack of nonvolatile XMMs).
llvm-svn: 126568
2011-02-27 08:47:19 +00:00
NAKAMURA Takumi
07a84f5950
Target/X86: Tweak allocating shadow area (aka home) on Win64. It must be enough for caller to allocate one.
...
llvm-svn: 124949
2011-02-05 15:11:32 +00:00
NAKAMURA Takumi
c4522ab931
Target/X86: Fix whitespace.
...
llvm-svn: 124946
2011-02-05 15:10:54 +00:00
Carl Norum
667d5dbdcb
Test commit - fix a double 'should' in a comment.
...
llvm-svn: 124652
2011-02-01 07:38:42 +00:00
Evan Cheng
0e8c521bbd
Patches to build EFI with Clang/LLVM. By Carl Norum.
...
llvm-svn: 124639
2011-02-01 01:14:13 +00:00
Anton Korobeynikov
6b2f110a3d
Cleanup
...
llvm-svn: 123475
2011-01-14 21:57:58 +00:00
Jakob Stoklund Olesen
918de3a3b8
Fix a few more places that should use MBB::getLastNonDebugInstr().
...
llvm-svn: 123408
2011-01-13 22:47:43 +00:00
Jakob Stoklund Olesen
0f2b9d9dc4
Teach frame lowering to ignore debug values after the terminators.
...
llvm-svn: 123399
2011-01-13 21:28:52 +00:00
Anton Korobeynikov
cf5967630b
Rename TargetFrameInfo into TargetFrameLowering. Also, put couple of FIXMEs and fixes here and there.
...
llvm-svn: 123170
2011-01-10 12:39:04 +00:00