Commit Graph

27738 Commits

Author SHA1 Message Date
Evan Cheng 09f5be8146 Turn a 2-address instruction into a 3-address one when it's profitable even if the two-address operand is killed.
e.g.
%reg1024<def> = MOV r1
%reg1025<def> = ADD %reg1024, %reg1026
r0            = MOV %reg1025

If it's not possible / profitable to commute ADD, then turning ADD into a LEA saves a copy.

llvm-svn: 68065
2009-03-30 21:34:07 +00:00
Bill Wendling 2f52e6488f Balance out quote in debug output.
llvm-svn: 68059
2009-03-30 20:32:22 +00:00
Bill Wendling 5f0d97c571 Fix grammar-o in comment.
llvm-svn: 68057
2009-03-30 20:30:02 +00:00
Dan Gohman ff62c62b7c Constify arguments in isSuccessor and isLayoutSuccessor.
llvm-svn: 68054
2009-03-30 20:06:29 +00:00
Bob Wilson 57178e8822 Fix comment to match function name.
llvm-svn: 68050
2009-03-30 18:49:37 +00:00
Devang Patel 7a78f3abd3 getEntryFor() may invalidate DenseMap iterator.
Walking an invalidated iterator is not a good idea.

llvm-svn: 68047
2009-03-30 18:34:47 +00:00
Anton Korobeynikov 56709fdffe Fix thinko: put stuff with both global and local relocations into data.rel{.ro}, not .local
llvm-svn: 68036
2009-03-30 17:37:43 +00:00
Anton Korobeynikov 255a3cbfb4 Fix infinite looping
llvm-svn: 68034
2009-03-30 15:28:21 +00:00
Anton Korobeynikov d5e8e93a92 Properly propagate Kind.
llvm-svn: 68033
2009-03-30 15:28:00 +00:00
Anton Korobeynikov 7c5f3c40ca Do not propagate ELF-specific stuff (data.rel) into other targets. This simplifies code and also ensures correctness.
llvm-svn: 68032
2009-03-30 15:27:43 +00:00
Anton Korobeynikov c247fd396c Add data.rel stuff
llvm-svn: 68031
2009-03-30 15:27:03 +00:00
Anton Korobeynikov bea241a5f5 IA64 is as weird as Alpha wrt r/o relocs :)
llvm-svn: 68007
2009-03-29 17:14:35 +00:00
Anton Korobeynikov 014a86f216 Alpha always requires global relocations to be r/w regardless of PIC.
llvm-svn: 68006
2009-03-29 17:14:14 +00:00
Anton Korobeynikov 088ebede53 Honour relocation behaviour stuff for ro objects
llvm-svn: 68005
2009-03-29 17:13:49 +00:00
Anton Korobeynikov 7437b59caf Extend the relocation tracker handler, so we can filter on different 'kinds' of relocations required.
llvm-svn: 68004
2009-03-29 17:13:18 +00:00
Duncan Sands d21581eaa1 Fix PR3899: add support for extracting floats from vectors
when using -soft-float.
Based on a patch by Jakob Stoklund Olesen.

llvm-svn: 67996
2009-03-29 13:51:06 +00:00
Chris Lattner 8eda11bd9d now that you can put a PointerIntPair in a SmallPtrSet, remove some
hackish workarounds from memdep

llvm-svn: 67971
2009-03-29 00:24:04 +00:00
Chris Lattner 356d974a93 add a note
llvm-svn: 67953
2009-03-28 19:26:55 +00:00
Rafael Espindola 1f11c3c36f Use array_lengthof
llvm-svn: 67950
2009-03-28 19:02:18 +00:00
Rafael Espindola 6ff3dabbb4 Have only one definition of X86AddrNumOperands.
llvm-svn: 67949
2009-03-28 18:55:31 +00:00
Rafael Espindola c2a17d3022 Make code a bit less brittle by no hardcoding the number
of operands in an address in so many places.

llvm-svn: 67945
2009-03-28 17:03:24 +00:00
Arnold Schwaighofer e622cbf385 Make check in CheckTailCallReturnConstraints for ignorable instructions between
a CALL and a RET node more generic. Add a test for tail calls with a void
return.

llvm-svn: 67943
2009-03-28 12:36:29 +00:00
Arnold Schwaighofer 83d5420d02 Enable tail call optimization for functions that return a struct (bug 3664) and for functions that return types that need extending (e.g i1).
llvm-svn: 67934
2009-03-28 08:33:27 +00:00
Evan Cheng fd81c73cde Optimize some 64-bit multiplication by constants into two lea's or one lea + shl since imulq is slow (latency 5). e.g.
x * 40
=>
shlq    $3, %rdi
leaq    (%rdi,%rdi,4), %rax

This has the added benefit of allowing more multiply to be folded into addressing mode. e.g.
a * 24 + b
=>
leaq    (%rdi,%rdi,2), %rax
leaq    (%rsi,%rax,8), %rax

llvm-svn: 67917
2009-03-28 05:57:29 +00:00
Chris Lattner 7516668998 move a large method out of line.
llvm-svn: 67892
2009-03-28 02:08:47 +00:00
Dan Gohman 2785e4be37 Fix what surely must be a copy+pasto.
llvm-svn: 67881
2009-03-27 23:55:04 +00:00
Dan Gohman 6d75876473 Initialize LiveOutInfo's APInt members to zero, as APInt's
default constructor produces an uninitialized APInt.
This fixes PR3896.

