oota-llvm.git
14 years agoMC: Drop support for alignment in ZeroFill fragment, we can just use
Daniel Dunbar [Wed, 12 May 2010 22:51:27 +0000 (22:51 +0000)]
MC: Drop support for alignment in ZeroFill fragment, we can just use
MCAlignFragments for this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103661 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix the encoding of the obscure "moffset" forms of moves, i386
Chris Lattner [Wed, 12 May 2010 22:48:24 +0000 (22:48 +0000)]
fix the encoding of the obscure "moffset" forms of moves, i386
part first.  rdar://7947184

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103660 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoClear CachedFunctionInfo upon Pass::releaseMemory. Because ValueMap will abort
Nick Lewycky [Wed, 12 May 2010 21:48:15 +0000 (21:48 +0000)]
Clear CachedFunctionInfo upon Pass::releaseMemory. Because ValueMap will abort
on RAUW of functions, this is a correctness issue instead of a mere memory
usage problem.

No testcase until the new MergeFunctions can land.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103653 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agolit: Fix a sh lexing bug which caused annotate-token.m to fail when run with the
Daniel Dunbar [Wed, 12 May 2010 21:47:58 +0000 (21:47 +0000)]
lit: Fix a sh lexing bug which caused annotate-token.m to fail when run with the
internal shell parser; we weren't lexing the quotes in a command like::

  clang -DFOO='hello'

correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103652 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify.
Daniel Dunbar [Wed, 12 May 2010 21:47:55 +0000 (21:47 +0000)]
Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103651 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC: Factor out MCAssembler::LayoutFragment
Daniel Dunbar [Wed, 12 May 2010 21:35:25 +0000 (21:35 +0000)]
MC: Factor out MCAssembler::LayoutFragment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103649 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC: Tweak section layout to not relying on accumulating address value.
Daniel Dunbar [Wed, 12 May 2010 21:35:22 +0000 (21:35 +0000)]
MC: Tweak section layout to not relying on accumulating address value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103648 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoADT: Add ilist_node::get{Prev,Next}Node, which return the adjacent node or null.
Daniel Dunbar [Wed, 12 May 2010 21:35:19 +0000 (21:35 +0000)]
ADT: Add ilist_node::get{Prev,Next}Node, which return the adjacent node or null.
 - This provides a convenient alternative to using something llvm::prior or
   manual iterator access, for example::

    if (T *Prev = foo->getPrevNode())
      ...

   instead of::

     iterator it(foo);
     if (it != begin()) {
       --it;
       ...
     }

 - Chris, please review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103647 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove a dead fixme.
Evan Cheng [Wed, 12 May 2010 20:20:22 +0000 (20:20 +0000)]
Remove a dead fixme.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103642 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake sure to add kill flags to the last use of a virtreg when it is redefined.
Jakob Stoklund Olesen [Wed, 12 May 2010 18:46:03 +0000 (18:46 +0000)]
Make sure to add kill flags to the last use of a virtreg when it is redefined.
The X86 floating point stack pass and others depend on good kill flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103635 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTest case for r103633.
Devang Patel [Wed, 12 May 2010 18:31:04 +0000 (18:31 +0000)]
Test case for r103633.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103634 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC: Simplify LayoutSection to just take the index of the section to layout.
Daniel Dunbar [Wed, 12 May 2010 17:56:47 +0000 (17:56 +0000)]
MC: Simplify LayoutSection to just take the index of the section to layout.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103627 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agolit: Fix OneCommandPerFileTest format when tests are specified directly.
Daniel Dunbar [Wed, 12 May 2010 17:56:44 +0000 (17:56 +0000)]
lit: Fix OneCommandPerFileTest format when tests are specified directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103626 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agolit: Add support for 'lit ... @foo', which reads a list of tests to run from
Daniel Dunbar [Wed, 12 May 2010 17:56:42 +0000 (17:56 +0000)]
lit: Add support for 'lit ... @foo', which reads a list of tests to run from
foo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103625 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC: Track section layout order explicitly, and use to simplify.
Daniel Dunbar [Wed, 12 May 2010 15:42:59 +0000 (15:42 +0000)]
MC: Track section layout order explicitly, and use to simplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103616 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agostylistic change to MCSectionCOFF::PrintSwitchToSection COMDAT handling
Nathan Jeffords [Wed, 12 May 2010 07:36:03 +0000 (07:36 +0000)]
stylistic change to MCSectionCOFF::PrintSwitchToSection COMDAT handling

