Commit Graph

72928 Commits

Author SHA1 Message Date
Bruno Cardoso Lopes 5444a7b4cd Silence warnings in non assert builds. Patch by David Blaikie
llvm-svn: 133118
2011-06-16 00:40:02 +00:00
Anna Zaks a56e84e439 Rename the test. Thanks Cameron! Use shorter/generic names.
llvm-svn: 133115
2011-06-16 00:34:10 +00:00
Anna Zaks 2c2aa9a9be Function::getNumBlockIDs() should be used instead of Function::size() to set the upper limit on the block IDs since basic blocks might get removed (simplified away) after being initially numbered. Plus the test case, in which SelectionDAGBuilder::visitBr() calls llvm::MachineFunction::removeFromMBBNumbering(), which introduces the hole in numbering leading to an assert in llc (prior to the fix).
llvm-svn: 133113
2011-06-16 00:03:21 +00:00
Eli Friedman 8b098b0d57 Add a limit to the number of instructions memdep will scan in a single block. This prevents (at least in some cases) O(N^2) runtime in passes like DSE.
The limit in this patch is probably too high, but it is enough to stop DSE from going completely insane on a testcase I have (which has a single block with around 50,000 non-aliasing stores in it).

rdar://9471075

llvm-svn: 133111
2011-06-15 23:59:25 +00:00
John McCall d935e9c359 The ARC language-specific optimizer. Credit to Dan Gohman.
llvm-svn: 133108
2011-06-15 23:37:01 +00:00
Dylan Noblesmith c8c184d2f8 unittests: add test for APInt::toString()
Follow up to r133032.

llvm-svn: 133107
2011-06-15 23:36:34 +00:00
Owen Anderson 96adc4a540 Add a new MVT::untyped. This will be used in future work for modelling ISA features like register pairs and lists with "interesting" constraints (such as ARM NEON contiguous register lists or even-odd paired registers). We need to be able to generate these instructions (often from intrinsics), but don't want to have to assign a legal type to them. Instead, we'll use an "untyped" edge to bypass the type-checking and simply ensure that the register classes match.
llvm-svn: 133106
2011-06-15 23:35:18 +00:00
Jakob Stoklund Olesen 99f35eab45 Use set operations instead of plain lists to enumerate register classes.
This simplifies many of the target description files since it is common
for register classes to be related or contain sequences of numbered
registers.

I have verified that this doesn't change the files generated by TableGen
for ARM and X86. It alters the allocation order of MBlaze GPR and Mips
FGR32 registers, but I believe the change is benign.

llvm-svn: 133105
2011-06-15 23:28:14 +00:00
John McCall 7cfd1cfa86 Update the Clang diagnostic emitter to emit IDs for diagnostic categories.
Patch by Argyrios Kyrtzidis.

llvm-svn: 133093
2011-06-15 21:43:52 +00:00
Rafael Espindola 10028230cf Testcase for previous commit.
llvm-svn: 133089
2011-06-15 21:18:51 +00:00
Eli Friedman 19ace4c31a Simplify; no significant functionality change.
llvm-svn: 133086
2011-06-15 21:08:25 +00:00
Rafael Espindola ea7a02774d Fix cmake build.
llvm-svn: 133085
2011-06-15 21:03:04 +00:00
Rafael Espindola ab20567227 Handle jump tables. Test to follow soon.
llvm-svn: 133083
2011-06-15 21:00:28 +00:00
Argyrios Kyrtzidis 5d525568e0 Try fixing http://google1.osuosl.org:8011/builders/clang-i686-freebsd/builds/3548
llvm-svn: 133081
2011-06-15 20:39:05 +00:00
John McCall 4b7a8d68ae Add a new function attribute, nonlazybind, which inhibits lazy-loading
optimizations when emitting calls to the function;  instead those calls may
use faster relocations which require the function to be immediately resolved
upon loading the dynamic object featuring the call.  This is useful when it
is known that the function will be called frequently and pervasively and
therefore there is no merit in delaying binding of the function.

Currently only implemented for x86-64, where it turns into a call through
the global offset table.

Patch by Dan Gohman, who assures me that he's going to add LangRef documentation
for this once it's committed.

