1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

47653 Commits

Author SHA1 Message Date
Chad Rosier
8ba48140ae Revert r132871.
llvm-svn: 132872
2011-06-11 02:27:46 +00:00
Chad Rosier
e78559772d Typo.
llvm-svn: 132871
2011-06-11 02:16:36 +00:00
Eli Friedman
cbadeac131 Make sure to pass OpFlags into MachineInstrBuilder::addExternalSymbol; the
memcpy/memset symbol doesn't get marked up correctly in PIC modes otherwise.
Should fix llvm-x86_64-linux-checks buildbot.  Followup to r132864.

llvm-svn: 132869
2011-06-11 01:55:07 +00:00
Andrew Trick
4591f882c2 Branch profiling: floating-point avoidance.
Patch by: Jakub Staszak!

Introduces BranchProbability. Changes unsigned to uint32_t all over and
uint64_t only when overflow is expected.

llvm-svn: 132867
2011-06-11 01:05:22 +00:00
Eli Friedman
0bb1c525fd Add full x86 fast-isel support for memcpy and memset.
rdar://9431466

llvm-svn: 132864
2011-06-10 23:39:36 +00:00
Eric Christopher
61a8a0dcfd 80-col cleanups.
llvm-svn: 132863
2011-06-10 23:05:08 +00:00
Dan Gohman
27a1b5f7c5 Initialize BasicAA's AliasCache to set it to use fewer buckets by
default, since it usually has very few elements. This speeds up
alias queries in many cases, because AliasCache.clear() doesn't
have to visit as many buckets.

llvm-svn: 132862
2011-06-10 22:30:30 +00:00
Rafael Espindola
58fdae0c51 Removed tabs. Also fixed my editor...
llvm-svn: 132857
2011-06-10 21:01:53 +00:00
Cameron Zwarich
a54eaeb7ae Provide an ARMCCState subclass of CCState so that ARM clients will always set
CallOrPrologue correctly and eliminate the existing setter.

llvm-svn: 132856
2011-06-10 20:59:24 +00:00
Cameron Zwarich
7f353f2163 Rename the ParmContext enum values to make a bit more sense and add a small
comment on their meaning.

llvm-svn: 132854
2011-06-10 20:37:36 +00:00
Cameron Zwarich
cc21e3fc58 Remove tabs.
llvm-svn: 132853
2011-06-10 20:31:39 +00:00
Cameron Zwarich
0019f5de6c Remove a pointless const_cast.
llvm-svn: 132852
2011-06-10 20:30:08 +00:00
Rafael Espindola
d6a9a045e0 Remove duplicated test.
Thanks Bob Wilson for noticing it!

llvm-svn: 132851
2011-06-10 20:08:23 +00:00
Eli Friedman
950df94d25 PR10092 (second try): Don't crash on a load without a momoperand; fast-isel creates loads like this.
llvm-svn: 132826
2011-06-10 01:13:01 +00:00
Chad Rosier
f1b711035c Ensure that EmitGlobalVariable is correctly differentiating between declarations
and definitions when emitting global variables.  This was causing global 
declarations to be emitted as if they were definitions.
Fixes <rdar://problem/9429892>.

llvm-svn: 132825
2011-06-10 00:53:15 +00:00
Rafael Espindola
aabc17c8ca Make the optional verification step more strict.
llvm-svn: 132822
2011-06-09 23:55:56 +00:00
Rafael Espindola
f3a32b0e25 Avoid a gcc warning about multiline comments.
llvm-svn: 132821
2011-06-09 23:51:45 +00:00
Rafael Espindola
48351feabc On last fix to the early tail duplication.
With this I am able to bootstrap clang with early tail duplication enabled
for any small bb and setting tail-dup-size to a relatively large value(8) to
stress this code.

llvm-svn: 132816
2011-06-09 23:22:56 +00:00
Eli Friedman
66d3e9e11f Chris fixed this README a while back by changing how clang generates code for structs like the given struct.
llvm-svn: 132815
2011-06-09 23:02:19 +00:00
Rafael Espindola
7993bc1353 Also consider phi nodes when deciding if a register is live out.
llvm-svn: 132814
2011-06-09 22:53:47 +00:00
Cameron Zwarich
af47f4a117 A CCState was being created without setting whether it is in the Call or Prologue state,
causing an assertion failure downstream. This fixes <rdar://problem/9562908>.

This really seems like it should always be set at CCState creation time, so mistakes like
this can never happen. I'll take a look at doing that.

llvm-svn: 132811
2011-06-09 22:30:07 +00:00
Eli Friedman
14c6ce9041 Change this DAGCombine to build AND of SHR instead of SHR of AND; this matches the ordering we prefer in instcombine. Part of rdar://9562809.
The potential DAGCombine which enforces this more generally messes up some other very fragile patterns, so I'm leaving that alone, at least for now.

