Commit Graph

55412 Commits

Author SHA1 Message Date
Chris Lattner
3bf6815556 enhance x-(-A) -> x+A to preserve NUW/NSW.
Use the presence of NSW/NUW to fold "icmp (x+cst), x" to a constant in
cases where it would otherwise be undefined behavior.

Surprisingly (to me at least), this triggers hundreds of the times in
a few benchmarks: lencode, ldecode, and 466.h264ref seem to *really*
like this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91812 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 04:04:05 +00:00
Chris Lattner
2799bafb98 Optimize all cases of "icmp (X+Cst), X" to something simpler. This triggers
a bunch in lencode, ldecod, spass, 176.gcc, 252.eon, among others.  It is 
also the first part of PR5822


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 03:19:28 +00:00
Chris Lattner
6b57a797ab convert to filecheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 03:11:05 +00:00
Lang Hames
0d9c12539a Fixed use of phi param in SlotIndex constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 23:32:32 +00:00
Chris Lattner
f648125be9 fix an overly conservative caching issue that caused memdep to
cache a pointer as being unavailable due to phi trans in the
wrong place.  This would cause later queries to fail even when
they didn't involve phi trans.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91787 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 21:29:22 +00:00
Daniel Dunbar
b310839aed CMake: Update lib deps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91786 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 21:27:30 +00:00
Chris Lattner
349d8489b2 .llx is no more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91784 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 20:56:53 +00:00
Chris Lattner
16e7ae42a1 fix inconsistent use of tabs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91783 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 20:44:43 +00:00
Daniel Dunbar
d4f84dadda Remove unused variable (noticed by clang++).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91780 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 18:58:49 +00:00
Daniel Dunbar
c814346c9d #if 0 out X86 disassembler for now, it is breaking the build in multiple places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91778 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 17:11:53 +00:00
Sanjiv Gupta
bcfd12a234 Emit direction operand in binary insns that stores in memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91777 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 13:52:01 +00:00
Sanjiv Gupta
7ae1ddeb2f Adding a bunch of options to the mcc16 driver.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91776 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 13:13:29 +00:00
Nuno Lopes
392bbd99b6 rename dprintf to dbgpritnf, in order to fix build with glibc (which already defines dprintf in stdio.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 12:07:00 +00:00
Nuno Lopes
014dc70907 fix build and while at it remove a redudant include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91774 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 11:52:18 +00:00
Sanjiv Gupta
3f5d7642ce Test cases for changes done in 91768.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 11:38:14 +00:00
Sanjiv Gupta
08bd440bca 1. In indirect load/store insns , the name of fsr should be emitted as INDF.
2. include standard asmbly headers in generated asmbly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91768 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 08:26:25 +00:00
Douglas Gregor
cabdd7425d Fix a bunch of little errors that Clang complains about when its being pedantic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 07:05:23 +00:00
Chris Lattner
0ebc6ce974 fix PR5827 by disabling the phi slicing transformation in a case
where instcombine would have to split a critical edge due to a
phi node of an invoke.  Since instcombine can't change the CFG,
it has to bail out from doing the transformation.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91763 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 07:01:15 +00:00
Bob Wilson
e88728d757 Update my SROA changes in response to review.
* change FindElementAndOffset to return a uint64_t instead of unsigned, and
  to identify the type to be used for that result in a GEP instruction.
* move "isa<ConstantInt>" to be first in conditional.
* replace some dyn_casts with casts.
* add a comment about handling mem intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 06:53:17 +00:00
Daniel Dunbar
8783087f69 More bzero -> memset that I missed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 04:16:57 +00:00
Daniel Dunbar
9e6d1d1f50 Add missing newlines at EOF (for clang++).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91756 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 04:16:48 +00:00
Daniel Dunbar
71f842d7c1 Use memset instead of bzero, its more portable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 03:31:50 +00:00
Douglas Gregor
f8ca42ff59 Remove spurious semicolon. Thanks, Clang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91752 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 03:21:36 +00:00
Sean Callanan
8ed9f51663 Table-driven disassembler for the X86 architecture (16-, 32-, and 64-bit
incarnations), integrated into the MC framework.  

The disassembler is table-driven, using a custom TableGen backend to 
generate hierarchical tables optimized for fast decode.  The disassembler 
consumes MemoryObjects and produces arrays of MCInsts, adhering to the 
abstract base class MCDisassembler (llvm/MC/MCDisassembler.h).

The disassembler is documented in detail in

- lib/Target/X86/Disassembler/X86Disassembler.cpp (disassembler runtime)
- utils/TableGen/DisassemblerEmitter.cpp (table emitter)

You can test the disassembler by running llvm-mc -disassemble for i386
or x86_64 targets.  Please let me know if you encounter any problems
with it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91749 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 02:59:52 +00:00
Anton Korobeynikov
e9ec6ad1ba Bump alignment requirements for windows targets to achieve compartibility with vcpp.
Based on patch by Michael Beck!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91745 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 02:04:23 +00:00
Anton Korobeynikov
cc62c3c928 Use 4-arg getVTList) variant instead of generic one, when possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91744 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 02:04:00 +00:00
Dan Gohman
1fef0c4962 Delete unused code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 01:47:13 +00:00
Dan Gohman
355b4f3c19 Fix a spello in a comment that Nick spotted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 01:46:34 +00:00
Dan Gohman
2929e1143a Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91741 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 01:46:09 +00:00
Chris Lattner
cd0129f5a6 Make some methods const. The only interesting change here is that
it changes raw_fd_ostream::preferred_buffer_size to return zero on
a scary stat failure instead of setting the stream to an error state.
This method really should not mutate the stream.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91740 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 01:38:42 +00:00
John McCall
c63ca0a71b Qualify a bunch of explicit template instantiations to satisfy clang++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 00:55:12 +00:00
John McCall
be58a432ac Put TypesEqual and TypeHasCycleThroughItself in namespace llvm so ADL from
the templates in TypesContext.h can find them.  Caught by clang++.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91735 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 00:51:42 +00:00
Bill Wendling
29b49fc6aa Forgot forward declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91732 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 00:05:07 +00:00
Dan Gohman
43ea505fb0 Eliminate unnecessary LLVMContexts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 23:42:08 +00:00
Bill Wendling
b4e6a5df5d Changes from review:
- Move DisableScheduling flag into TargetOption.h
- Move SDNodeOrdering into its own header file. Give it a minimal interface that
  doesn't conflate construction with storage.