Made a stylistic changed to the code/comments related to the unsupported COMDAT selection  type IMAGE_COMDAT_SELECT_LARGEST based on from Anton Korobeynikov.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103590 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove unused variable. Tweak a comment while there.
Duncan Sands [Wed, 12 May 2010 07:11:33 +0000 (07:11 +0000)]
Remove unused variable.  Tweak a comment while there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103586 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd support for movi32 of global values to the new (MC) asm printer.
Rafael Espindola [Wed, 12 May 2010 05:16:34 +0000 (05:16 +0000)]
Add support for movi32 of global values to the new (MC) asm printer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103576 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTestcase for llvm 103572 (7898991).
Dale Johannesen [Wed, 12 May 2010 05:04:20 +0000 (05:04 +0000)]
Testcase for llvm 103572 (7898991).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103574 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoupdated support for the COFF .linkonce
Nathan Jeffords [Wed, 12 May 2010 04:26:09 +0000 (04:26 +0000)]
updated support for the COFF .linkonce

Now, the .linkonce directive is emitted as part of MCSectionCOFF::PrintSwitchToSection instead of AsmPrinter::EmitLinkage since it is an attribute of the section the symbol was placed into not the symbol itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103568 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agovst instructions are modeled as this:
Evan Cheng [Wed, 12 May 2010 01:42:50 +0000 (01:42 +0000)]
vst instructions are modeled as this:
v1024 = REG_SEQUENCE ...
v1025 = EXTRACT_SUBREG v1024, 5
v1026 = EXTRACR_SUBREG v1024, 6
      = VSTxx <addr>, v1025, v1026

The REG_SEQUENCE ensures the sources that feed into the VST instruction
are getting the right register allocation so they form a large super-
register. The extract_subreg will be coalesced away all would just work:
v1024 = REG_SEQUENCE ...
      = VSTxx <addr>, v1024:5, v1024:6

The problem is if the coalescer isn't run, the extract_subreg instructions
would stick around and there is no assurance v1025 and v1026 will get the
right registers.

As a short term workaround, teach the NEON pre-allocation pass to transfer
the sub-register indices over. An alternative would be do it 2addr pass
when reg_sequence's are eliminated. But that *seems* wrong and require
updating liveness information.

Another alternative is to do this in the scheduler when the instructions are
created. But that would mean somehow the scheduler this has to be done for
correctness reason. That's yucky as well. So for now, we are leaving this
in the target specific pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103540 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach local regalloc about virtual registers with sub-indices.
Evan Cheng [Wed, 12 May 2010 01:29:36 +0000 (01:29 +0000)]
Teach local regalloc about virtual registers with sub-indices.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103539 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCode clean up.
Evan Cheng [Wed, 12 May 2010 01:27:49 +0000 (01:27 +0000)]
Code clean up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103538 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/X86: Extend suffix matching hack to match 'q' suffix.
Daniel Dunbar [Wed, 12 May 2010 00:54:20 +0000 (00:54 +0000)]
MC/X86: Extend suffix matching hack to match 'q' suffix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103535 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdded a trivial function to modify the flags field of MCSymbolData class. The functio...
Nathan Jeffords [Wed, 12 May 2010 00:52:54 +0000 (00:52 +0000)]
Added a trivial function to modify the flags field of MCSymbolData class. The function takes the value and a mask, and clears the mask bits before applying the value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103534 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/Mach-O/x86_64: Add a new hook for checking whether a particular section can
Daniel Dunbar [Wed, 12 May 2010 00:38:17 +0000 (00:38 +0000)]
MC/Mach-O/x86_64: Add a new hook for checking whether a particular section can
be diced into atoms, and adjust getAtom() to take this into account.
 - This fixes relocations to symbols in fixed size literal sections, for
   example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103532 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEnable a bunch more -regalloc=fast tests