llvm-svn: 132809
2011-06-09 22:14:44 +00:00
Rafael Espindola
4b78a41c8c AnalyzeBranch modifies the bb, but we don't want to modify a bb with
eh edges. Swap the order of the checks to avoid it.

llvm-svn: 132806
2011-06-09 21:43:25 +00:00
Rafael Espindola
5fd95a9c94 A PHI in this basic block is a use in another basic block.
llvm-svn: 132805
2011-06-09 20:55:41 +00:00
John McCall
1cf92d93f0 When deleting a basic block, remove call edges only for non-intrinsics.
llvm-svn: 132803
2011-06-09 20:31:09 +00:00
Roman Divacky
9b1aea9b45 Fix emission of PPC64 assembler on non-darwin platforms by splitting
VK_PPC_{HA,LO}16 into darwin and gas variants.

Darwin wants {ha,lo}16(symbol) while gnu as wants symbol@{ha,l}.

llvm-svn: 132802
2011-06-09 20:25:38 +00:00
John McCall
806ec47668 SplitCriticalEdge can sometimes split the edge from an invoke to a landing
pad, separating the exception and selector calls from the new lpad.  Teaching
it not to do that, or to properly adjust the CFG afterwards, is out of
scope because it would require the other edges to the landing pad to be split
as well (effectively).  Instead, just recover from the most likely cases
during inlining.  The best long-term solution is to change the exception
representation and commit to either requiring or not requiring the more
complex edge-splitting logic;  this is just a shorter-term hack.

llvm-svn: 132799
2011-06-09 20:06:24 +00:00
Rafael Espindola
b39a7c9540 Refactor some checks into shouldTailDuplicate. Update comments.
No functionality change.

llvm-svn: 132798
2011-06-09 19:54:42 +00:00
John McCall
d31a1b8de1 Teach the CallGraph to ignore calls to intrinsics.
llvm-svn: 132797
2011-06-09 19:46:27 +00:00
Eli Friedman
f2dbd3e767 Revert 132789; it breaks tests. My mistake.
llvm-svn: 132795
2011-06-09 19:33:30 +00:00
Jason W Kim
a5b62f4fc7 Remove an uneeded switch - Turns out reloc results are identical w/o the switch. (face+palm)
llvm-svn: 132790
2011-06-09 19:13:45 +00:00
Eli Friedman
d04e75fca2 Add a check to make sure we don't crash with strange configurations where we do fast-isel, then try to fold instructions. PR10092.
llvm-svn: 132789
2011-06-09 18:55:00 +00:00
Jakob Stoklund Olesen
164dc685e5 Remove custom allocation order boilerplate that is no longer needed.
The register allocators automatically filter out reserved registers and
place the callee saved registers last in the allocation order, so custom
methods are no longer necessary just for that.

Some targets still use custom allocation orders:

ARM/Thumb: The high registers are removed from GPR in thumb mode. The
NEON allocation orders prefer to use non-VFP2 registers first.

X86: The GR8 classes omit AH-DH in x86-64 mode to avoid REX trouble.

SystemZ: Some of the allocation orders are omitting R12 aliases without
explanation. I don't understand this target well enough to fix that. It
looks like all the boilerplate could be removed by reserving the right
registers.

llvm-svn: 132781
2011-06-09 16:56:59 +00:00
Eric Christopher
24dafa3dbc Speculatively revert 132758 and 132768 to try to fix the Windows buildbots.
llvm-svn: 132777
2011-06-09 16:03:19 +00:00
Eric Christopher
88088d9b8a Recommit r132764 since it didn't cause the windows buildbot failures.
llvm-svn: 132776
2011-06-09 15:39:01 +00:00
Rafael Espindola
0cab70db0d Improve the handling of available_externally and llvm.global_ctors.
llvm-svn: 132775
2011-06-09 14:38:09 +00:00
Duncan Sands
a0c88a5dd5 Enable printf() to iprintf() optimization for the TCE target.
Patch by Pekka Jaaskelainen. 

llvm-svn: 132774
2011-06-09 11:11:45 +00:00
Chris Lattner
af60d3ba93 add another sandybridge alias.
llvm-svn: 132772
2011-06-09 06:38:17 +00:00
Eric Christopher
386e80f51e Temporarily revert 132764 to see if it fixes the Windows buildbot.
llvm-svn: 132771
2011-06-09 06:29:54 +00:00
Akira Hatanaka
33ec063f3b Initial support for inline asm memory operand constraints.
llvm-svn: 132768
2011-06-09 03:31:05 +00:00
Cameron Zwarich
ca3f5d4844 Remove a vacuous condition.
llvm-svn: 132767
2011-06-09 01:52:44 +00:00
Cameron Zwarich
72cd0d1b5b Fix PR10104 by adding a bounds check on a vector element access check. It was
assuming that all offsets are legal vector accesses, and thus trying to access
the float member of { <2 x float>, float } as the 3rd element of the first
member.

