Commit Graph

11926 Commits

Author SHA1 Message Date
Stuart Hastings
090bf19de6 Fix double FGETSIGN to work on x86_32; followup to 132396.
rdar://problem/5660695


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132411 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01 18:32:25 +00:00
Stuart Hastings
bdce3726e2 Turn on FGETSIGN for x86. Followup to 132388. rdar://problem/5660695
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132396 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01 14:04:17 +00:00
Nadav Rotem
b6fbec3a54 This patch is another step in the direction of adding vector select. In this
patch we add a flag to enable a new type legalization decision - to promote
integer elements in vectors. Currently, the rest of the codegen does not support
this kind of legalization.  This flag will be removed when the transition is
complete.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132394 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01 12:51:46 +00:00
Andrew Trick
cf9aa284b3 Add an issue width check to the postRA scheduler. Patch by Max Kazakov!
For targets with no itinerary (x86) it is a nop by default. For
targets with issue width already expressed in the itinerary (ARM) it
bypasses a scoreboard check but otherwise does not affect the
schedule. It does make the code more consistent and complete and
allows new targets to specify their issue width in an arbitrary way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132385 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01 03:27:56 +00:00
Bill Wendling
edac4923dc The ARM stuff already calls the Resume function, not the Resume_or_Rethrow. It
turns out that it could cause an infinite loop in some situations. If this code
is triggered and it converts a cleanup into a catchall, but that cleanup was in
already in a cleanup, then the _Unwind_SjLj_Resume could infinite loop. I.e.,
the code doesn't consume the exception object and passes it on to
_Unwind_SjLj_Resume. But _USjLjR expects it to be consumed (since it's landing
at a catchall instead of a cleanup). So it uses the values that are presently
there, which are the values that tell it to jump to the fake landing pad.
<rdar://problem/9508402>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132381 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01 01:49:35 +00:00
Devang Patel
c20bdf194a Incomplete type may not have corresponding DIE, so do not check DIEEntry eagerly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132377 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01 00:23:24 +00:00
Devang Patel
66658e4dff Refactor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132373 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-31 23:30:30 +00:00
Devang Patel
e9ae06ca98 Include global types, that are referenced through local variables, in debug_pubtypes list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132371 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-31 22:56:51 +00:00
Jakob Stoklund Olesen
d2056e51c6 Simplify the eviction policy by making the failsafe explicit.
When assigned ranges are evicted, they are put in the RS_Evicted stage and are
not allowed to evict anything else. That prevents looping automatically.

When evicting ranges just to get a cheaper register, use only spill weights to
find the possible candidates. Avoid breaking hints for this purpose, it is not
worth it.

Start implementing more complex eviction heuristics, guarded by the temporary
-complex-eviction flag. The initial version permits a heavier range to be
evicted if it doesn't have any uses where the evicting range is live. This makes
it a good candidate for live ranfge splitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132358 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-31 21:02:44 +00:00
Jakob Stoklund Olesen
a2e79ef908 Reapply r132245 with a fix for the bug that broke the darwin9/i386 build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132309 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-30 01:33:26 +00:00
Charles Davis
59ed4151d8 Emit the handler's data area. For GCC-style exceptions under Win64, the
handler's data area starts with a 4-byte reference to the personality
function, followed by the DWARF LSDA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132302 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-30 00:13:34 +00:00
Jakob Stoklund Olesen
626d6fb190 Revert r132245, "Create two BlockInfo entries when a live range is discontinuous through a block."
This commit seems to have broken a darwin 9 tester.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132299 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-29 21:24:39 +00:00
Jakob Stoklund Olesen
57903357ee Fix PR10046 by updating LiveVariables kill info when splitting live ranges.
This only affects targets like Mips where branch instructions may kill virtual
registers. Most other targets branch on flag values, so virtual registers are
not involved.

The problem is that MachineBasicBlock::updateTerminator deletes branches and
inserts new ones while LiveVariables keeps a list of pointers to instructions
that kill virtual registers. That list wasn't properly updated in
MBB::SplitCriticalEdge.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132298 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-29 20:10:28 +00:00
Charles Davis
12e3349de9 When generating against the Win64 EH scheme, set the handler to the GCC-specific
handler.