llvm-svn: 67879
2009-03-27 23:51:02 +00:00
Jim Grosbach 669f1d0b0b remove trailing whitespace
llvm-svn: 67874
2009-03-27 23:06:27 +00:00
Gabor Greif 41c8515b1b "ghostify" the ilist<Function> sentinel
llvm-svn: 67872
2009-03-27 22:28:33 +00:00
Rafael Espindola 705f2a6cd2 Avoid hardcoding that X86 addresses have 4 operands.
llvm-svn: 67848
2009-03-27 15:57:50 +00:00
Rafael Espindola 227815437a Use less hard coded constants to make the code less brittle.
llvm-svn: 67846
2009-03-27 15:45:05 +00:00
Rafael Espindola e728019392 I am trying to add a segment to the X86 addresses matching to
improve TLS support (see http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090309/075220.html), but that code is VERY brittle.

This patch just makes it a bit more resistant.

llvm-svn: 67843
2009-03-27 15:26:30 +00:00
Duncan Sands 3241b74f69 Revert r67798: it breaks llvm-gcc bootstrap on x86-64-linux, presumably due to
a miscompilation.

make[4]: Entering directory `gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include'
if [ ! -d "./x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch" ]; then \
          mkdir -p ./x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch; \
        fi; \
        gcc-4.2.llvm-objects/./gcc/xgcc -shared-libgcc -Bgcc-4.2.llvm-objects/./gcc -nostdinc++ 
-Lgcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/src -Lgcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs 
-B/usr/local/gnat-llvm/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gnat-llvm/x86_64-unknown-linux-gnu/lib/ -isystem 
/usr/local/gnat-llvm/x86_64-unknown-linux-gnu/include -isystem /usr/local/gnat-llvm/x86_64-unknown-linux-gnu/sys-include -Winvalid-pch -Wno-deprecated -x 
c++-header -g -O2  -D_GNU_SOURCE -Igcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu 
-Igcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include -Igcc-4.2.llvm/libstdc++-v3/libsupc++ -O2 -g 
gcc-4.2.llvm/libstdc++-v3/include/precompiled/stdtr1c++.h -o x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch/O2g.gch
In file included from gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/tr1/repeat.h:247,
                 from gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/tr1/functional:1098,
                 from gcc-4.2.llvm/libstdc++-v3/include/precompiled/stdtr1c++.h:53:
gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/tr1/functional_iterate.h:417: internal compiler error: in ggc_recalculate_in_use_p, at 
ggc-page.c:1602
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://llvm.org/bugs/> for instructions.
make[4]: *** [x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch/O2g.gch] Error 1

llvm-svn: 67839
2009-03-27 14:56:47 +00:00
Mikhail Glushenkov f4be420def -write-graph now can be used with -o.
Makes it possible to set the output file name.

llvm-svn: 67835
2009-03-27 12:57:14 +00:00
John Mosby a1be2dcd63 Shrink wrapping in PEI: initial release. Finishing development, enable with --shrink-wrap.
llvm-svn: 67828
2009-03-27 06:09:40 +00:00
Dale Johannesen 4026b041ce One more place to skip debug info.
llvm-svn: 67811
2009-03-27 01:13:37 +00:00
Devang Patel fe7c0492a0 While hoisting an instruction, update alias info set tracker.
llvm-svn: 67798
2009-03-26 23:48:52 +00:00
Evan Cheng d88ebc352c -no-implicit-float means explicit fp operations are legal.
llvm-svn: 67784
2009-03-26 23:06:32 +00:00
Mikhail Glushenkov 87aa96ddf3 Fix misc. small issues with debug visualization.
Detailed bug report:
http://llvm.org/bugs/show_bug.cgi?id=3873

llvm-svn: 67768
2009-03-26 21:23:48 +00:00
Evan Cheng 904f14663d tADDhirr is a thumb instruction. Do not allow this code to be reached in non-thumb mode.
llvm-svn: 67765
2009-03-26 19:09:01 +00:00
Owen Anderson 76a561f35e Don't assign a new stack slot if the pre-alloc splitter already assigned one.
llvm-svn: 67764
2009-03-26 18:53:38 +00:00
Bill Wendling aa28be652c Pull transform from target-dependent code into target-independent code.
llvm-svn: 67742
2009-03-26 06:14:09 +00:00
Chris Lattner 78b7cbe668 fix warning in -asserts mode.
llvm-svn: 67739
2009-03-26 05:29:34 +00:00
Chris Lattner f38fd11a26 fix some warnings in release-asserts mode.
llvm-svn: 67738
2009-03-26 05:28:26 +00:00
Chris Lattner 3c04970f31 fix an apparently real bug exposed by a warning in -asserts mode.
llvm-svn: 67737
2009-03-26 05:28:14 +00:00
Chris Lattner 3871781c7b fix warning in -asserts build.
llvm-svn: 67736
2009-03-26 05:25:59 +00:00
Bill Wendling 94f299f2c5 Match this pattern so that we can generate simpler code:
%a = ...
  %b = and i32 %a, 2
  %c = srl i32 %b, 1
  %d = br i32 %c, 

into

  %a = ...
  %b = and %a, 2
  %c = X86ISD::CMP %b, 0
  %d = X86ISD::BRCOND %c ...

This applies only when the AND constant value has one bit set and the SRL
constant is equal to the log2 of the AND constant. The back-end is smart enough
to convert the result into a TEST/JMP sequence.

llvm-svn: 67728
2009-03-26 01:47:50 +00:00
Bill Wendling 189d67181c Doxygen-ify comments.
llvm-svn: 67727
2009-03-26 01:46:56 +00:00
Dale Johannesen db90560c1c Skip debug info one more place. (This one gets
called from llc, not opt, but it's an IR level
optimization nevertheless.)

llvm-svn: 67724
2009-03-26 01:15:07 +00:00
Devang Patel 4555618854 Before deleting a basic block, give other loop passes a chance cleanup analysis values, related to the instructions in the basic block.
llvm-svn: 67719
2009-03-25 23:57:48 +00:00