llvm-svn: 132766
2011-06-09 01:45:33 +00:00
Eric Christopher
65f7ea8a35 If the alignment of the byval argument is greater than the alignment
of the frame then increase the maximum alignment of the frame to
match.

Fixes PR6965

llvm-svn: 132764
2011-06-09 00:15:19 +00:00
Eric Christopher
1ae9ec6124 Add a parameter to CCState so that it can access the MachineFunction.
No functional change.

Part of PR6965

llvm-svn: 132763
2011-06-08 23:55:35 +00:00
Cameron Zwarich
68f8e98b8e Fix an assymmetry between ConvertScalar_ExtractValue and ConvertScalar_InsertValue. The
former was using the size of the entire alloca, whereas the latter was correctly using
the allocated size of the immediate type being converted (which may differ from the size
of the alloca). This fixes PR10082.

llvm-svn: 132759
2011-06-08 22:08:31 +00:00
Akira Hatanaka
38115eb019 Fix bug in lowering of DYNAMIC_STACKALLOC nodes. The correct offset of the
dynamically allocated stack area was not set.

llvm-svn: 132758
2011-06-08 21:28:09 +00:00
Akira Hatanaka
ea8ce56dbb Reorganize code in MipsTargetLowering::LowerCall to improve readability.
llvm-svn: 132756
2011-06-08 17:39:33 +00:00
Andrew Trick
1de3fe7311 Remove a temporary test case probe in CheckForLiveRegDef.
llvm-svn: 132751
2011-06-08 15:19:49 +00:00
Rafael Espindola
e987e93aa0 Fix count.
llvm-svn: 132749
2011-06-08 14:23:19 +00:00
Rafael Espindola
c96d74d84e Count how many phis we are creating.
llvm-svn: 132748
2011-06-08 14:13:31 +00:00
Cameron Zwarich
e7e6bc3a33 Fix an issue where the two-address conversion pass incorrectly rewrites untied
operands to an early clobber register. This fixes <rdar://problem/9566076>.

llvm-svn: 132738
2011-06-07 23:54:00 +00:00
Rafael Espindola
12efa298a0 Fix a silly error I introduce in r131951.
Fixes PR10095.

llvm-svn: 132735
2011-06-07 23:26:45 +00:00
Akira Hatanaka
101d50423a Refactor MipsTargetLowering::EmitInstrWithCustomInserter.
llvm-svn: 132726
2011-06-07 19:28:39 +00:00
Akira Hatanaka
e56d1fa083 Put back removed line.
llvm-svn: 132725
2011-06-07 19:03:14 +00:00
Akira Hatanaka
3b7982650c Coding style fixes.
- Fix indentation.
- Move comments.
- Fit lines in 80 columns.
- Remove dead code.

llvm-svn: 132724
2011-06-07 18:58:42 +00:00
Akira Hatanaka
f56f544d80 Use tabs to separate opcode and operand strings.
llvm-svn: 132718
2011-06-07 18:16:51 +00:00
Akira Hatanaka
fe54bb9de1 Add comments for wrapper node patterns in MipsInstrInfo.td.
llvm-svn: 132717
2011-06-07 18:00:14 +00:00
Roman Divacky
0a62f9906f Make EmitIntValue() work properly on big-endian targets.
llvm-svn: 132715
2011-06-07 17:31:02 +00:00
Akira Hatanaka
fbeb14925f Add test case for C++ exception handling and fix the following mistakes in MipsFrameLowering::emitPrologue:
- cfi directives are not inserted at the right location or in the right order.
- The source MachineLocation for the cfi directive that changes the cfa register
  to $fp should be MachineLocation::VirtualFP.
- A PROLOG_LABEL that marks the beginning of cfi_offset directives for
  callee-saved register is emitted even when no callee-saved registers are
  saved.
- When a callee-saved double precision register is saved, two cfi_offset
  directives, one for each of the paired single precision registers, should be
  emitted.
 
 

llvm-svn: 132703
2011-06-07 02:17:21 +00:00
Andrew Trick
6575812c48 Fix a merge bug in preRAsched for handling physreg aliases.
I've been sitting on this long enough trying to find a test case. I
think the fix should go in now, but I'll keep working on the test case.

llvm-svn: 132701
2011-06-07 00:38:12 +00:00
Andrew Trick
a46c28e96c Fix for setjmp/longjmp exception handling on ARM. setjmp clobbers CPSR.
rdar://problem/9556069

