Commit Graph

26653 Commits

Author SHA1 Message Date
Chris Lattner
081b505f77 fix PR3281:accepted0[02].ll: represent empty arrays distinctly, and
diagnose attempts to initialize non-empty arrays with them.  This 
produces:
llvm-as: accepted02.ll:1:28: invalid empty array initializer
@"o" = global [5 x double] []
                           ^
llvm-as: accepted00.ll:1:32: invalid empty array initializer
@"za" = thread_local global {} []
                               ^
[


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61676 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 07:52:51 +00:00
Chris Lattner
3fbb3ab14d PR3281:crash00.ll: produce this diagnostic instead of crashing:
@t = global i8 0, align 3
                        ^



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61675 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 07:46:05 +00:00
Dan Gohman
69f9378675 Handle weak_extern in the JIT. This fixes
SingleSource/UnitTests/2007-04-25-weak.c in JIT mode. The test
now passes on systems which are able to produce a correct
reference output to compare with.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61674 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 05:32:42 +00:00
Scott Michel
1c7a81b0c5 CellSPU:
- Teach SPU64InstrInfo.td about the remaining signed comparisons, update tests
  accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61672 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 04:05:53 +00:00
Scott Michel
ed741dde28 CellSPU:
- Fix (brcond (setq ...)) bug, where BRNZ should have been used vice BRZ.
- Kill unused/unnecessary nodes in SPUNodes.td
- Beef out the i64operations.c test harness to use a lot of unaligned
  loads, test loops and LLVM loop/basic block optimizations; run the
  test harness successfully on real Cell hardware.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 01:34:35 +00:00
Nick Lewycky
6cd0c048b8 Move the libcall annotating part from doFinalization to doInitialization.
Finalization occurs after all the FunctionPasses in the group have run, which
is clearly not what we want.

This also means that we have to make sure that we apply the right param 
attributes when creating a new function.

Also, add a missed optimization: strdup and strndup. NoCapture and 
NoAlias return!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61658 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 00:07:50 +00:00
Nick Lewycky
1186bf1350 Add a mechanism to specify attributes in getOrInsertFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61645 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 22:54:40 +00:00
Chris Lattner
ad7d1e2085 Refactor some parser interfaces to fix PR3278 and a FIXME:
ParseAssemblyString with a specified module would not parse
into the module, it would create and return a new one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61635 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 20:44:11 +00:00
Nick Lewycky
0f8df9a9ce Run a post-pass that marks known function declarations by name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61632 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 20:27:34 +00:00
Chris Lattner
02b73ab017 elf writer really wants the size of the global, not the size
of the pointer to the global.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61630 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 20:19:20 +00:00
Bill Wendling
d3d69781d3 Revert this transform. It was causing some dramatic slowdowns in a few tests. See PR3266.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61623 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 06:19:11 +00:00
Bill Wendling
64f03003a1 The llvm::ELFWriter::EmitGlobal() method is calling the
llvm::PATypeHolder::get() method when LLVM is self-hosted in Release
mode. Before the parser changed, there was a definition of llvm::PAHolder::get()
in llvmAsmParser.y. This was probably a bug that no-one noticed.

Explicitly #include the Type.h file as a temporary fix for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 01:47:14 +00:00
Dan Gohman
cc91d63ab7 Fix a DAGCombiner abort on an invalid shift count constant. This fixes PR3250.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61613 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-03 19:22:06 +00:00
Dan Gohman
1eb9268080 CommuteNodesToReducePressure() is now removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61612 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-03 19:19:30 +00:00
Dan Gohman
223942a420 Remove the code from the scheduler that commuted two-address
instructions to avoid copies, because TwoAddressInstructionPass
also does this optimization.  The scheduler's version didn't
account for live-out values, which resulted in spurious commutes
and missed opportunities.

Now, TwoAddressInstructionPass handles all the opportunities,
instead of just those that the scheduler missed. The result is
usually the same, though there are occasional trivial differences
resulting from the avoidance of spurious commutes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61611 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-03 18:01:46 +00:00
Nick Lewycky
3b3b4e3f0f Any void readonly functions are provably dead, don't waste time adding
nocapture attributes to them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61610 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-03 17:05:32 +00:00
Evan Cheng
0be6d3fb2a Add Intel processors core i7 and atom.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61603 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-03 04:24:44 +00:00
Evan Cheng
5b925c031d Fix PR3210: Detect more Intel processors. Patch by Torok Edwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-03 04:04:46 +00:00
Nick Lewycky
87f333641a We know it's always a SCEVConstant if it gets here, so just cast it and
inline the only use of isNegative. Fixes warning reported by Mike Stump.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61600 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-03 01:53:24 +00:00
Scott Michel
52d0001cfc CellSPU:
- Remove custom lowering for BRCOND
- Add remaining functionality for branches in SPUInstrInfo, such as branch
  condition reversal and load/store folding. Updated BrCond test to reflect
  branch reversal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61597 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-03 00:27:53 +00:00
Misha Brukman
5679d18c54 Alphabetized #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61595 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 22:49:28 +00:00
Misha Brukman
9ea4034e00 Down with trailing whitespace!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 22:46:48 +00:00
Scott Michel
9bd7a371cb - Make copyRegToReg use the "LR" assembler synonym for "OR". Makes finding
register copies a little easier to pick out from the output.
- Fix bug 3192.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 20:52:08 +00:00
Nick Lewycky
ae285bf5a6 Don't try to analyze this "backward" case. This is overly conservative
pending a correct solution.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61589 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 18:54:17 +00:00
Daniel Dunbar
c120526e20 Remove comma at end of enumerator list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61585 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 16:32:55 +00:00
Daniel Dunbar
0526de6b3e Remove bison specific Makefile bits for AsmParser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 16:29:09 +00:00
Duncan Sands
9c5a5b01b4 Load tracking means that the value analyzed may
not have pointer type.  In particular, it may
be the condition argument for a select or a GEP
index.  While I was unable to construct a testcase
for which some bits of the original pointer are
captured due to one of these, it's very very close
to being possible - so play safe and exclude these
possibilities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61580 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 15:16:38 +00:00
Duncan Sands
338cd6ba6e When calculating 'nocapture' argument attributes, allow
the argument to be stored to an alloca by tracking uses
of the alloca.  This occurs 4 times (out of 7121, 0.05%)
in MultiSource/Applications, so may not be worth it.  On
the other hand, it is easy to do and fairly cheap.  The
functions it helps are: W_addcom and W_addlit in spiff;
process_args (argv) in d (make_dparser); ercPixConcealIMB
in JM/ldecod.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61570 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 11:54:37 +00:00
Duncan Sands
b2f2279056 Improve comments and reorganize a bit - no functionality
change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61569 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 11:46:24 +00:00
Chris Lattner
6d6b3cc89b Fix a really horrible typo, which caused undefined behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61566 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 08:49:06 +00:00
Chris Lattner
3ed88efb03 minor cleanups and comment improvements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61564 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 08:05:26 +00:00
Chris Lattner
a896176973 add a #include to hopefully get the x86-64-linux buildbot building.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 07:18:46 +00:00
Chris Lattner
db7ba94c88 update the cmakefile. This is a "best guess", I haven't tested this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61561 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 07:14:23 +00:00
Chris Lattner
df98617b23 Reimplement the old and horrible bison parser for .ll files with a nice
and clean recursive descent parser.

This change has a couple of ramifications:
1. The parser code is about 400 lines shorter (in what we maintain, not
   including what is autogenerated).
2. The code should be significantly faster than the old code because we 
   don't have to work around bison's poor handling of datatypes with 
   ctors/dtors.  This also makes the code much more resistant to memory 
   leaks.
3. We now get caret diagnostics from the .ll parser, woo.
4. The actual diagnostics emited from the parser are completely different
   so a bunch of testcases had to be updated.
5. I now disallow "%ty = type opaque %ty = type i32".  There was no good
   reason to support this, it was just an accident of the old 
   implementation.  I have no reason to think that anyone is actually using
   this.
6. The syntax for sticking a global variable has changed to make it 
   unambiguous.  I don't think anyone is depending on this since only clang
   supports this and it is not solid yet, so I'm not worried about anything
   breaking.
7. This gets rid of the last use of bison, and along with it the .cvs files.
   I'll prune this from the makefiles as a subsequent commit.

There are a few minor cleanups that can be done after this commit (suggestions
welcome!) but this passes dejagnu testing and is ready for its time in the
limelight.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61558 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 07:01:27 +00:00
Evan Cheng
ccb6976a69 Do not isel load folding bt instructions for pentium m, core, core2, and AMD processors. These are significantly slower than a load followed by a bt of a register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61557 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 05:35:45 +00:00
Evan Cheng
018b7ee91a Fix x86 CPU id detection to identify Penryn (and future processors).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61556 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 05:29:20 +00:00
Evan Cheng
52ceafa5c7 Use movaps / movd to extract vector element 0 even with sse4.1. It's still cheaper than pextrw especially if the value is in memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61555 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 05:29:08 +00:00
Nick Lewycky
6b05686283 Make adding nocapture a bit stronger. FreeInst is nocapture. Also,
functions that don't write can't leak a pointer except through 
the return value, so a void readonly function is implicitly nocapture.

Test these, and add a test that verifies that f1 calling f2 with an 
otherwise dead pointer gets both of them marked nocapture.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61552 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 03:46:56 +00:00
Duncan Sands
88e76757de Mention that this pass does escape analysis in the
leading comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61548 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-01 20:45:19 +00:00
Duncan Sands
b6e223a9e8 Factorize (and generalize) the code promoting SELECT
and BRCOND conditions.  Reorder a few methods while
there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61547 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-01 20:36:20 +00:00
Duncan Sands
ba6d26275f Remove trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61545 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-01 19:56:02 +00:00
Duncan Sands
5480c0469e Fix PR3274: when promoting the condition of a BRCOND node,
promote from i1 all the way up to the canonical SetCC type.
In order to discover an appropriate type to use, pass
MVT::Other to getSetCCResultType.  In order to be able to
do this, change getSetCCResultType to take a type as an
argument, not a value (this is also more logical).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-01 15:52:00 +00:00
Bill Wendling
94f0a38a00 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61538 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-01 01:19:59 +00:00
Bill Wendling
3479be91c4 Add transformation:
xor (or (icmp, icmp), true) -> and(icmp, icmp)

This is possible because of De Morgan's law.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-01 01:18:23 +00:00
Duncan Sands
1010941954 Look through phi nodes and select instructions when
calculating nocapture attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61535 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-31 20:21:34 +00:00
Duncan Sands
17da06ffbd Don't analyze arguments already marked 'nocapture'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61532 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-31 18:08:59 +00:00
Duncan Sands
9e89ba31f1 Rename AddReadAttrs to FunctionAttrs, and teach it how
to work out (in a very simplistic way) which function
arguments (pointer arguments only) are only dereferenced
and so do not escape.  Mark such arguments 'nocapture'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61525 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-31 16:14:43 +00:00
Owen Anderson
7d211e299f Get live interval reconstruction several steps closer to working.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61514 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-31 02:00:25 +00:00
Chris Lattner
d23b799d7d add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61513 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-31 00:54:13 +00:00
Scott Michel
02d711b93e - Start moving target-dependent nodes that could be represented by an
instruction sequence and cannot ordinarily be simplified by DAGcombine
  into the various target description files or SPUDAGToDAGISel.cpp.

  This makes some 64-bit operations legal.

- Eliminate target-dependent ISD enums.

- Update tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61508 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-30 23:28:25 +00:00
Bill Wendling
998dee96d3 Linux wants the FDE initial location and address range to be forced to 32-bit.
Darwin doesn't. Make this optional for platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61484 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-29 22:12:11 +00:00
Bill Wendling
bce452815c The FDE initial location and address range data should be free to be 64-bit
(quad) on a 64-bit platform. This fixes a problem with EH frames on Darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61483 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-29 21:51:42 +00:00
Duncan Sands
f08bf1193c Make stripPointerCasts and getUnderlyingObject
non-recursive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61479 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-29 21:06:19 +00:00
Duncan Sands
2964fe37ae Experiments show that looking through phi nodes
and select instructions doesn't buy anything here
except extra complexity: the only difference in
the entire testsuite was that a readonly function
became readnone in MiBench/consumer-typeset.  Add
a comment about this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61478 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-29 20:51:17 +00:00
Misha Brukman
e9dd47afa6 Fixed spelling, removed trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61477 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-29 20:08:23 +00:00
Duncan Sands
516ec62bfe Allow readnone functions to read (and write!) global
constants, since doing so is irrelevant for aliasing
purposes.  While this doesn't increase the total number
of functions marked readonly or readnone in MultiSource/
Applications (3089), it does result in 12 functions being
marked readnone rather than readonly.
Before:
  readnone: 820
  readonly: 2269
After:
  readnone: 832
  readonly: 2257


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61469 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-29 11:34:09 +00:00
Duncan Sands
2b7fc1ef53 Add braces, as suggested by a gcc warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61465 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-29 08:05:02 +00:00
Scott Michel
1df30c4061 - Various '#if 0' cleanups.
- Move v4i32, i32 mul into SPUInstrInfo.td, with a few more instruction
  cleanups there as well.
- Make SMUL_LOHI, UMUL_LOHI competely illegal for Cell SPU, to better
  assist Chris to see the problem in bug 3101.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61464 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-29 03:23:36 +00:00
Scott Michel
845145f8b5 Teach LeaglizeDAG that i64 mul can be a libcall.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61463 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-29 03:21:37 +00:00
Chris Lattner
9ace0cdb12 select constant exprs should have the same constraints as select instructions,
notably, they should support vectors and aggregates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61462 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-29 00:16:12 +00:00
Chris Lattner
b76ec320dc move select validation logic into a shared place where the select ctor,
verifier, asm parser, etc can share it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-29 00:12:50 +00:00
Owen Anderson
d4f6fe55eb Fix up kill/dead marking in the new live interval reconstruction code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61460 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-28 23:35:13 +00:00
Owen Anderson
60d4f6ded2 Add prototype code for recomputing a live interval's ranges and valnos through recursive phi construction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61458 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-28 21:48:48 +00:00
Nick Lewycky
3037eda1ef Check that the function prototypes are correct before assuming that the
parameters are pointers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61451 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-27 16:20:53 +00:00
Scott Michel
f0569be4a9 - Remove Tilmann's custom truncate lowering: it completely hosed over
DAGcombine's ability to find reasons to remove truncates when they were not
  needed. Consequently, the CellSPU backend would produce correct, but _really
  slow and horrible_, code.

  Replaced with instruction sequences that do the equivalent truncation in
  SPUInstrInfo.td.

- Re-examine how unaligned loads and stores work. Generated unaligned
  load code has been tested on the CellSPU hardware; see the i32operations.c
  and i64operations.c in CodeGen/CellSPU/useful-harnesses.  (While they may be
  toy test code, it does prove that some real world code does compile
  correctly.)

- Fix truncating stores in bug 3193 (note: unpack_df.ll will still make llc
  fault because i64 ult is not yet implemented.)

- Added i64 eq and neq for setcc and select/setcc; started new instruction
  information file for them in SPU64InstrInfo.td. Additional i64 operations
  should be added to this file and not to SPUInstrInfo.td.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61447 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-27 04:51:36 +00:00
Chris Lattner
e55484eb45 Add a simple pattern for matching 'bt'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61426 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-25 05:34:37 +00:00
Chris Lattner
f1e9fd5676 Fix some JIT encodings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61425 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-25 01:32:49 +00:00
Chris Lattner
d1e3229e4b BT memory operands load from their address operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61424 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-25 01:27:10 +00:00
Chris Lattner
1c39d4cfaa translateX86CC can never fail. Simplify it based on this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61423 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-24 23:53:05 +00:00
Bill Wendling
722f5f1cfb Darwin likes for the EH frame to be non-local.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61420 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-24 08:05:17 +00:00
Bill Wendling
d4121bef3c GCC doesn't emit DW_EH_PE_sdata4 for the FDE encoding on Darwin. I'm not sure
about other platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61415 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-24 05:25:49 +00:00
Dan Gohman
82779704ff Fix a compiler-abort on a testcase where the stack-pointer is added to
a symbolic constant. This is unlikely to be intentional, but it
shouldn't crash the compiler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61408 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-24 00:27:51 +00:00
Chris Lattner
4328708bad indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61407 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-24 00:11:37 +00:00
Dale Johannesen
7c7bc722ec Change comments so everybody can understand them, hopefully.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61405 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 23:47:22 +00:00
Chris Lattner
4c78e0286a simplify some control flow and reduce indentation, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61404 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 23:42:27 +00:00
Dale Johannesen
f6727b01a5 Revert 61362 and 61402 until SPEC breakage is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61403 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 23:21:35 +00:00
Dale Johannesen
2fa2517324 This fixes the bug in 175.vpr. It doesn't fix the
other SPEC breakage.  I'll be reverting all recent
changes shortly, this checking is mostly so this
change doesn't get lost.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 23:05:26 +00:00
Dale Johannesen
f9cbc1f9ac Add another permutation where we should get rid of a-a.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61401 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 23:01:27 +00:00
Dan Gohman
c7a37d4ff2 Add instruction patterns and encodings for the x86 bt instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61400 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 22:45:23 +00:00
Anton Korobeynikov
56d245ba8b Restore debug printing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61398 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 22:26:18 +00:00
Anton Korobeynikov
e2f95e9b61 Sometimes APInt syntax is really ugly... :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61397 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 22:26:01 +00:00
Anton Korobeynikov
1bfe237d69 Indent stuff properly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61396 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 22:25:45 +00:00
Anton Korobeynikov
2321858c8c Initial checkin of APInt'ififcation of switch lowering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61395 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 22:25:27 +00:00
Devang Patel
fd1c6c3123 Silence unused variable warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61392 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 21:56:28 +00:00
Devang Patel
d0935c3f43 Fix typo.
Silence unused variable warning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61391 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 21:55:38 +00:00
Devang Patel
2755896fd0 Silience unused warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61390 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 21:55:04 +00:00
Dan Gohman
0b1d4a798d Clean up the atomic opcodes in SelectionDAG.
This removes all the _8, _16, _32, and _64 opcodes and replaces each
group with an unsuffixed opcode. The MemoryVT field of the AtomicSDNode
is now used to carry the size information. In tablegen, the size-specific
opcodes are replaced by size-independent opcodes that utilize the
ability to compose them with predicates.

This shrinks the per-opcode tables and makes the code that handles
atomics much more concise.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61389 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 21:37:04 +00:00
Chris Lattner
9cf8ef63c6 add some notes for simplifylibcalls optimizations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61385 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 20:52:52 +00:00
Steve Naroff
1f33f8e4cc Tweak --version to include the date and time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61378 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 18:41:47 +00:00
Dan Gohman
c9a5b9e38b Rename BuildSchedUnits to BuildSchedGraph, and refactor the
code in ScheduleDAGSDNodes' BuildSchedGraph into separate functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61376 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 18:36:58 +00:00
Dan Gohman
237dee1259 Use isTerminator() instead of isBranch()||isReturn() in
several places. isTerminator() returns true for a superset
of cases, and includes things like FP_REG_KILL, which are
nither return or branch but aren't safe to move/remat/etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61373 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 17:28:50 +00:00
Dan Gohman
e1dfc7da89 Avoid an unnecessary call to allnodes_size(), which is linear.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61372 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 17:24:50 +00:00
Dan Gohman
1578f8486d Minor code simplifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61371 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 17:22:32 +00:00
Zhongxing Xu
f900f7b5a2 revert r61368.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61369 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 05:43:56 +00:00
Zhongxing Xu
fe5c8d08ff Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61368 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 05:30:44 +00:00
Mon P Wang
62c75ea397 Fixed code generation for v8i16 and v16i8 splats on X86.
Fixed lowering of v8i16 shuffles for v8i16 when we fall back to extract/insert.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61365 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 04:03:27 +00:00
Dale Johannesen
e6ec25543f Fix the time regression I introduced in 464.h264ref with
my last patch to this file.

The issue there was that all uses of an IV inside a loop
are actually references to Base[IV*2], and there was one
use outside that was the same but LSR didn't see the base
or the scaling because it didn't recurse into uses outside
the loop; thus, it used base+IV*scale mode inside the loop
instead of pulling base out of the loop.  This was extra bad
because register pressure later forced both base and IV into
memory.  Doing that recursion, at least enough
to figure out addressing modes, is a good idea in general;
the change in AddUsersIfInteresting does this.  However,
there were side effects....

It is also possible for recursing outside the loop to
introduce another IV where there was only 1 before (if
the refs inside are not scaled and the ref outside is).
I don't think this is a common case, but it's in the testsuite.
It is right to be very aggressive about getting rid of
such introduced IVs (CheckForIVReuse and the handling of
nonzero RewriteFactor in StrengthReduceStridedIVUsers).
In the testcase in question the new IV produced this way
has both a nonconstant stride and a nonzero base, neither
of which was handled before.  And when inserting 
new code that feeds into a PHI, it's right to put such 
code at the original location rather than in the PHI's 
immediate predecessor(s) when the original location is outside 
the loop (a case that couldn't happen before)
(RewriteInstructionToUseNewBase); better to avoid making
multiple copies of it in this case.

Also, the mechanism for keeping SCEV's corresponding to GEP's
no longer works, as the GEP might change after its SCEV
is remembered, invalidating the SCEV, and we might get a bad
SCEV value when looking up the GEP again for a later loop.  
This also couldn't happen before, as we weren't recursing
into GEP's outside the loop.

I owe some testcases for this, want to get it in for nightly runs.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61362 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 02:12:52 +00:00
Dale Johannesen
58e39b0200 One more permutation of subtracting off a base value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61361 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 01:59:54 +00:00
Owen Anderson
ae53c932b9 Don't forget to remove phi nodes from the value numbering table after we collapse them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61358 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 00:49:51 +00:00
Dan Gohman
15a3a49e19 Make the fuse-failed debug output human-readable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61356 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-23 00:19:20 +00:00
Bill Wendling
30788b828a Comment clean-ups. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61354 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 22:32:22 +00:00
Bill Wendling
6d463f2efc Check that the instruction isn't in the value numbering scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61353 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 22:28:56 +00:00
Bill Wendling
75f02ee771 Simplification: Negate the operator== method instead of implementing a full operator!= method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61352 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 22:16:31 +00:00
Bill Wendling
70ded19b3f Add verification that deleted instruction isn't hiding in the PHI map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61350 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 22:14:07 +00:00
Bill Wendling
ec40d50aa4 Verify removed in a few more places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61349 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 21:57:30 +00:00
Bill Wendling
246dbbb8be Add verification functions to GVN which check to see that an instruction was
truely deleted. These will be expanded with further checks of all of the data
structures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61347 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 21:36:08 +00:00
Dan Gohman
00d448a341 Refactor a bunch of code out of AsmPrinter::EmitGlobalConstant into separate
functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61345 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 21:14:27 +00:00
Dan Gohman
8044e9b3af Optimize setDepthDirty and setHeightDirty a little, as they showed
up on a profile.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61344 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-22 21:11:33 +00:00
Nick Lewycky
13a09e298c Turn strcmp into memcmp, such as strcmp(P, "x") --> memcmp(P, "x", 2).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61297 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-21 00:19:21 +00:00
Dan Gohman
b12b1a27f5 Fix fast-isel to not emit invalid assembly when presented with a
constant shift count that doesn't fit in the shift instruction's
immediate field. This fixes PR3242.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61281 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 17:19:40 +00:00
Nick Lewycky
9dce873c1a Remove redundant test for vector-nature. Scan the vector first to see whether
our optz'n will apply to it, then build the replacement vector only if needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61279 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 16:48:00 +00:00
Dan Gohman
e19c6362d2 Use SmallVector's pop_back_val.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61277 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 16:42:33 +00:00
Dan Gohman
f89e6e6577 Use the correct Preds and Succs lists in setHeightDirty()
and setDepthDirty(), respectively. This fixes PR3241.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61276 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 16:34:57 +00:00
Dan Gohman
6c3643c41b Use ~0u instead of -1u as the special value, to hopefully avoid
warnings on compilers that warn about such things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61263 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 22:23:43 +00:00
Evan Cheng
5379f412bc Fix PR3149. If an early clobber def is a physical register and it is tied to an input operand, it effectively extends the live range of the physical register. Currently we do not have a good way to represent this.
172     %ECX<def> = MOV32rr %reg1039<kill>
180     INLINEASM <es:subl $5,$1
        sbbl $3,$0>, 10, %EAX<def>, 14, %ECX<earlyclobber,def>, 9, %EAX<kill>,
36, <fi#0>, 1, %reg0, 0, 9, %ECX<kill>, 36, <fi#1>, 1, %reg0, 0
188     %EAX<def> = MOV32rr %EAX<kill>
196     %ECX<def> = MOV32rr %ECX<kill>
204     %ECX<def> = MOV32rr %ECX<kill>
212     %EAX<def> = MOV32rr %EAX<kill>
220     %EAX<def> = MOV32rr %EAX
228     %reg1039<def> = MOV32rr %ECX<kill>

The early clobber operand ties ECX input to the ECX def.

The live interval of ECX is represented as this:
%reg20,inf = [46,47:1)[174,230:0)  0@174-(230) 1@46-(47)

The right way to represent this is something like
%reg20,inf = [46,47:2)[174,182:1)[181:230:0)  0@174-(182) 1@181-230 @2@46-(47)

Of course that won't work since that means overlapping live ranges defined by two val#.

The workaround for now is to add a bit to val# which says the val# is redefined by a early clobber def somewhere. This prevents the move at 228 from being optimized away by SimpleRegisterCoalescing::AdjustCopiesBackFrom.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61259 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 20:58:01 +00:00
John Criswell
de8c611c08 The fields for the stoppoint debug intrinsic have not changed, so update the
version number assertions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61257 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 19:56:36 +00:00
Gordon Henriksen
2a9c671a51 C bindings for dyn_cast_or_null.
This operation can be used to build dyn_cast, isa, and cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61252 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 18:39:45 +00:00
Chris Lattner
38e7721455 Add support for writing LLVM IR to a specified BitstreamWriter.
Patch by Lukasz Janyst!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61251 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 18:37:59 +00:00
Dan Gohman
018a34c576 Move the patterns which have i8 immediates before the patterns
that have i32 immediates so that they get selected first. This
currently only matters in the JIT, as assemblers will
automatically use the smallest encoding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61250 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 18:25:21 +00:00
Evan Cheng
ab63152871 - CodeGenPrepare does not split loop back edges but it only knows about back edges of single block loops. It now does a DFS walk to find loop back edges.
- Use SplitBlockPredecessors to factor out common predecessors of the critical edge destination. This is disabled for now due to some regressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61248 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 18:03:11 +00:00
Chris Lattner
a33649e98c Fix some release-assert warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61244 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 17:03:38 +00:00
Rafael Espindola
2f6fea90a5 Fix bug 3202.
The EH_frame and .eh symbols are now private, except for darwin9 and earlier.
The patch also fixes the definition of PrivateGlobalPrefix on pcc linux.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61242 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 10:55:56 +00:00
Nick Lewycky
d802be39d7 Update the .cvs files for nocapture.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61241 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 09:41:54 +00:00
Nick Lewycky
73ddd4f00d Commit missed files from nocapture change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61240 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 09:38:31 +00:00
Nick Lewycky
f23d0d392a Resubmit support for the 'nocapture' attribute.
The problematic part of this patch is that we were out of attribute bits,
requiring some fancy bit hacking to make it fit (by shrinking alignment)
without breaking existing users or the file format.

This change will require users to rebuild llvm-gcc to match llvm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61239 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 06:39:12 +00:00
Bill Wendling
bebbded574 Perform this loop only when the -debug flag is specified.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61238 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 02:09:57 +00:00
Dan Gohman
1385758215 Initialize the ImplicitDefed member, to avoid getting stale
data from a previous block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61237 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 00:46:20 +00:00
Bill Wendling
e533f4e343 Didn't mean to commit this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61222 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 22:19:50 +00:00
Dan Gohman
a5b2fee757 Teach LowerSubregs to preserve kill/dead information when lowering
subreg instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61220 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 22:14:08 +00:00
Bill Wendling
82c19ae10a Re-XFAIL this test until debug stuff settles down.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61219 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 22:13:31 +00:00
Dan Gohman
98c206921a Make LowerSubregs' debug output for EXTRACT_SUBREG consistent with
that of INSERT_SUBREG and SUBREG_TO_REG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61218 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 22:11:34 +00:00
Dan Gohman
f04865f234 Fix a copy+pasto in an assertion message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61217 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 22:07:25 +00:00
Dan Gohman
07af765049 Fix indentation level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61216 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 22:06:01 +00:00
Dan Gohman
bfd23c9961 When emitting instructions that define EFLAGS and the EFLAGS value isn't
used, mark the defs as dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61215 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 22:03:42 +00:00
Dan Gohman
34d6ad73e1 When setting up the frame pointer, add it as a live-in register to all
non-entry blocks, so that it doesn't appear use-before-def anywhere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61214 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 22:01:52 +00:00
Dan Gohman
2ccc839669 Print subreg information in MachineInstr::dump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61213 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 21:51:27 +00:00
Mon P Wang
af9b952627 Fixed x86 code generation of multiple for v2i64. It was incorrect for SSE4.1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61211 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 21:42:19 +00:00
Mon P Wang
87c8a8f304 Added support for vector widening.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61209 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 20:03:17 +00:00
Evan Cheng
5c9f34b7a0 Remove dead comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61201 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 09:01:18 +00:00
Nick Lewycky
19c2892677 Oops! Left out a line.
Simplifying the sdiv might allow further simplifications for our users.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61196 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 06:42:28 +00:00
Nick Lewycky
2a8f6597a3 Make all the vector elements positive in an srem of constant vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61195 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 06:31:11 +00:00
Chris Lattner
31535f1f04 Fix PR2929 by making bugpoint/code extract propagate the nothrow
bit from the original function to the cloned one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61194 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 05:52:56 +00:00
Dan Gohman
7224170f6a Give MachineLICM a name, for -time-passes etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61184 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 01:37:56 +00:00
Dan Gohman
23b0d490cd Move post-RA scheduling before branch folding for now, because branch
folding's tail merging doesn't currently preserve liveness information
which post-RA scheduling requires.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61183 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 01:36:42 +00:00
Owen Anderson
2ebf63f8e2 Re-apply r61158 in a form that no longer breaks tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61182 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 01:27:19 +00:00
Dale Johannesen
a1d9cb1d46 Revert previous patch, appears to break bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61181 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 01:23:41 +00:00
Dan Gohman
a32b7ac86f Mark the x86 fp stack registers as "reserved". This tells LiveVariables
and the RegisterScavenger not to expect traditional liveness 
techniques are applicable to these registers, since we don't fully
modify the effects of push and pop after stackification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61179 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 01:05:09 +00:00
Dale Johannesen
12b882cf53 Fix the time regression I introduced in 464.h264ref with
my last patch to this file.

The issue there was that all uses of an IV inside a loop
are actually references to Base[IV*2], and there was one
use outside that was the same but LSR didn't see the base
or the scaling because it didn't recurse into uses outside
the loop; thus, it used base+IV*scale mode inside the loop
instead of pulling base out of the loop.  This was extra bad
because register pressure later forced both base and IV into
memory.  Doing that recursion, at least enough
to figure out addressing modes, is a good idea in general;
the change in AddUsersIfInteresting does this.  However,
there were side effects....

It is also possible for recursing outside the loop to
introduce another IV where there was only 1 before (if
the refs inside are not scaled and the ref outside is).
I don't think this is a common case, but it's in the testsuite.
It is right to be very aggressive about getting rid of
such introduced IVs (CheckForIVReuse and the handling of
nonzero RewriteFactor in StrengthReduceStridedIVUsers).
In the testcase in question the new IV produced this way
has both a nonconstant stride and a nonzero base, neither
of which was handled before.  (This patch does not handle 
all the cases where this can happen.)  And when inserting 
new code that feeds into a PHI, it's right to put such 
code at the original location rather than in the PHI's 
immediate predecessor(s) when the original location is outside 
the loop (a case that couldn't happen before)
(RewriteInstructionToUseNewBase); better to avoid making
multiple copies of it in this case.

Everything above is exercised in
CodeGen/X86/lsr-negative-stride.ll (and ifcvt4 in ARM which is
the same IR).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61178 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 00:57:22 +00:00
Chris Lattner
5f4f84ba3e reapply this hunk from Bill's reversion in r61169, it is conservative
and safe and orthogonal from turning off load pre.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61177 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 00:51:32 +00:00
Chris Lattner
24313e7aba make instnamer name unnamed blocks as well as instructions and args.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61175 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 00:33:11 +00:00
Bill Wendling
13d10096e1 Temporarily revert r61027. It was causing a bootstrap failure in "release" mode
with everyone's favorite error messages:

Comparing stages 2 and 3
warning: ./cc1-checksum.o differs
warning: ./cc1plus-checksum.o differs
Bootstrap comparison failure!
./c-decl.o differs
./cp/decl.o differs
./df-core.o differs
./gcc.o differs
./i386.o differs
./stor-layout.o differs
./tree-pretty-print.o differs
./tree.o differs
make[2]: *** [compare] Error 1
make[1]: *** [stage3-bubble] Error 2

See PR3227.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61169 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-17 23:31:20 +00:00
Devang Patel
854967effe Today the front-ends (llvm-gcc and clang) generate multiple llvm.dbg.compile_units to identify source file for various debug entities. Each llvm.dbg.compile_unit matches one file on the disk. However, the backend only supports one DW_TAG_compile_unit per .o file. The backend selects first compile_unit from the vector to construct DW_TAG_compile_unit entry, which is not correct in all cases.
First step to resolve this is, record file name and directory directly in debug info for various debug entities. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61164 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-17 22:39:29 +00:00
Owen Anderson
c7a21941c5 Revert r61158 for now, as it caused some test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61159 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-17 22:17:27 +00:00
Owen Anderson
25dffa743b Fix miscompilations caused by renumbering, and enable it as part of prealloc splitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61158 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-17 22:06:59 +00:00
Chris Lattner
851ba39dab This adds some missing functions to the C binding:
- ability to insert previously created instructions using a builder
- creation of aliases
- creation of inline asm constants

Patch by Zoltan Varga!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61153 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-17 21:39:50 +00:00
Bill Wendling
29bc4f0dcc Forgot to revert r61031 when I reverted r61019, r61030, and r61040.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61150 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-17 20:59:57 +00:00
Mon P Wang
84aff84cfa Fix expansion of vsetcc to set the high bit for true instead of 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61129 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-17 08:49:47 +00:00
Chris Lattner
f49a28cd02 insert some sequence points and preincrement an iterator to avoid
iterator invalidation problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61124 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-17 05:42:08 +00:00
Chris Lattner
bce4afe839 Enhance heap sra to be substantially more aggressive w.r.t PHI
nodes.  This allows it to do fairly general phi insertion if a 
load from a pointer global wants to be SRAd but the load is used
by (recursive) phi nodes.  This fixes a pessimization on ppc
introduced by Load PRE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61123 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-17 05:28:49 +00:00
Dan Gohman
89b64bd7e5 Double the amount of memory reserved for SUnits. This is a
temporary workaround for an obscure bug. When node cloning is
used, it is possible that more SUnits will be created, and
if the SUnits std::vector has to reallocate, it will
invalidate all the graph edges.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61122 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-17 04:30:46 +00:00
Dan Gohman
fccf6dd377 Use getDepth() and getHeight() instead of accessing the
Depth and Height members directly, as they may not be
current.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61121 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-17 04:25:52 +00:00
Eli Friedman
28dc98f752 Fix for PR3225: disable a broken optimization in
DAGTypeLegalizer::ExpandShiftWithKnownAmountBit.

In terms of restoring the optimization, the best fix here isn't 
obvious... any ideas?



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61119 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-17 03:35:17 +00:00
Dale Johannesen
b0390620d4 Clarify that the scale factor from CheckForIVReuse
can be negative.  Keep track of whether all uses of
an IV are outside the loop.  Some cosmetics; no
functional change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61109 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 22:16:28 +00:00
Dale Johannesen
fd3b7b7df3 A new dag combine; several permutations of this
are there under ADD, this one was missing.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61107 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 22:13:49 +00:00
Owen Anderson
d0b6a0d967 Add code to renumber split intervals into new vregs. This is disabled for now until I finish working out some iterator invalidation issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61104 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 21:35:08 +00:00
Chris Lattner
85d3d4f35d Fix another crash found by inspection. If we have a PHI node merging
the load multiple times, make sure the check the uses of the PHI to 
ensure they are transformable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61102 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 21:24:51 +00:00
Chris Lattner
542dc1a0de fix a crash found by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 21:04:51 +00:00
Eli Friedman
080efb8cea Add a helper to remove a branch and DCE the condition, and use it
consistently for deleting branches.  In addition to being slightly 
more readable, this makes SimplifyCFG a bit better 
about cleaning up after itself when it makes conditions unused.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61100 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 20:54:32 +00:00
Dan Gohman
00dc84a2ca Eliminate the loop that walks the critical path. Instead, just track the
position in the critical path during the main instruction walk.  This
eliminates the need for the CritialAntiDep DenseMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61096 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 19:27:52 +00:00
Bill Wendling
6fa311c233 Temporarily revert r61019, r61030, and r61040. These were breaking LLVM Release
builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61094 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 19:06:48 +00:00
Dan Gohman
905ff1ebc4 Preserve SourceValue information when lowering produces multiple loads from
different offsets within the same stack slot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61093 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 18:25:36 +00:00
Evan Cheng
09dc9c0c83 We have decided not to support inline asm where an output operand with a matching input operand with incompatible type (i.e. either one is a floating point and the other is an integer or the sizes of the types differ). SelectionDAGBuild will catch these and exit with an error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 18:21:39 +00:00
Oscar Fuentes
8069f28a5d CMake: Added DbgInfoPrinter.cpp to lib/Analysis/CMakeFiles.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61087 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 12:25:04 +00:00
Torok Edwin
6e68106a47 Add -print-dbginfo pass that prints LLVM IR with comments inserted to show
which source/line a certain BB/instruction comes from, original variable names,
and original (unmangled) C++ name of functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61085 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 09:09:19 +00:00
Torok Edwin
620f28095b Add utility functions to search for DbgStopPointInst corresponding to an
instruction or BasicBlock, and to search for DbgDeclareInst corresponding to a
variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61084 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 09:07:36 +00:00
Torok Edwin
a70c68efc8 use different name for parameter to make it clear that we set DIDescriptor::GV
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61083 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 09:06:01 +00:00
Nick Lewycky
1447f5ca1f Generalize support for analyzing loops to include SLE/SGE loop exit conditions
and support for non-unit strides with signed exit conditions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61082 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 08:30:01 +00:00
Chris Lattner
5a6bb6ae78 switch some std::set/std::map to SmallPtrSet/DenseMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61081 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 07:34:30 +00:00
Chris Lattner
f478951b0e fix PR3217: fully cached queries need to be verified against the
visited set before they are used.  If used, their blocks need to be
added to the visited set so that subsequent queries don't use conflicting
pointer values in the cache result blocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61080 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 07:10:09 +00:00
Dan Gohman
812d7506d0 Enable anti-dependence breaking by default when post-RA scheduling is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61078 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 06:21:45 +00:00
Dan Gohman
fde221fa0a When breaking an anti-dependency, don't use a register which has seen
one of its aliases defined. This is conservative, but tricky subreg
corner cases are outside the primary aim of this pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61077 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 06:20:58 +00:00
Dan Gohman
8749b61178 Add initial support for back-scheduling address computations,
especially in the case of addresses computed from loop induction
variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61075 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 03:35:01 +00:00
Dan Gohman
9a65d6afc2 Remove some special-case logic in ScheduleDAGSDNodes's
latency computation code that is no longer needed with the
new method for handling latencies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61074 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 03:31:11 +00:00
Dan Gohman
3f23744df4 Fix some register-alias-related bugs in the post-RA scheduler liveness
computation code. Also, avoid adding output-depenency edges when both
defs are dead, which frequently happens with EFLAGS defs.

Compute Depth and Height lazily, and always in terms of edge latency
values. For the schedulers that don't care about latency, edge latencies
are set to 1.

Eliminate Cycle and CycleBound, and LatencyPriorityQueue's Latencies array.
These are all subsumed by the Depth and Height fields.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61073 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 03:25:46 +00:00
Dan Gohman
4ea8e85e19 Add a simple target-independent heuristic to allow targets with no
instruction itinerary data to back-schedule loads.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61070 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 02:38:22 +00:00
Dan Gohman
c6b680eee5 Move addPred and removePred out-of-line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61067 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 01:05:52 +00:00
Dan Gohman
ffa391272b Make addPred and removePred return void, since the return value is not
currently used by anything.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61066 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 01:00:55 +00:00
Dan Gohman
3ee7449f39 This getEdgeAttributes doesn't need a template argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61065 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 00:55:00 +00:00
Chris Lattner
101f44e81f enhance heap-sra to apply to fixed sized array allocations, not just
variable sized array allocations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61051 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 21:44:34 +00:00
Mon P Wang
93b3b928d7 Added support for splitting and scalarizing vector shifts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61050 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 21:44:00 +00:00
Chris Lattner
344b41cfbd Use stripPointerCasts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61047 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 21:20:32 +00:00
Chris Lattner
49b6d4ae9e minor tweaks for formatting, allow bitcast in ValueIsOnlyUsedLocallyOrStoredToOneGlobal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61046 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 21:08:54 +00:00
Chris Lattner
e61d0a626e refactor some code into a new TryToOptimizeStoreOfMallocToGlobal function.
Use GetElementPtrInst::hasAllZeroIndices where possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61045 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 21:02:25 +00:00
Chris Lattner
1314f20283 Teach basicaa to use the nocapture attribute when possible. When the
intrinsics are properly marked nocapture, the fixme should be addressed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61040 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 18:59:22 +00:00
Dan Gohman
464fc5a044 Fix printing of PseudoSourceValues in SDNode graphs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61036 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 17:28:10 +00:00
Chris Lattner
582048d5b8 add some more notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61033 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 08:32:28 +00:00
Chris Lattner
8f416f3afd Add a testcase for GCC PR 23455, which lpre handles now. Add some
comments about why we're not getting other cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61032 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 07:49:24 +00:00
Nick Lewycky
fd7eb7252f Update generated files after nocapture syntax change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61031 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 07:31:07 +00:00
Nick Lewycky
382da62ec2 It turns out that "align 1" and unaligned are different. Add a bias to the
alignment attribute such that 0 means unaligned.

This will probably require a rebuild of llvm-gcc because of the change to
Attributes.h. If you see many test failures on "make check", please rebuild
your llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 07:29:55 +00:00
Mon P Wang
d17c030276 Added support to LegalizeType for expanding the operands of scalar to vector
and insert vector element.  Modified extract vector element to extend the
result to match the expected promoted type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61029 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 06:57:02 +00:00