llvm-svn: 133080
2011-06-15 20:36:13 +00:00
Eli Friedman a472b7d900 Remove unused code.
llvm-svn: 133078
2011-06-15 19:58:09 +00:00
Argyrios Kyrtzidis 0c5c1cb1b0 Document ADT/PackedVector.h in "Programmer's Manual" doc.
llvm-svn: 133077
2011-06-15 19:56:01 +00:00
Argyrios Kyrtzidis 59d8c60719 Add unit tests for ADT/PackedVector
llvm-svn: 133075
2011-06-15 19:19:09 +00:00
Argyrios Kyrtzidis fb8b5c2d77 Constify PackedVector::reference::operator T().
llvm-svn: 133074
2011-06-15 19:18:13 +00:00
Jim Grosbach c7e6b8fed5 Diagnostic for undefined assembler local symbols.
Re-apply 133010, with fixes for inline assembler.

Original commit message:
"When an assembler local symbol is used but not defined in a module, a
Darwin assembler wants to issue a diagnostic to that effect."

Added fix to only perform the check when finalizing, as otherwise we're not
done and undefined symbols may simply not have been encountered yet.

Passes "make check" and a self-host check on Darwin.

llvm-svn: 133071
2011-06-15 18:33:28 +00:00
Andrew Trick 967d584a3a Disabling this test until I can figure out the right lit flags.
llvm-svn: 133068
2011-06-15 18:25:38 +00:00
Jakob Stoklund Olesen 5977109f14 Remove custom allocation orders in SystemZ.
Note that this actually changes code generation, and someone who
understands this target better should check the changes.

- R12Q is now allocatable. I think it was omitted from the allocation
  order by mistake since it isn't reserved. It as apparently used as a
  GOT pointer sometimes, and it should probably be reserved if that is
  the case.

- The GR64 registers are allocated in a different order now. The
  register allocator will automatically put the CSRs last. There were
  other changes to the order that may have been significant.

The test fix is because r0 and r1 swapped places in the allocation order.

llvm-svn: 133067
2011-06-15 18:02:56 +00:00
Evan Cheng 678b691aa3 Another revsh pattern. rdar://9609059
llvm-svn: 133064
2011-06-15 17:17:48 +00:00
Andrew Trick 3013b6ae4a Added -stress-sched flag in the Asserts build.
Added a test case for handling physreg aliases during pre-RA-sched.

llvm-svn: 133063
2011-06-15 17:16:12 +00:00
Chad Rosier 19a1f425a7 TargetLoweringOpt is a struct used by DAGCombine, not a pass.
llvm-svn: 133062
2011-06-15 16:48:02 +00:00
Roman Divacky 6874b26d0f Make PPC64CompilationCallback compilable no non-darwin platforms.
Patch by Nathan Whitehorn!

llvm-svn: 133059
2011-06-15 15:29:47 +00:00
Nadav Rotem 13cb7736a7 getZeroExtendInReg needs to get a scalar type
llvm-svn: 133057
2011-06-15 14:37:18 +00:00
Nadav Rotem 24c6558865 This test was failing on X86 machines which do not have SSE4. Fixed the test by
specifying that the target CPU is corei7.

llvm-svn: 133053
2011-06-15 12:26:53 +00:00
Nadav Rotem d2d9bdb2b0 Enable the simplification of truncating-store after fixing the usage of
GetDemandBits (which must operate on the vector element type).

Fix the a usage of getZeroExtendInReg which must also be done on scalar types.

llvm-svn: 133052
2011-06-15 11:19:12 +00:00
Owen Anderson 86fd3c0058 Replace the statically generated hashtables for checking register relationships with just scanning the (typically tiny) static lists.
At the time I wrote this code (circa 2007), TargetRegisterInfo was using a std::set to perform these queries.  Switching to the static hashtables was an obvious improvement, but in reality there's no reason to do anything other than scan.
With this change, total LLC time on a whole-program 403.gcc is reduced by approximately 1.5%, almost all of which comes from a 15% reduction in LiveVariables time.  It also reduces the binary size of LLC by 86KB, thanks to eliminating a bunch of very large static tables.

llvm-svn: 133051
2011-06-15 06:53:50 +00:00
Nick Lewycky 5bcbd73c38 Teach the .ll parser to handle named metadata with non-simple names.
Unfortunately we can't follow what the rest of the language does (wrapping it
in double-quotes) because that would cause an ambiguity with metadata strings,
so instead we escape any unusual characters with \xx escaping.

llvm-svn: 133050
2011-06-15 06:37:58 +00:00
Bob Wilson 4b12a11f30 A minor simplification: no functional change.
llvm-svn: 133047
2011-06-15 06:04:34 +00:00
Jakob Stoklund Olesen 5ee87726dd Use a SetTheory instance to expand register lists in register classes.
This prepares tablegen to compute register lists from set theoretic dag
expressions. This doesn't really make any difference as long as
Target.td still declares RegisterClass::MemberList as [Register].