llvm-svn: 132699
2011-06-07 00:08:49 +00:00
Jakob Stoklund Olesen
cf00a6d764 Simplify local live range splitting's safeguard to fix PR10070.
When local live range splitting creates a live range with the same
number of instructions as the old range, mark it as RS_Local. When such
a range is seen again, require that it be split in a way that reduces
the number of instructions. That guarantees we are making progress while
still being able to perform 3 -> 2+3 splits as required by PR10070.

This also means that the PrevSlot map is no longer needed. This was also
used to estimate new spill weights, but that is no longer necessary
after slotIndexes::insertMachineInstrInMaps() got the extra Late
insertion argument.

llvm-svn: 132697
2011-06-06 23:55:20 +00:00
Stuart Hastings
d044ba7a9f Followup to 132458, omit unnecessary stack copy when x87 input is a
load.  rdar://problem/6373334

llvm-svn: 132696
2011-06-06 23:15:58 +00:00
Jakob Stoklund Olesen
9b9861651f Get allocation orders from RegisterClassInfo when possible.
Only target-dependent hints require callbacks. The RCI allocation order
has CSR aliases last according to their order of appearance in the
getCalleeSavedRegs list. This can depend on the calling convention.

This way, AllocationOrder::next doesn't have to check for reserved
registers, and CSRs are always allocated last, even with weird calling
conventions.

llvm-svn: 132690
2011-06-06 21:02:04 +00:00
Nadav Rotem
bfff2bd65a Add methods to support the integer-promotion of vector types. Methods to
legalize SDNodes such as BUILD_VECTOR, EXTRACT_VECTOR_ELT, etc.

llvm-svn: 132689
2011-06-06 20:55:56 +00:00
Stuart Hastings
f44c238735 Avoid FGETSIGN of 80-bit types. Fixes PR10085.
llvm-svn: 132681
2011-06-06 16:44:31 +00:00
Jakob Stoklund Olesen
005ed7e482 Don't try to be clever, just preserve the target's allocation order.
The order of registers returned by getCalleeSavedRegs is used to lay out
the fixed stack slots for CSRs. Some targets like their CSRs used from
one end, and some targets want them used from the other end.

When computing an allocation order, simply preserve the relative
ordering of CSRs that the target specifies in its allocation order.
Reordering CSRs would break some targets, ARM in particular.

We still place volatiles before the CSRs, providing slightly better
results with different calling conventions.

llvm-svn: 132680
2011-06-06 16:36:30 +00:00
Eli Friedman
69da49c53a PR10077: fix fast-isel of extractvalue of aggregate constants.
llvm-svn: 132676
2011-06-06 05:46:34 +00:00
Benjamin Kramer
3bd28deb10 Use path API for path concatenation.
llvm-svn: 132668
2011-06-05 14:36:47 +00:00
Rafael Espindola
f500121fcf Basic support for macros with explicit arguments.
We still don't handle

* default values
* :req
* :vararg
* \()

llvm-svn: 132656
2011-06-05 02:43:45 +00:00
Rafael Espindola
358f2ee1d2 Produce an undefined reference to _GLOBAL_OFFSET_TABLE_ if we have a
VK_GOTOFF reloc. This matches as' behavior, but it is not clear why the linker
might need this, so I added a FIXME.

I could test this by duplicating test/MC/ELF/got.s, but it doesn't look
worthwhile.

llvm-svn: 132655
2011-06-05 01:20:06 +00:00
Nadav Rotem
5a64a09036 TypeLegalizer: Add support for passing of vector-promoted types in registers (copyFromParts/copyToParts).
llvm-svn: 132649
2011-06-04 20:58:08 +00:00
Nadav Rotem
fd917f5b29 TypeLegalizer: Fix a bug in the promotion of elements of integer vectors.
(only happens when using the -promote-elements option).

The correct legalization order is to first try to promote element. Next, we try
to widen vectors.

llvm-svn: 132648
2011-06-04 20:32:01 +00:00
Nick Lewycky
095ceb34d6 Refactor parsing of variable names (ie., %foo and @foo) since they have the same
rules. Also refactor "read string until quote" into its own function. No
functionality change!

llvm-svn: 132645
2011-06-04 18:16:26 +00:00
Nick Lewycky
36e7570fb3 Add support for @GOTPTOFF in i386 mode.
llvm-svn: 132643
2011-06-04 17:38:07 +00:00
Bill Wendling
1da5257929 If the block that we're threading through is jumped to by an indirect branch,
then we don't want to set the destination in the indirect branch to the
destination. This is because the indirect branch needs its destinations to have
had their block addresses taken. This isn't so of the new critical edge that's
split during this process. If it turns out that the destination block has only
one predecessor, and that being a BB with an indirect branch, then it won't be
marked as 'used' and may be removed.
PR10072