Jakob Stoklund Olesen [Wed, 12 May 2010 00:11:24 +0000 (00:11 +0000)]
Enable a bunch more -regalloc=fast tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103531 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAvoid scoping issues, fix buildbots
Jakob Stoklund Olesen [Wed, 12 May 2010 00:11:19 +0000 (00:11 +0000)]
Avoid scoping issues, fix buildbots

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103530 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd initial kill flag support to FastISel.
Dan Gohman [Tue, 11 May 2010 23:54:07 +0000 (23:54 +0000)]
Add initial kill flag support to FastISel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103529 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake Clang happy.
Daniel Dunbar [Tue, 11 May 2010 23:53:13 +0000 (23:53 +0000)]
Make Clang happy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103528 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/Mach-O/x86_64: Fix PCrel adjustment for x86_64, which was using the fixup
Daniel Dunbar [Tue, 11 May 2010 23:53:11 +0000 (23:53 +0000)]
MC/Mach-O/x86_64: Fix PCrel adjustment for x86_64, which was using the fixup
offset instead of the fixup address as intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103527 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/Mach-O: As Kevin pointed out, 'Address' is really an offset -- rename to clarify.
Daniel Dunbar [Tue, 11 May 2010 23:53:07 +0000 (23:53 +0000)]
MC/Mach-O: As Kevin pointed out, 'Address' is really an offset -- rename to clarify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103526 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/Mach-O: Fix a crash on invalid.
Daniel Dunbar [Tue, 11 May 2010 23:53:05 +0000 (23:53 +0000)]
MC/Mach-O: Fix a crash on invalid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103525 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR6951 by fixing Module leaks in bugpoint.
Jeffrey Yasskin [Tue, 11 May 2010 23:25:16 +0000 (23:25 +0000)]
Fix PR6951 by fixing Module leaks in bugpoint.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103523 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStore the Dirty bit in the LiveReg structure instead of a bit vector.
Jakob Stoklund Olesen [Tue, 11 May 2010 23:24:47 +0000 (23:24 +0000)]
Store the Dirty bit in the LiveReg structure instead of a bit vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103522 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoKeep track of the last place a live virtreg was used.
Jakob Stoklund Olesen [Tue, 11 May 2010 23:24:45 +0000 (23:24 +0000)]
Keep track of the last place a live virtreg was used.
This allows us to add accurate kill markers, something the scavenger likes.
Add some more tests from ARM that needed this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103521 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't set kill flags on uses of CopyFromReg nodes. InstrEmitter doesn't
Dan Gohman [Tue, 11 May 2010 21:59:14 +0000 (21:59 +0000)]
Don't set kill flags on uses of CopyFromReg nodes. InstrEmitter doesn't
create separate virtual registers for CopyFromReg values, so uses of
them don't necessarily kill the value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103519 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAvoid breaking vstd when reg_sequence is not used.
Evan Cheng [Tue, 11 May 2010 21:07:36 +0000 (21:07 +0000)]
Avoid breaking vstd when reg_sequence is not used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103513 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoOne more -regalloc=fast test
Jakob Stoklund Olesen [Tue, 11 May 2010 20:51:07 +0000 (20:51 +0000)]
One more -regalloc=fast test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103509 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSilence warning
Jakob Stoklund Olesen [Tue, 11 May 2010 20:51:04 +0000 (20:51 +0000)]
Silence warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103508 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify this logic of creating a default Features object.
Bill Wendling [Tue, 11 May 2010 20:46:04 +0000 (20:46 +0000)]
Simplify this logic of creating a default Features object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103507 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify the tracking of used physregs to a bulk bitor followed by a transitive
Jakob Stoklund Olesen [Tue, 11 May 2010 20:30:28 +0000 (20:30 +0000)]
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

