Commit Graph

9830 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
82b07dc499 Simplify the tracking of used physregs to a bulk bitor followed by a transitive
closure after allocating all blocks.

Add a few more test cases for -regalloc=fast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103500 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 20:30:28 +00:00
Jakob Stoklund Olesen
bbf33b38aa Mostly rewrite RegAllocFast.
Sorry for the big change. The path leading up to this patch had some TableGen
changes that I didn't want to commit before I knew they were useful. They
weren't, and this version does not need them.

The fast register allocator now does no liveness calculations. Instead it relies
on kill flags provided by isel. (Currently those kill flags are also ignored due
to isel bugs). The allocation algorithm is supposed to work with any subset of
valid kill flags. More kill flags simply means fewer spills inserted.

Registers are allocated from a working set that contains no aliases. That means
most allocations can be done directly without expensive alias checks. When the
working set runs out of registers we do the full alias check to find new free
registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103488 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 18:54:45 +00:00
Daniel Dunbar
651804c3d6 MC/Mach-O x86_64: Switch to using fragment atom symbol.
- This eliminates getAtomForAddress() (which was a linear search) and
   simplifies getAtom().
 - This also fixes some correctness problems where local labels at the same
   address as non-local labels could be assigned to the wrong atom.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 17:22:50 +00:00
Kalle Raiskila
2320a44b90 Make SPU backend not assert on jump tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103466 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 11:00:02 +00:00
Evan Cheng
fb3611daad Select @llvm.trap to the special B with 1111 condition (i.e. trap) instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103459 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 07:26:32 +00:00
Daniel Dunbar
a8251fac10 MC/Mach-O: Fix another mismatch with .weak_definition, we shouldn't use a
scattered relocation entry with a .weak_definition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103443 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 23:15:20 +00:00
Devang Patel
163a9f7c5f Enable multiple Compile Units in one module.
This means now 'llvm-ld a.bc b.bc' will preserve debug info appropriately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103439 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 22:49:55 +00:00
Chris Lattner
e24b5c52d6 this really is needed. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103434 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 21:23:48 +00:00
Chris Lattner
ea9f0b8c35 just remove this, it isn't needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103432 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 21:01:47 +00:00
Chris Lattner
fd450c026a fix PR7105 by enumerating MDNodes on all @llvm.foo
function calls, not just recognized intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103428 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 20:53:17 +00:00
Chris Lattner
c279243128 fix a pretty obvious typo. We test things before committing them, right?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103427 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 20:51:06 +00:00
David Greene
e89f1c4ee7 Fix PR6875:
This includes a patch by Roman Divacky to fix the initial crash.

Move the actual addition of passes from *PassManager::add to
*PassManager::addImpl.  That way, when adding printer passes we won't
recurse infinitely.

Finally, check to make sure that we are actually adding a FunctionPass
to a FunctionPassManager before doing a print before or after it.
Immutable passes are strange in this way because they aren't
FunctionPasses yet they can be and are added to the FunctionPassManager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103425 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 20:24:27 +00:00
Evan Cheng
aad753bbbd Be careful with operand promotion. For a binary operation, the source operands may be the same. PR7018. rdar://7939869.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103419 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 19:03:57 +00:00
Devang Patel
1deea21e35 Test case for 103414.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103415 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 17:49:40 +00:00
Kalle Raiskila
26c4cf4c6f Fix encoding of 'sf' and 'sfh' instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103399 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 08:13:49 +00:00
Chris Lattner
c7d7e0cbe0 make simplifycfg insert an llvm.trap before the 'unreachable' it introduces
when it detects undefined behavior.  llvm.trap generally codegens into some
thing really small (e.g. a 2 byte ud2 instruction on x86) and debugging this
sort of thing is "nontrivial".  For example, we now compile:

void foo() { *(int*)0 = 42; }

into:

_foo:
	pushl	%ebp
	movl	%esp, %ebp
	ud2

Some may even claim that this is a security hole, though that seems dubious
to me.  This addresses rdar://7958343 - Optimizing away null dereference 
potentially allows arbitrary code execution


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103356 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 22:15:59 +00:00
Chris Lattner
6745191070 Teach instcombine to transform a bitcast/(zext|trunc)/bitcast sequence
with a vector input and output into a shuffle vector.  This sort of 
sequence happens when the input code stores with one type and reloads
with another type and then SROA promotes to i96 integers, which make
everyone sad.

This fixes rdar://7896024



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103354 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 21:50:26 +00:00
Chris Lattner
7944c21cae Fix PR7052, patch by Jakub Staszak!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103347 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 20:01:44 +00:00
Bill Wendling
369252db2e Readd testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103335 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-08 04:47:54 +00:00
Dan Gohman
59dc60337f When pruning candidate formulae out of an LSRUse, update the
LSRUse's Regs set after all pruning is done, rather than trying
to do it on the fly, which can produce an incomplete result.

This fixes a case where heuristic pruning was stripping all
formulae from a use, which led the solver to enter an infinite
loop.