llvm-svn: 133043
2011-06-15 05:09:20 +00:00
Bill Wendling a337414ff4 Remove the LTO stuff from the profile_rt library's Makefile.
llvm-svn: 133042
2011-06-15 04:56:13 +00:00
Jakob Stoklund Olesen d7bc5c26ab Give CodeGenRegisterClass a real sorted member set.
Make the Elements vector private and expose an ArrayRef through
getOrder() instead. getOrder will eventually provide multiple
user-specified allocation orders.

Use the sorted member set for member and subclass tests. Clean up a lot
of ad hoc searches.

llvm-svn: 133040
2011-06-15 04:50:36 +00:00
Bill Wendling 36c0c6db3f Improve the heuristic to emit the alias if the number of hard-coded registers
are also greater than the alias.

llvm-svn: 133038
2011-06-15 04:31:19 +00:00
Eli Friedman e8bbc10880 Stop using memdep for a check that didn't really make sense with memdep. In terms of specific issues, using memdep here checks irrelevant instructions and won't work properly once we start returning "unknown" more aggressively from memdep.
llvm-svn: 133035
2011-06-15 01:25:56 +00:00
Evan Cheng 6d02d9044b PerformBFICombine - (bfi A, (and B, Mask1), Mask2) -> (bfi A, B, Mask2) iff
the bits being cleared by the AND are not demanded by the BFI.

The previous BFI dag combine rule was actually incorrect (or used to be
correct until BFI representation changed).

rdar://9609030

llvm-svn: 133034
2011-06-15 01:12:31 +00:00
Ted Kremenek b05f02e956 add option for literal formatting to APInt::toString()
toString() now takes an optional bool argument that,
depending on the radix, adds the appropriate prefix
to the integer's string representation that makes it into a
meaningful C literal, e.g.:

hexademical: '-f' becomes '-0xf'
octal: '77' becomes '077'
binary: '110' becomes '0b110'

Patch by nobled@dreamwidth.org!

llvm-svn: 133032
2011-06-15 00:51:55 +00:00
Eli Friedman 7d58bc7bc0 Add "unknown" results for memdep, which mean "I don't know whether a dependence for the given instruction exists in the given block". This cleans up all the existing hacks in memdep which represent this concept by returning clobber with various unrelated instructions.
llvm-svn: 133031
2011-06-15 00:47:34 +00:00
Jakob Stoklund Olesen 22ea424d43 Move the list of register classes into CodeGenRegBank as well.
No functional change intended.

llvm-svn: 133029
2011-06-15 00:20:40 +00:00
Tanya Lattner e9e6705cf9 Add an optimization that looks for a specific pair-wise add pattern and generates a vpaddl instruction instead of scalarizing the add.
Includes a test case.

llvm-svn: 133027
2011-06-14 23:48:48 +00:00
Rafael Espindola 2efebb3610 Add triple.
llvm-svn: 133026
2011-06-14 23:47:36 +00:00
Anna Zaks cd7f70e8b5 Anna's test commit (#2).
llvm-svn: 133023
2011-06-14 22:40:29 +00:00
Chad Rosier 818e116723 When pattern matching during instruction selection make sure shl x,1 is not
converted to add x,x if x is a undef.  add undef, undef does not guarantee
that the resulting low order bit is zero.
Fixes <rdar://problem/9453156> and <rdar://problem/9487392>.

llvm-svn: 133022
2011-06-14 22:29:10 +00:00
Rafael Espindola 1bf96ac607 Check the llc output.
llvm-svn: 133021
2011-06-14 22:24:32 +00:00
Eli Friedman 164b1d753a PR10136: fix PPCTargetLowering::LowerCall_SVR4 so that a necessary CopyToReg doesn't appear to be dead.
Roman, since you're writing tests for other PPC-SVR4 vararg-related stuff, would you mind writing a test for this?

llvm-svn: 133018
2011-06-14 22:16:20 +00:00
Anna Zaks d7f7fcd3cb Anna's test commit.
llvm-svn: 133017
2011-06-14 22:10:12 +00:00
Stuart Hastings f96281f4b7 Test case for x86 MMX inline asm. rdar://problem/8886707
llvm-svn: 133014
2011-06-14 21:51:38 +00:00
Jim Grosbach ed1da49673 Revert 133010. Self-hosted buildbot unhappy.
Apparently llvm itself generates undefined assembler local labels, causing
self-hosting problems with this patch. Reverting until that's sorted out.

llvm-svn: 133013
2011-06-14 21:51:20 +00:00