llvm-svn: 132638
2011-06-04 09:42:04 +00:00
Dan Gohman
aa7c0761db Reapply r131781, now that the GVN bug with partially-aliasing loads
is disabled.

llvm-svn: 132632
2011-06-04 06:50:18 +00:00
Dan Gohman
df07009a9a Disable the main feature of 130180, the elimination of loads that are
redundant with partially-aliasing loads.

When computing what portion of a clobbering load value is needed,
it doesn't consider phi-translation which may have occurred
between the clobbing load and the redundant load.

llvm-svn: 132631
2011-06-04 06:48:50 +00:00
Dan Gohman
8fd6804868 Revert r131781 again. Apparently there is more going on here.
llvm-svn: 132625
2011-06-04 05:11:22 +00:00
Nick Lewycky
813e24b6a9 Fold assert-only-used variable into the assert.
llvm-svn: 132620
2011-06-04 02:07:10 +00:00
Andrew Trick
c894f04286 Missing include of climits in the new BranchProbability pass.
llvm-svn: 132616
2011-06-04 01:30:52 +00:00
Andrew Trick
7a9eb604a9 New BranchProbabilityInfo analysis. Patch by Jakub Staszak!
BranchProbabilityInfo provides an interface for IR passes to query the
likelihood that control follows a CFG edge. This patch provides an
initial implementation of static branch predication that will populate
BranchProbabilityInfo for branches with no external profile
information using very simple heuristics. It currently isn't hooked up
to any external profile data, so static prediction does all the work.

llvm-svn: 132613
2011-06-04 01:16:30 +00:00
Dan Gohman
24ef4a0b7d Reapply r131781 (revert r131809), now that some BasicAA shortcomings
it exposed are fixed.

llvm-svn: 132611
2011-06-04 00:46:31 +00:00
Dan Gohman
edaf7c535a Fix BasicAA's recursion detection so that it doesn't pessimize
queries in the case of a DAG, where a query reaches a node
visited earlier, but it's not on a cycle. This avoids
MayAlias results in cases where BasicAA is expected to
return MustAlias or PartialAlias in order to protect TBAA.

llvm-svn: 132609
2011-06-04 00:31:50 +00:00
Stuart Hastings
ea8b49dff3 Reapply 132424 with fixes. This fixes PR10068.
rdar://problem/5993888

llvm-svn: 132606
2011-06-03 23:53:54 +00:00
Jakob Stoklund Olesen
0ac5f2eaf8 Blackfin always uses a reserved call frame.
Materializing the stack pointer update before a call requires a scratch
register that may not be available.

llvm-svn: 132601
2011-06-03 22:45:18 +00:00
Eric Christopher
bd0677f8db Another possible bug. Stopgap until we can autogenerate tables and
constraint lengths.

Part of rdar://9037836 and rdar://9119939

llvm-svn: 132598
2011-06-03 22:09:12 +00:00
Eric Christopher
51ff48ad30 Fix an off by one error.
Part of rdar://9037836 and rdar://9119939

llvm-svn: 132590
2011-06-03 20:44:52 +00:00
Jakob Stoklund Olesen
449aaba5b0 Switch AllocationOrder to using RegisterClassInfo instead of a BitVector
of reserved registers.

Use RegisterClassInfo in RABasic as well. This slightly changes som
allocation orders because RegisterClassInfo puts CSR aliases last.

llvm-svn: 132581
2011-06-03 20:34:53 +00:00
Jakob Stoklund Olesen
e345312955 Preserve the original ordering when a CSR has multiple aliases.
Previously, these aliases would be ordered alphabetically. (BH, BL)

Print out the computed allocation orders.

llvm-svn: 132580
2011-06-03 20:34:50 +00:00
Dan Gohman
6d082aec26 When merging MustAlias and PartialAlias, chose PartialAlias instead
of conservatively choosing MayAlias.

llvm-svn: 132579
2011-06-03 20:17:36 +00:00
Devang Patel
ec747bb76b Use IRBuilder, preserve line numbers.
llvm-svn: 132578
2011-06-03 19:46:19 +00:00
Eric Christopher
e831655dd9 Make the Uv constraint a memory operand. This doesn't solve the
addressing mode problem mentioned in r132559.

Backend part of rdar://9037836 and part of rdar://9119939

llvm-svn: 132561
2011-06-03 17:24:37 +00:00
Eric Christopher
e446e0fdb9 Add a TODO about memory operands.
llvm-svn: 132559
2011-06-03 17:21:23 +00:00
Hans Wennborg
fc0acdb90f Test commit.
llvm-svn: 132558
2011-06-03 17:15:37 +00:00
Devang Patel
e3190a1377 A typedef's context is not the same as type's context. It is the context of typedef decl itself. Use extra parameter to communicate this to DIBuilder.
llvm-svn: 132556
2011-06-03 17:04:51 +00:00
Chad Rosier
3dd747f5a1 Revert name change from r132533. Lower case naming was intended per style guidelines.
llvm-svn: 132555
2011-06-03 17:02:19 +00:00
Roman Divacky
3624922127 Fix wrong usages of CTR/MCTR where CTR8/MCTR8 was meant.
- Check for MTCTR8 in addition to MTCTR when looking up a hazard.