At this moment, only GCC-style exceptions are supported. Other kinds
of exceptions, including "traditional" SEH and Microsoft Visual C++ exceptions,
need more work--and an compiler exception model that isn't specific to
GCC-style exceptions!

In particular, I imagine that it would be possible to mix "traditional" SEH
with GCC-style EH or Microsoft C++ EH. Currently LLVM has no way (beyond some
target-specific defaults and whole-module compiler switches) of knowing which
scheme to use when.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132283 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-29 04:28:35 +00:00
Nadav Rotem
b6aacae941 Refactor the type legalizer. Switch TargetLowering to a new enum - LegalizeTypeAction.
This patch does not change the behavior of the type legalizer. The codegen
produces the same code.
This infrastructural change is needed in order to enable complex decisions
for vector types (needed by the vector-select patch).




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132263 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 17:57:14 +00:00
Benjamin Kramer
33858016ea Erase instructions _after_ checking their type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132256 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 11:48:37 +00:00
John McCall
d7c1086201 Implement and document the llvm.eh.resume intrinsic, which is
transformed by the inliner into a branch to the enclosing landing pad
(when inlined through an invoke).  If not so optimized, it is lowered
DWARF EH preparation into a call to _Unwind_Resume (or _Unwind_SjLj_Resume
as appropriate).  Its chief advantage is that it takes both the
exception value and the selector value as arguments, meaning that there
is zero effort in recovering these;  however, the frontend is required
to pass these down, which is not actually particularly difficult.

Also document the behavior of landing pads a bit better, and make it
clearer that it's okay that personality functions don't always land at
landing pads.  This is just a fact of life.  Don't write optimizations that
rely on pushing things over an unwind edge.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132253 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 07:45:59 +00:00
Charles Davis
f46337004a When generating code for Win64 EH, emit StartProc and EndProc directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132250 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 04:21:04 +00:00
Jakob Stoklund Olesen
c9cf9e94ec Create two BlockInfo entries when a live range is discontinuous through a block.
Delete the Kill and Def markers in BlockInfo. They are no longer
necessary when BlockInfo describes a continuous live range.

This only affects the relatively rare kind of basic block where a live
range looks like this:

 |---x   o---|

Now live range splitting can pretend that it is looking at two blocks:

 |---x
         o---|

This allows the code to be simplified a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132245 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 02:33:00 +00:00
Jakob Stoklund Olesen
b2abfa0bf3 Add SplitAnalysis::getNumLiveBlocks().
It is important that this function returns the same number of live blocks as
countLiveBlocks(CurLI) because live range splitting uses the number of live
blocks to ensure it is making progress.

This is in preparation of supporting duplicate UseBlock entries for basic blocks
that have a virtual register live-in and live-out, but not live-though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132244 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 02:32:57 +00:00
Devang Patel
d6a8136e66 Select DW_AT_const_value size based on global variable size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132239 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 00:39:18 +00:00
Rafael Espindola
7bf114c1bd Fix the root cause of the bootstrap failure:
There was no way to check if a given register/mode pair was valid. We now return
an error code (-2) instead of asserting. If anyone thinks that an assert
at this point  is really needed, we can autogen a hasValidDwarfRegNum instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132236 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 00:13:01 +00:00
Charles Davis
d652b1368b Stub out support for Win64-style exceptions. Note that this is merely using
the Win64 EH mechanism to implement GCC-style exceptions. LLVM supports
hardly anything else at this point!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132234 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 23:47:32 +00:00
Rafael Espindola
37afca128d Fix a regression I recently introduced by removing DwarfRegNum of
subregisters:

When a value is in a subregister, at least report the location as being
the superregister. We should extend the .td files to encode the bit
range so that we can produce a DW_OP_bit_piece.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132224 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 22:15:01 +00:00
Rafael Espindola
5b23b7fe31 Make size computation less brittle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132222 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 22:05:41 +00:00
Charles Davis
88c816453f Add the suffix to the Win64 EH data sections' names if given. Add a test for
this. XFAIL'd, because the COFF AsmParser can't handle .section yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132220 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 21:38:47 +00:00
Nadav Rotem
2d6dcb34b7 Refactor getActionType and getTypeToTransformTo ; place all of the 'decision'
code in one place. Re-apply 131534 and fix the multi-step promotion of integers.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132217 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 21:03:13 +00:00
Devang Patel
045c1d4e48 Keep this simple. Use DIType to get signness and size of a type. Based on size, select appropraite form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132206 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 19:13:26 +00:00
Devang Patel
72f0d9cdef Handle signed types gracefully.
This fixes regressions reported by buildbots as a fallout of r132193.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132197 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 18:15:52 +00:00
Devang Patel
b58128e2b2 Select DW_AT_const_value size based on variable size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132193 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 16:45:18 +00:00
Cameron Zwarich
f031d0977f Fix PR10029 - VerifyCoalescing failure on patterns_dfa.c of 445.gobmk.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132181 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 05:04:51 +00:00
Devang Patel
95ba669e09 Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132149 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-26 21:49:28 +00:00
Devang Patel
785badb83e During branch folding avoid inserting redundant DBG_VALUE machine instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132148 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-26 21:47:59 +00:00
Charles Davis
cfb2bbba73 Revert r132111. I built Release (without Asserts), so I didn't know about the
assert that prevented setting alignment on section creation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132113 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-26 05:35:55 +00:00
Charles Davis
fad99ae6e7 Align Win64 EH Table sections to 4 bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132111 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-26 05:19:54 +00:00
Stuart Hastings
2aa0f23e1c Reverting 132105: it broke some LLVM-GCC DejaGNU tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132108 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-26 04:09:49 +00:00
Stuart Hastings
aa4e6afc9b Correctly handle a one-word struct passed byval on x86_64.
rdar://problem/6920088


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132105 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-26 02:44:56 +00:00
Jakob Stoklund Olesen
b8d936bc17 Add a RAGreedy::canEvict function.
This doesn't change functionality (much), but it allows for a more fine-grained
eviction policy. The current policy only compares spill weights, and that is not
always the best thing to do.  Spill weights are designed to serve linear scan,
and they don't consider live range splitting.

Add a mechanism so canEvict() can request that a live range be evicted and
split/spilled. This is to avoid infinite eviction loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132101 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-25 23:58:36 +00:00
Eli Friedman
76927d7303 Rewrite fast-isel integer cast handling to handle more cases, and to be simpler and more consistent.
The practical effects here are that x86-64 fast-isel can now handle trunc from i8 to i1, and ARM fast-isel can handle many more constructs involving integers narrower than 32 bits (including loads, stores, and many integer casts).

rdar://9437928 .



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132099 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-25 23:49:02 +00:00
Devang Patel
8a115d5bf4 Remove unused statistical counter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132087 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-25 21:55:40 +00:00
Rafael Espindola
fc2bb8c444 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132033 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-25 03:44:17 +00:00
Devang Patel
8ec0c1c07b Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131974 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 18:27:52 +00:00
Rafael Espindola
e665798097 Explain FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131952 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 03:10:31 +00:00
Rafael Espindola
10c3e128ef Fix the defaults for .eh_frame. We were marking it as writable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131951 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 02:50:20 +00:00
Evan Cheng
b5a55d979c - Teach SelectionDAG::isKnownNeverZero to return true (op x, c) when c is
non-zero.
- Teach X86 cmov optimization to eliminate the cmov from ctlz, cttz extension
  when the source of X86ISD::BSR / X86ISD::BSF is proven to be non-zero.

rdar://9490949


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131948 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 01:48:22 +00:00
Devang Patel
a9b324be9c Fix debug info for blocks' variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131940 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 00:22:25 +00:00
Devang Patel
c481b70a6a Remove unnecessary comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131936 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 23:16:14 +00:00
Devang Patel
9728ea2447 Revert 121907 (it causes llc crash) and apply original patch from PR9817.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131926 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 22:04:42 +00:00
Devang Patel
233857537f Preserve debug info during iSel by keeping DanglingDebugInfoMap live until end of function.
Patch by Micah Villmow


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131908 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 17:44:13 +00:00
Devang Patel
35b6994608 While replacing all uses of a SDValue with another value, do not forget to transfer SDDbgValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131907 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 17:35:08 +00:00