14 years agoRevert r103493, materializing functions in the regular PassManager.
Dan Gohman [Tue, 11 May 2010 20:30:00 +0000 (20:30 +0000)]
Revert r103493, materializing functions in the regular PassManager.
It works in simple cases, but it isn't a general solution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103499 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoI got tired of VISIBILITY_HIDDEN colliding with the gcc enum. Rename it
Duncan Sands [Tue, 11 May 2010 20:16:09 +0000 (20:16 +0000)]
I got tired of VISIBILITY_HIDDEN colliding with the gcc enum.  Rename it
to LLVM_LIBRARY_VISIBILITY and introduce LLVM_GLOBAL_VISIBILITY, which is
the opposite, for future use by dragonegg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103495 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach the regular pass manager how to materialize functions as needed.
Dan Gohman [Tue, 11 May 2010 19:58:43 +0000 (19:58 +0000)]
Teach the regular pass manager how to materialize functions as needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103493 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove the "WantsWholeFile" concept, as it's no longer needed. CBE
Dan Gohman [Tue, 11 May 2010 19:57:55 +0000 (19:57 +0000)]
Remove the "WantsWholeFile" concept, as it's no longer needed. CBE
and the others use the regular addPassesToEmitFile hook now, and
llc no longer needs a bunch of redundant code to handle the
whole-file case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103492 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTrim #includes and forward declarations.
Dan Gohman [Tue, 11 May 2010 19:11:43 +0000 (19:11 +0000)]
Trim #includes and forward declarations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103489 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMostly rewrite RegAllocFast.
Jakob Stoklund Olesen [Tue, 11 May 2010 18:54:45 +0000 (18:54 +0000)]
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

14 years agoFix a comment.
Dan Gohman [Tue, 11 May 2010 18:03:41 +0000 (18:03 +0000)]
Fix a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103483 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement a bunch more TargetSelectionDAGInfo infrastructure.
Dan Gohman [Tue, 11 May 2010 17:31:57 +0000 (17:31 +0000)]
Implement a bunch more TargetSelectionDAGInfo infrastructure.

Move EmitTargetCodeForMemcpy, EmitTargetCodeForMemset, and
EmitTargetCodeForMemmove out of TargetLowering and into
SelectionDAGInfo to exercise this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103481 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/Mach-O x86_64: Switch to using fragment atom symbol.
Daniel Dunbar [Tue, 11 May 2010 17:22:50 +0000 (17:22 +0000)]
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

14 years agoTest commit.
Daniel Dunbar [Tue, 11 May 2010 17:22:45 +0000 (17:22 +0000)]
Test commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103479 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTest commit.
Tanya Lattner [Tue, 11 May 2010 16:47:42 +0000 (16:47 +0000)]
Test commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103478 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTest commit.
Tanya Lattner [Tue, 11 May 2010 16:46:45 +0000 (16:46 +0000)]
Test commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103477 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove the TargetLowering::getSubtarget() virtual function, which
Dan Gohman [Tue, 11 May 2010 16:21:03 +0000 (16:21 +0000)]
Remove the TargetLowering::getSubtarget() virtual function, which
was unused. TargetMachine::getSubtarget() is used instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103474 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake SPU backend not assert on jump tables.
Kalle Raiskila [Tue, 11 May 2010 11:00:02 +0000 (11:00 +0000)]
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

14 years agoSelect @llvm.trap to the special B with 1111 condition (i.e. trap) instruction.
Evan Cheng [Tue, 11 May 2010 07:26:32 +0000 (07:26 +0000)]
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

14 years agoFixes for Microsoft Visual Studio 2010, from Steven Watanabe!
Douglas Gregor [Tue, 11 May 2010 06:17:44 +0000 (06:17 +0000)]
Fixes for Microsoft Visual Studio 2010, from Steven Watanabe!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103457 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't create a StringRef with a NULL value.
Bill Wendling [Tue, 11 May 2010 01:33:39 +0000 (01:33 +0000)]
Don't create a StringRef with a NULL value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103455 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoExtended the edis "IsBranch" property to call
Sean Callanan [Tue, 11 May 2010 01:27:08 +0000 (01:27 +0000)]
Extended the edis "IsBranch" property to call
instructions as well.  Added support for checking
this to the llvm-mc tester as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103454 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoModel some vst3 and vst4 with reg_sequence.
Evan Cheng [Tue, 11 May 2010 01:19:40 +0000 (01:19 +0000)]
Model some vst3 and vst4 with reg_sequence.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103453 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoThe getDefaultSubtargetFeatures method of SubtargetFeature did actually return a
Bill Wendling [Tue, 11 May 2010 00:30:02 +0000 (00:30 +0000)]
The getDefaultSubtargetFeatures method of SubtargetFeature did actually return a
string of features for that target. However LTO was using that string to pass
into the "create target machine" stuff. That stuff needed the feature string to
be in a particular form. In particular, it needed the CPU specified first and
then the attributes. If there isn't a CPU specified, it required it to be blank
-- e.g., ",+altivec". Yuck.