- When lowering an indirect call use CTR8 when targeting 64bit.

- Introduce BCTR8 that uses CTR8 and use it on 64bit when expanding ISD::BRIND.

The last change fixes PR8487. With those changes, we are able to compile a
running "ls" and "sh" on FreeBSD/PowerPC64.

llvm-svn: 132552
2011-06-03 15:47:49 +00:00
Zhongxing Xu
10e41c48ee singed int causes signed extension, which contradicts the intention to pick up
integers with high 32 bits being zero.

llvm-svn: 132538
2011-06-03 08:29:51 +00:00
Nick Lewycky
ce38535f5b Bail on unswitching a switch statement for a case with a critical edge. We name
which edge to split by pred/succ pair, which means that we can end up splitting
the wrong edge (by case value) in the switch statement entirely. Fixes PR10031!

llvm-svn: 132535
2011-06-03 06:27:15 +00:00
Chad Rosier
8b97de1cfa Whitespace and other cleanup. Functionallity unchanged.
llvm-svn: 132533
2011-06-03 05:09:12 +00:00
Eli Friedman
eae10d6163 Add ARM fast-isel support for materializing the address of a global in cases where the global uses an indirect symbol.
rdar://9431157

llvm-svn: 132522
2011-06-03 01:13:19 +00:00
Andrew Trick
39b3306530 Basic PassManager diagnostics.
Added asserts whenever attempting to use a potentially
uninitialized pass. This helps people trying to develop a new pass and
people trying to understand the bug reports filed by the former people.

llvm-svn: 132520
2011-06-03 00:48:58 +00:00
Andrew Trick
335c4f8d8b whitespace
llvm-svn: 132519
2011-06-03 00:44:32 +00:00
Jakob Stoklund Olesen
9037bbb219 Avoid calling TRI->getAllocatableSet in RAFast.
When compiling a program with lots of small functions like
483.xalancbmk, this makes RAFast 11% faster.

Add some comments to clarify the difference between unallocatable and
reserved registers. It's quite subtle.

The fast register allocator depends on EFLAGS' not being allocatable on
x86. That way it can completely avoid tracking liveness, and it won't
mind when there are multiple uses of a single def.

llvm-svn: 132514
2011-06-02 23:41:40 +00:00
Eric Christopher
d68494ffdd Have LowerOperandForConstraint handle multiple character constraints.
Part of rdar://9119939

llvm-svn: 132510
2011-06-02 23:16:42 +00:00
Jakob Stoklund Olesen
409986a648 Flag unallocatable register classes instead of giving them empty
allocation orders.

llvm-svn: 132509
2011-06-02 23:07:24 +00:00
Jakob Stoklund Olesen
4f76a2bdc8 Make it possible to have unallocatable register classes.
Some register classes are only used for instruction operand constraints.
They should never be used for virtual registers. Previously, those
register classes were given an empty allocation order, but now you can
say 'let isAllocatable=0' in the register class definition.

TableGen calculates if a register is part of any allocatable register
class, and makes that information available in TargetRegisterDesc::inAllocatableClass.

The goal here is to eliminate use cases for overriding allocation_order_*
methods.

llvm-svn: 132508
2011-06-02 23:07:20 +00:00
Devang Patel
73e16acee8 Preserve line number information while converting Invoke into a Call.
llvm-svn: 132505
2011-06-02 22:46:58 +00:00
Jakob Stoklund Olesen
52c6a75ee3 Just use a SmallVector.
I was confused whether new uint8_t[] would zero-initialize the returned
array, and it seems that so is gcc-4.0.

This should fix the test failures on darwin 9.

llvm-svn: 132500
2011-06-02 22:22:43 +00:00
Devang Patel
7b9fc618b2 Remove dead code.
llvm-svn: 132488
2011-06-02 21:31:00 +00:00
Devang Patel
6455c3f6ae Update DBG_VALUEs while breaking anti dependencies.
llvm-svn: 132487
2011-06-02 21:26:52 +00:00
Tanya Lattner
aa1f6df650 Fix encoding for VEXTdf.
llvm-svn: 132486
2011-06-02 21:25:24 +00:00
Eli Friedman
0db9c60959 PR10067: Add missing safety check to call return transformation in MemCpyOpt::processStore. If something accesses the dest of the "copy" between the call and the copy, the performCallSlotOptzn transformation is not valid.
llvm-svn: 132485
2011-06-02 21:24:42 +00:00
Devang Patel
1c30f3ac27 During post RA scheduling, do not try to chase reg defs. to preserve DBG_VALUEs. This approach has several downsides, for example, it does not work when dbg value is a constant integer, it does not work if reg is defined more than once, it places end of debug value range markers in the wrong place. It even causes misleading incorrect debug info when duplicate DBG_VALUE instructions point to same reg def.
Instead, use simpler approach and let DBG_VALUE follow its predecessor instruction. After live debug value analysis pass, all DBG_VALUE instruction are placed at the right place. Thanks Jakob for the hint!