- Move assigning the ordering into the SelectionDAGBuilder.

This isn't used yet, so there should be no functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 23:32:53 +00:00
Dan Gohman
28680d33ee Make this comment more precise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91722 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 23:18:03 +00:00
Eli Friedman
5760f35e15 Fix an issue in googletest where a name was used before it was defined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91718 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 21:38:44 +00:00
Evan Cheng
9ab2b98ba5 Increase opportunities to optimize (brcond (srl (and c1), c2)).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91717 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 21:31:31 +00:00
Eli Friedman
3eed182e2d Fix gcc warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 21:07:18 +00:00
Rafael Espindola
1cefd7cd07 Catch more cases of a pointer being marked garbage twice. This helps when
debugging some leaks (PR5770 in particular).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 20:35:38 +00:00
Bob Wilson
b742defa0a Reapply 91459 with a simple fix for the problem that broke the x86_64-darwin
bootstrap.  This also replaces the WeakVH references that Chris objected to
with normal Value references.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 20:14:40 +00:00
Bob Wilson
3994b4b05e Fix another parallel make race condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91709 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 20:12:14 +00:00
Victor Hernandez
5d30162150 Formalize MDNode's function-localness:
- an MDNode is designated as function-local when created, and continues to be even if its operands are modified not to refer to function-local IR
- function-localness is designated via lowest bit in SubclassData
- getLocalFunction() descends MDNode tree to see if it is consistently function-local

Add verification of MDNodes to checks that MDNodes are consistently function-local.
Update AsmWriter to use isFunctionLocal().



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91708 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 20:09:14 +00:00
Daniel Dunbar
1edcafe10f Fix Win32 Path.inc for API update.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 19:59:48 +00:00
Dan Gohman
59de33ef39 Revert this use of NUW/NSW also. Overflow-undefined multiplication isn't
associative either.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91701 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 18:45:31 +00:00
Rafael Espindola
fda60d35c2 Fix libstdc++ build on ARM linux and part of PR5770.
MI was not being used but it was also not being deleted, so it was kept in the garbage list. The memory itself was freed once the function code gen was done.

Once in a while the codegen of another function would create an instruction on the same address. Adding it to the garbage group would work once, but when another pointer was added it would cause an assert as "Cache" was about to be pushed to Ts.

For a patch that make us detect problems like this earlier, take a look at

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20091214/092758.html

With that patch we assert as soon and the new instruction is added to the garbage set.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 16:59:39 +00:00
Tilmann Scheller
cfcb7997ad Fix wrong frame pointer save offset in the 64-bit PowerPC SVR4 ABI.
Patch contributed by Ken Werner of IBM!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91681 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 13:00:34 +00:00
Tilmann Scheller
3a84dae654 Add support for calls through function pointers in the 64-bit PowerPC SVR4 ABI.
Patch contributed by Ken Werner of IBM!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91680 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 13:00:15 +00:00
Mikhail Glushenkov
9503b49462 Make 'set_option' work with list options.
This works now: (set_option "list_opt", ["val_1", "val_2", "val_3"])

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91679 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 11:27:26 +00:00
Eli Friedman
97b087c778 Optimize icmp of null and select of two constants even if the select has
multiple uses.  (The construct in question was found in gcc.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91675 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 08:22:35 +00:00