Modify the getDefaultSubtargetFeatures method to be a non-static member
function. For all attributes for a specific subtarget, it will add them in like
normal. It will also take a CPU string so that it can satisfy this horrible
syntax.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103451 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIt's not safe eliminate copies where src and dst have different sub-register indices.
Evan Cheng [Tue, 11 May 2010 00:20:03 +0000 (00:20 +0000)]
It's not safe eliminate copies where src and dst have different sub-register indices.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103450 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEnsure REG_SEQUENCE source operands are unique.
Evan Cheng [Tue, 11 May 2010 00:04:31 +0000 (00:04 +0000)]
Ensure REG_SEQUENCE source operands are unique.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103449 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMC/Mach-O: Fix another mismatch with .weak_definition, we shouldn't use a
Daniel Dunbar [Mon, 10 May 2010 23:15:20 +0000 (23:15 +0000)]
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

14 years agoMC/Mach-O: Factor out doesSymbolRequireExternRelocation.
Daniel Dunbar [Mon, 10 May 2010 23:15:13 +0000 (23:15 +0000)]
MC/Mach-O: Factor out doesSymbolRequireExternRelocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103442 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIndentation.
Evan Cheng [Mon, 10 May 2010 23:08:19 +0000 (23:08 +0000)]
Indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103441 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEnable multiple Compile Units in one module.
Devang Patel [Mon, 10 May 2010 22:49:55 +0000 (22:49 +0000)]
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