llvm-svn: 132483
2011-06-02 20:07:12 +00:00
Rafael Espindola
1299f014d4 Revert 132424 to fix PR10068.
llvm-svn: 132479
2011-06-02 19:57:47 +00:00
Eric Christopher
0c337a44e9 Add a new parse hint for multi-letter constraints in inline asm.
Testcase will come when we use it.

Part of rdar://9119939

llvm-svn: 132476
2011-06-02 19:26:37 +00:00
Jakob Stoklund Olesen
b5392437c8 Use RegisterClassInfo::getOrder in RAFast.
This saves two virtual function calls and an Allocatable BitVector test,
making RAFast run 2% faster.

llvm-svn: 132471
2011-06-02 18:35:30 +00:00
Jim Grosbach
8a7731f951 .cfi directive register parsing flexibility.
Parsing a register name/number for .cfi directives can't assume that a
register name starts with a '%' token. Be more flexible and check for a
register number instead. Still unlikely to be perfect, but it allows us
to parse both plain identifiers as register names and integers as register
numbers, which is what we're wanting to support at this point.

llvm-svn: 132466
2011-06-02 17:14:04 +00:00
Stuart Hastings
8447f18f85 Omit unnecessary stack copy when x87 input is a load.
rdar://problem/6373334

llvm-svn: 132458
2011-06-02 15:57:11 +00:00
Benjamin Kramer
e149500163 Start with a zeroed CSRNum map.
Found by valgrind.

llvm-svn: 132457
2011-06-02 12:07:44 +00:00
Jakob Stoklund Olesen
a8db700d44 Initialize members to fix problem found by valgrind.
llvm-svn: 132456
2011-06-02 05:43:49 +00:00
Jakob Stoklund Olesen
25716baae0 Use TRI::has{Sub,Super}ClassEq() where possible.
No functional change.

llvm-svn: 132455
2011-06-02 05:43:46 +00:00
Rafael Espindola
ee123951a2 Don't hardcode the %reg format in the streamer.
llvm-svn: 132451
2011-06-02 02:34:55 +00:00
Jakob Stoklund Olesen
24726cedf4 Add a RegisterClassInfo class that lazily caches information about
register classes.

It provides information for each register class that cannot be
determined statically, like:

- The number of allocatable registers in a class after filtering out the
  reserved and invalid registers.

- The preferred allocation order with registers that overlap callee-saved
  registers last.

- The last callee-saved register that overlaps a given physical register.

This information usually doesn't change between functions, so it is
reused for compiling multiple functions when possible.  The many
possible combinations of reserved and callee saves registers makes it
unfeasible to compute this information statically in TableGen.

Use RegisterClassInfo to count available registers in various heuristics
in SimpleRegisterCoalescing, making the pass run 4% faster.

llvm-svn: 132450
2011-06-02 02:19:35 +00:00
Akira Hatanaka
1f91013bcb Detect FI|cst pattern in MipsDAGToDAGISel::SelectAddr. Patch by Sasa Stankovic.
llvm-svn: 132448
2011-06-02 01:03:14 +00:00
Akira Hatanaka
69ae562f33 Custom-lower FRAMEADDR. Patch by Sasa Stankovic.
llvm-svn: 132444
2011-06-02 00:24:44 +00:00
Eli Friedman
884a7d08b1 When marking a block as being unanalyzable, use "Clobber" on the terminator instead of the first instruction in the block. This is a bit of a hack; "Clobber" isn't really the right marking in the first place. memdep doesn't really have any way of properly expressing "unanalyzable" at the moment. Using it on the terminator is much less ambiguous than using it on an arbitrary instruction, though.
In the given testcase, the "Clobber" was pointing to a load, and GVN was incorrectly assuming that meant that the "Clobber" load overlapped the load being analyzed (when they are actually unrelated).

The included testcase tests both this commit and r132434.

Part two of rdar://9429882.  (r132434 was mislabeled.)