Also, add a few asserts to diagnose this kind of situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103328 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 23:36:59 +00:00
Bill Wendling
09e7a1722a Remove. Don't XFAIL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103321 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 23:09:17 +00:00
Bill Wendling
20eb256006 Temorarily revert r101984.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103314 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 22:45:36 +00:00
Dan Gohman
4ce86f459c SDDbgValues are apparently not being legalized. Fix a symptom of the problem,
and not the real problem itself, by dropping debug info for i128 values.
rdar://7958162.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 22:19:08 +00:00
Kevin Enderby
a6eeb6e226 Fix i386 relocations to Weak Definitions. The relocation entries should be
external and the item to be relocated should not have the address of the
symbol added in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103302 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 21:44:23 +00:00
Dale Johannesen
0a406ae0d9 Fix PR 7087, and probably other things, by extending
getConstantFP to accept the two supported long double
target types.  This was not the original intent, but
there are other places that assume this works and it's
easy enough to do.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103299 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 21:35:53 +00:00
Devang Patel
735538b3eb Update test to use valid debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103287 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 20:34:00 +00:00
Jim Grosbach
4b77f6a85a Clean up the conditional for handling of sign_extend_inreg based on
whether the extract instructions are available.

rdar://7956878



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103277 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 18:34:55 +00:00
Duncan Sands
7d2568ca3c Correct some bogus target triples.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103265 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 17:03:48 +00:00
Dan Gohman
28a193ed8b Add an LLVM IR version of code sinking. This uses the same simple algorithm
as MachineSink, but it isn't constrained by MachineInstr-level details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103257 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 15:40:13 +00:00
Nick Lewycky
403d312c0f Revert r103133 and add testcase from PR7066.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103233 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 01:45:38 +00:00
Dale Johannesen
ad9e619813 Adjust tests affected by llvm-gcc 103229.
All results here match gcc-4.2.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103230 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 01:11:31 +00:00
Dan Gohman
281d65d004 Disable the new unknown-location code for now. It causes a major
increase in the debug line info section, and it's causing
regressions in a gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103226 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 01:08:53 +00:00
Daniel Dunbar
c26ae5ab7e MC/X86: X86AbsMemAsmOperand is subclass of X86NoSegMemAsmOperand.
- This fixes "leal 0, %eax", for example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103205 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-06 22:39:14 +00:00
Chris Lattner
e1611f26e3 fix rdar://7947167 - llvm-mc doesn't match movsq
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-06 21:48:14 +00:00
Sean Callanan
1a8b789a4b Eliminated the classification of control registers into %ecr_
and %rcr_, leaving just %cr_ which is what people expect.
Updated the disassembler to support this unified register set.
Added a testcase to verify that the registers continue to be
decoded correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103196 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-06 20:59:00 +00:00
Dan Gohman
34dcc6fadc Add a DebugLoc argument to TargetInstrInfo::copyRegToReg, so that it
doesn't have to guess.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103194 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-06 20:33:48 +00:00
Dan Gohman
ac963b3279 Add a testcase for r103135, explicitly representing unknown
locations in debug line info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103189 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-06 17:49:17 +00:00
Daniel Dunbar
5fe03c023c Revert r103137, fix for $ in labels. It looks like we can't actually handle this
at the token level. Consider the following horrible test case:

  a = 1
  .globl $a
  movl ($a), %eax
  movl $a, %eax
  movl $$a, %eax

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103178 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-06 14:46:38 +00:00
Chris Lattner
b4202dbb36 Fix PR7054 - Assertion `Symbol->isUndefined() && "Cannot define a symbol twice!"' failed.
Users can write broken code that emits the same label twice with asm renaming,
detect this and emit a fatal backend error instead of aborting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103140 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-06 00:05:37 +00:00
Chris Lattner
851f87c6c9 fix rdar://7946934 - in some limited cases, the assembler should
allow $ at the start of a symbol name.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103137 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 23:51:28 +00:00
Jim Grosbach
29402132f3 Cleanup of ARMv7M support. Move hardware divide and Thumb2 extract/pack
instructions to subtarget features and update tests to reflect.
PR5717.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103136 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 23:44:43 +00:00
Jakob Stoklund Olesen
51bfd452d5 Fix PR6520. An earlyclobber physreg must not be allocated to anything else.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103133 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 23:07:41 +00:00
Stuart Hastings
08bbda3811 Test case for pr2394 and r102979.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 22:49:33 +00:00
Jim Grosbach
bc1c98d538 fix copy/paste oops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 21:07:46 +00:00
Jim Grosbach
3a548e717f Add tests for ARMV7M divide instruction use
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103120 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 20:47:15 +00:00
Jim Grosbach
9ad2aafef1 remove unneeded underscores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103114 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 19:55:58 +00:00
Jim Grosbach
ab42ec3e51 Convert to filecheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 19:41:11 +00:00
Daniel Dunbar
2d7fd61e94 MC/Mach-O: Mark absolute variable's appropriately, and add Mach-O support for
writing them.
 - <rdar://problem/7885351> integrated assembler broken for i386 objc code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103112 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 19:01:05 +00:00
Daniel Dunbar
ae7fb0b03e MC/Mach-O/x86_64: Relocations in debug sections should use local relocations
when possible.
 - <rdar://problem/7934873>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103092 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 17:22:39 +00:00
Duncan Sands
55cd6cb141 Use llvm.foo as the intrinsic, rather than llvm.dbg.value. Since the
values passed to llvm.dbg.value were not valid for the intrinsic, it
might have caused trouble one day if the verifier ever started checking
for valid debug info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-04 20:09:25 +00:00