14 years agoMC/Mach-O: Explicitly track atoms, as represented by their defining symbol, for each...
Daniel Dunbar [Mon, 10 May 2010 22:45:09 +0000 (22:45 +0000)]
MC/Mach-O: Explicitly track atoms, as represented by their defining symbol, for each fragment (not yet used).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103438 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoModel some vld3 instructions with REG_SEQUENCE.
Evan Cheng [Mon, 10 May 2010 21:26:24 +0000 (21:26 +0000)]
Model some vld3 instructions with REG_SEQUENCE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103437 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIt's not safe to propagate implicit_def that defines part of a register.
Evan Cheng [Mon, 10 May 2010 21:25:30 +0000 (21:25 +0000)]
It's not safe to propagate implicit_def that defines part of a register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103436 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoClear RegSequences vector after eliminating REG_SEQUENCE instructions.
Evan Cheng [Mon, 10 May 2010 21:24:55 +0000 (21:24 +0000)]
Clear RegSequences vector after eliminating REG_SEQUENCE instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103435 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agothis really is needed. :(
Chris Lattner [Mon, 10 May 2010 21:23:48 +0000 (21:23 +0000)]
this really is needed. :(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103434 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agojust remove this, it isn't needed.
Chris Lattner [Mon, 10 May 2010 21:01:47 +0000 (21:01 +0000)]
just remove this, it isn't needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103432 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosimplify more.
Chris Lattner [Mon, 10 May 2010 20:59:18 +0000 (20:59 +0000)]
simplify more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103431 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSimplify by using startswith instead of substr.
Chris Lattner [Mon, 10 May 2010 20:58:42 +0000 (20:58 +0000)]
Simplify by using startswith instead of substr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103430 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix PR7105 by enumerating MDNodes on all @llvm.foo
Chris Lattner [Mon, 10 May 2010 20:53:17 +0000 (20:53 +0000)]
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

14 years agofix a pretty obvious typo. We test things before committing them, right?
Chris Lattner [Mon, 10 May 2010 20:51:06 +0000 (20:51 +0000)]
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

14 years agoFix PR6875:
David Greene [Mon, 10 May 2010 20:24:27 +0000 (20:24 +0000)]
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

14 years agoAdd an explicit keyword.
Dan Gohman [Mon, 10 May 2010 20:14:02 +0000 (20:14 +0000)]
Add an explicit keyword.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103424 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd new configure option, --disable-timestamps, intended to turn off anything which...
Daniel Dunbar [Mon, 10 May 2010 20:11:56 +0000 (20:11 +0000)]
Add new configure option, --disable-timestamps, intended to turn off anything which would mess up binary/object comparisons. Currently:
 - Disables 'Built on ...' in 'foo --version'.
 - Disables timestamps from being embedded into .dir files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103423 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix whitespace in debug output to be consistent.
Dan Gohman [Mon, 10 May 2010 20:07:44 +0000 (20:07 +0000)]
Fix whitespace in debug output to be consistent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103422 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDelete an obsolete comment.
Dan Gohman [Mon, 10 May 2010 19:47:21 +0000 (19:47 +0000)]
Delete an obsolete comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103420 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBe careful with operand promotion. For a binary operation, the source operands may...
Evan Cheng [Mon, 10 May 2010 19:03:57 +0000 (19:03 +0000)]
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

14 years agoTest case for 103414.
Devang Patel [Mon, 10 May 2010 17:49:40 +0000 (17:49 +0000)]
Test case for 103414.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103415 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoModel vld2 / vst2 with reg_sequence.
Evan Cheng [Mon, 10 May 2010 17:34:18 +0000 (17:34 +0000)]
Model vld2 / vst2 with reg_sequence.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103411 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRe-defined valno is always valno even for partial re-def's.
Evan Cheng [Mon, 10 May 2010 17:33:49 +0000 (17:33 +0000)]
Re-defined valno is always valno even for partial re-def's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103410 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR7096. When a block containing multiple defs is tail duplicated, the
Bob Wilson [Mon, 10 May 2010 17:14:26 +0000 (17:14 +0000)]
Fix PR7096.  When a block containing multiple defs is tail duplicated, the
SSAUpdater for the value from the first def may see uses of undefined values,
because the later defs will not have been updated yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103407 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix encoding of 'sf' and 'sfh' instructions.
Kalle Raiskila [Mon, 10 May 2010 08:13:49 +0000 (08:13 +0000)]
Fix encoding of 'sf' and 'sfh' instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103399 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd command line option --gcc to bugpoint.
Kalle Raiskila [Mon, 10 May 2010 07:38:37 +0000 (07:38 +0000)]
Add command line option --gcc to bugpoint.
Remove sending duplicate of the --gcc-tool-args parameters to gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103397 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd an assertion to catch attempts to access off the end of the array.
Duncan Sands [Mon, 10 May 2010 04:54:28 +0000 (04:54 +0000)]
Add an assertion to catch attempts to access off the end of the array.
Based on a patch by Javier Martinez.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103391 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoremove a dead file.
Chris Lattner [Sun, 9 May 2010 17:34:13 +0000 (17:34 +0000)]
remove a dead file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103383 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoupdated handling dllexport in X86AsmPrinter
Nathan Jeffords [Sun, 9 May 2010 08:40:06 +0000 (08:40 +0000)]
updated handling dllexport in X86AsmPrinter

changed dllexport code to use EmitBytes instead of EmitRawText, and changed the export option to use /EXPORT: instead of -export: on the windows platform

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103377 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomade COFF target dllexport logic apply to all subtargets
Nathan Jeffords [Sun, 9 May 2010 05:52:28 +0000 (05:52 +0000)]
made COFF target dllexport logic apply to all subtargets

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103373 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agotest commit, added a comment to MCSectionCOFF::PrintSwitchToSection function
Nathan Jeffords [Sun, 9 May 2010 05:49:00 +0000 (05:49 +0000)]
test commit, added a comment to MCSectionCOFF::PrintSwitchToSection function

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103372 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomake simplifycfg insert an llvm.trap before the 'unreachable' it introduces
Chris Lattner [Sat, 8 May 2010 22:15:59 +0000 (22:15 +0000)]
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

14 years agoTeach instcombine to transform a bitcast/(zext|trunc)/bitcast sequence
Chris Lattner [Sat, 8 May 2010 21:50:26 +0000 (21:50 +0000)]
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

14 years agoFix PR7052, patch by Jakub Staszak!
Chris Lattner [Sat, 8 May 2010 20:01:44 +0000 (20:01 +0000)]
Fix PR7052, patch by Jakub Staszak!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103347 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agobreak coff symbol definition stuff out into proper MCStreamer callbacks,
Chris Lattner [Sat, 8 May 2010 19:54:22 +0000 (19:54 +0000)]
break coff symbol definition stuff out into proper MCStreamer callbacks,
patch by Nathan Jeffords!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103346 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReadd testcase.
Bill Wendling [Sat, 8 May 2010 04:47:54 +0000 (04:47 +0000)]
Readd testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103335 91177308-0d34-0410-b5e6-96231b3b80d8