llvm-svn: 132442
2011-06-02 00:08:52 +00:00
Eli Friedman
37ed424905 In MemoryDependenceAnalysis::getNonLocalPointerDepFromBB, if a given block is is deemed unanalyzable (and we execute one of the "goto PredTranslationFailure" statements), make sure we don't put information about the predecessors of that block into the returned data structures; this can lead to, among other things, extraneous results (which will confuse passes using memdep). Fixes an assert in GVN compiling ruby. Part of rdar://problem/9521954 .
Testcase coming up soon.

llvm-svn: 132434
2011-06-01 23:16:53 +00:00
Devang Patel
03708bbb55 A DBG_VALUE that truncates a range does not start another dbg value range.
llvm-svn: 132433
2011-06-01 23:00:17 +00:00
Devang Patel
1a3058d727 Do not drop constant values when a variable's content is described using .debug_loc entries.
llvm-svn: 132427
2011-06-01 22:03:25 +00:00
Stuart Hastings
9a085fb9d8 Recommit 132404 with fixes. rdar://problem/5993888
llvm-svn: 132424
2011-06-01 21:33:14 +00:00
Eric Christopher
9fe91039e4 Allow bitcasts between valid types of the same size and vector
types if the vector type is legal.

Fixes rdar://9306086

llvm-svn: 132420
2011-06-01 19:55:10 +00:00
Stuart Hastings
4b33767382 Revert 132404 to appease a buildbot. rdar://problem/5993888
llvm-svn: 132419
2011-06-01 19:52:20 +00:00
Nadav Rotem
4b8e7afe7d Refactor LegalizeTypes: Erase LegalizeAction and make the type legalizer use
the TargetLowering enum.

llvm-svn: 132418
2011-06-01 19:47:10 +00:00
Andrew Trick
b92801a07e SCEV: missing null check fix for r132360, dragonegg crash.
llvm-svn: 132416
2011-06-01 19:14:56 +00:00
Jakob Stoklund Olesen
1e7aea1b5e Revert r132358 "Simplify the eviction policy by making the failsafe explicit."
This commit caused regressions in i386 flops-[568], matrix, salsa20,
256.bzip2, and enc-md5.

llvm-svn: 132413
2011-06-01 18:45:02 +00:00
Stuart Hastings
b75a0be551 Fix double FGETSIGN to work on x86_32; followup to 132396.
rdar://problem/5660695

llvm-svn: 132411
2011-06-01 18:32:25 +00:00
Stuart Hastings
23f5ceda96 Add support for x86 CMPEQSS and friends. These instructions do a
floating-point comparison, generate a mask of 0s or 1s, and generally
DTRT with NaNs.  Only profitable when the user wants a materialized 0
or 1 at runtime.  rdar://problem/5993888

llvm-svn: 132404
2011-06-01 17:17:45 +00:00
Stuart Hastings
904f5d9bd7 Reapply 132348 with fixes. rdar://problem/6501862
llvm-svn: 132402
2011-06-01 16:42:47 +00:00
Jakob Stoklund Olesen
283a7e46b5 Fix PR10059 and future variations by handling all register subclasses.
Add TargetRegisterInfo::hasSubClassEq and use it to check for compatible
register classes instead of trying to list all register classes in
X86's getLoadStoreRegOpcode.

llvm-svn: 132398
2011-06-01 15:32:10 +00:00
Stuart Hastings
6309f11cc6 Turn on FGETSIGN for x86. Followup to 132388. rdar://problem/5660695
llvm-svn: 132396
2011-06-01 14:04:17 +00:00
Joerg Sonnenberger
ffa79cb359 Add new -d option to tblgen. It writes a make(1)-style dependency file.
llvm-svn: 132395
2011-06-01 13:10:15 +00:00
Nadav Rotem
111ad2f6ce 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.

llvm-svn: 132394
2011-06-01 12:51:46 +00:00
Stuart Hastings
fdc9e4af68 FGETSIGN support for x86, using movmskps/pd. Will be enabled with a
patch to TargetLowering.cpp.  rdar://problem/5660695

llvm-svn: 132388
2011-06-01 04:39:42 +00:00
Andrew Trick
fa54b35483 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.

llvm-svn: 132385
2011-06-01 03:27:56 +00:00
John McCall
18921da759 First, do no harm -- even if we can't find a selector for an enclosing
landing pad, forward llvm.eh.resume calls to it instead of turning them
invalidly into invokes.

llvm-svn: 132382
2011-06-01 02:17:11 +00:00
Bill Wendling
a03522829c 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>

llvm-svn: 132381
2011-06-01 01:49:35 +00:00
Devang Patel
4eab0639a4 Incomplete type may not have corresponding DIE, so do not check DIEEntry eagerly.
llvm-svn: 132377
2011-06-01 00:23:24 +00:00
Devang Patel
4077aa90ed Refactor.
llvm-svn: 132373
2011-05-31 23:30:30 +00:00