1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
Commit Graph

58030 Commits

Author SHA1 Message Date
Chris Lattner
80aaccb987 Fix PR6497, a bug where we'd fold a load into an addc
node which has a flag.  That flag in turn was used by an
already-selected adde which turned into an ADC32ri8 which
used a selected load which was chained to the load we
folded.  This flag use caused us to form a cycle.  Fix
this by not ignoring chains in IsLegalToFold even in
cases where the isel thinks it can.

llvm-svn: 97791
2010-03-05 06:19:13 +00:00
Chris Lattner
5804690a45 cleanup
llvm-svn: 97790
2010-03-05 06:17:43 +00:00
Chris Lattner
d7353d219f inline a small function with one call site.
llvm-svn: 97789
2010-03-05 05:49:45 +00:00
Jeffrey Yasskin
a526081ebf Free MDNodes when the LLVMContext is destroyed. Leak found by Valgrind.
llvm-svn: 97788
2010-03-05 05:47:09 +00:00
Mikhail Glushenkov
67cac93b81 Make it not an error to specify -O* options several times.
As in 'llvmc -O2 -O2 test.c'.

llvm-svn: 97787
2010-03-05 04:46:39 +00:00
Mikhail Glushenkov
c1566d8281 Use FindExecutable as a fall-back search method.
Allows us to find executables that are in the same directory.

llvm-svn: 97786
2010-03-05 04:46:28 +00:00
Evan Cheng
04b9deff58 Rever 96389 and 96990. They are causing some miscompilation that I do not fully understand.
llvm-svn: 97782
2010-03-05 03:08:23 +00:00
Dan Gohman
ebdb1743d3 Revert r97778 and r97779. They're somehow breaking llvm-gcc builds.
llvm-svn: 97781
2010-03-05 02:40:23 +00:00
Chris Lattner
a867bc28df apparently if gold is around lto needs to be part of DIRS.
llvm-svn: 97780
2010-03-05 02:34:34 +00:00
Dan Gohman
0a01ba144d Fix these constants to be more portable.
llvm-svn: 97779
2010-03-05 02:13:10 +00:00
Dan Gohman
e5b9ea020f Rewrite i64-to-f64 conversion using an algorithm which handles
rounding correctly. This implementation is a generalization of
the x86_64 code in compiler-rt.

This fixes rdar://7683708.

llvm-svn: 97778
2010-03-05 02:00:46 +00:00
Johnny Chen
dd24501890 Trivial comment change.
llvm-svn: 97776
2010-03-05 01:45:46 +00:00
Evan Cheng
340941a422 Add missing break for Intrinsic::objectsize case. It was falling through to the following Intrinsic::bswap code. I have no idea why it wasn't breaking stuff.
llvm-svn: 97774
2010-03-05 01:22:47 +00:00
Chris Lattner
c5bf78ce52 disable libprofile on cygwin, patch by Aaron Gray.
llvm-svn: 97772
2010-03-05 01:00:34 +00:00
Chris Lattner
41804bf422 Only build libedis if ENABLE_SHARED is specified, just like liblto.
Don't build any of the dynamic library stuff on cygwin/mingw.

llvm-svn: 97771
2010-03-05 00:59:18 +00:00
Chris Lattner
bbffb2392c liblto and gold don't need to be built in serial
llvm-svn: 97770
2010-03-05 00:54:45 +00:00
Chris Lattner
f42f70bfa1 add an assertion requested on llvmdev.
llvm-svn: 97769
2010-03-05 00:49:08 +00:00
Bill Wendling
a92a5b8a6c Revert r97766. It's deleting a tag.
llvm-svn: 97768
2010-03-05 00:33:59 +00:00
Bill Wendling
55b4dfcd9d Micro-optimization:
This code:

float floatingPointComparison(float x, float y) {
    double product = (double)x * y;
    if (product == 0.0)
        return product;
    return product - 1.0;
}

produces this:

_floatingPointComparison:
0000000000000000        cvtss2sd        %xmm1,%xmm1
0000000000000004        cvtss2sd        %xmm0,%xmm0
0000000000000008        mulsd           %xmm1,%xmm0
000000000000000c        pxor            %xmm1,%xmm1
0000000000000010        ucomisd         %xmm1,%xmm0
0000000000000014        jne             0x00000004
0000000000000016        jp              0x00000002
0000000000000018        jmp             0x00000008
000000000000001a        addsd           0x00000006(%rip),%xmm0
0000000000000022        cvtsd2ss        %xmm0,%xmm0
0000000000000026        ret

The "jne/jp/jmp" sequence can be reduced to this instead:

_floatingPointComparison:
0000000000000000        cvtss2sd        %xmm1,%xmm1
0000000000000004        cvtss2sd        %xmm0,%xmm0
0000000000000008        mulsd           %xmm1,%xmm0
000000000000000c        pxor            %xmm1,%xmm1
0000000000000010        ucomisd         %xmm1,%xmm0
0000000000000014        jp              0x00000002
0000000000000016        je              0x00000008
0000000000000018        addsd           0x00000006(%rip),%xmm0
0000000000000020        cvtsd2ss        %xmm0,%xmm0
0000000000000024        ret

for a savings of 2 bytes.

This xform can happen when we recognize that jne and jp jump to the same "true"
MBB, the unconditional jump would jump to the "false" MBB, and the "true" branch
is the fall-through MBB.

llvm-svn: 97766
2010-03-05 00:24:26 +00:00
Dale Johannesen
b1fd546dd0 Fix some more places where dbg_value affected codegen.
llvm-svn: 97765
2010-03-05 00:02:59 +00:00
Devang Patel
79a4a71472 Add metadata example.
llvm-svn: 97764
2010-03-04 23:44:48 +00:00
Jeffrey Yasskin
5bdd4796e4 Stop leaking MDStrings.
llvm-svn: 97763
2010-03-04 23:24:19 +00:00
Johnny Chen
b6d35fd803 Drop the ".w" qualifier for t2UXTB16* instructions as there is no 16-bit version
of either sxtb16 or uxtb16, and the unified syntax does not specify ".w".

llvm-svn: 97760
2010-03-04 22:24:41 +00:00
Jeffrey Yasskin
e4e796c00b Fix memcheck-found leaks: one false positive from using new[], and one true
positive where pointers would be leaked on llvm_shutdown.

llvm-svn: 97759
2010-03-04 22:15:01 +00:00
Jim Grosbach
330c1b777e For SJLJ exception handling, make sure that all calls that are not marked
as nounwind are marked with a -1 call-site value. This is necessary to, for
example, correctly process exceptions thrown from within an "unexpected"
execption handler (see SingleSource/Regression/C++/EH/expection_spec_test.cpp).

llvm-svn: 97757
2010-03-04 22:07:46 +00:00
Bob Wilson
188e15d7a5 pr6478: The frame pointer spill frame index is only defined when there is a
frame pointer.

llvm-svn: 97755
2010-03-04 21:42:36 +00:00
Evan Cheng
9b35d553df Run machine licm before machine cse to avoid messing up licm opportunities.
llvm-svn: 97752
2010-03-04 21:28:09 +00:00
Evan Cheng
a9828532ff Avoid cse load instructions unless they are known to be invariant loads.
llvm-svn: 97747
2010-03-04 21:18:08 +00:00
Bob Wilson
73b96c00d2 pr6480: Don't try producing ld/st-multiple instructions when the address is
an undef value.  This is only going to come up for bugpoint-reduced tests --
correct programs will not access memory at undefined addresses -- so it's not
worth the effort of doing anything more aggressive.

llvm-svn: 97745
2010-03-04 21:04:38 +00:00
Erick Tryzelaar
4e7593750d Rewrite makefiles to explicitly reference DESTDIR to fix bug 3153.
We need this so can not bake DESTDIR into the O'Caml symlinks.

llvm-svn: 97743
2010-03-04 20:56:19 +00:00
Jakob Stoklund Olesen
3408cd6de1 Fix the remaining MUL8 and DIV8 to define AX instead of AL,AH.
These instructions technically define AL,AH, but a trick in X86ISelDAGToDAG
reads AX in order to avoid reading AH with a REX instruction.

Fix PR6489.

llvm-svn: 97742
2010-03-04 20:42:07 +00:00
Dan Gohman
265f85f6d8 Fix recognition of 16-bit bswap for C front-ends which emit the
clobber registers in a different order.

llvm-svn: 97741
2010-03-04 19:58:08 +00:00
Chris Lattner
27a8ee8574 not committing what you test = bad.
llvm-svn: 97740
2010-03-04 19:54:45 +00:00
Chris Lattner
dfd345bf39 make gep matching in fastisel match the base of the gep as a
register if it isn't possible to match the indexes *and* the base.
This fixes some fast isel rejects of load instructions on oggenc.

llvm-svn: 97739
2010-03-04 19:48:19 +00:00
Chris Lattner
860cbbb031 add a statistic for # times fastisel fails.
llvm-svn: 97738
2010-03-04 19:46:56 +00:00
Jeffrey Yasskin
d12b6277e8 Fix PR6360. It's easy for a stub's address to escape to user code, so we can't
just count references to it from JIT output to decide when to destroy it.  This
patch waits to destroy the JIT's memory of a stub until the Function it refers
to is destroyed.  External function stubs and GVIndirectSyms aren't destroyed
until the JIT itself is.

llvm-svn: 97737
2010-03-04 19:45:09 +00:00
Dan Gohman
632e2a2b8c Fix a typo Duncan noticed.
llvm-svn: 97735
2010-03-04 19:11:28 +00:00
Johnny Chen
1ee942da0d Added 32-bit Thumb instructions for Preload Data (PLD, PLDW) and Preload
Instruction (PLI) for disassembly only.

According to A8.6.120 PLI (immediate, literal), for example, different
instructions are generated for "pli [pc, #0]" and "pli [pc, #-0"].  The
disassembler solves it by mapping -0 (negative zero) to -1, -1 to -2, ..., etc.

llvm-svn: 97731
2010-03-04 17:40:44 +00:00
John McCall
45e11bf9a8 Simplify the condition-checking logic and hopefully clear up a build failure
that somehow got through my testing.

llvm-svn: 97728
2010-03-04 11:48:42 +00:00
John McCall
f762d454a4 Teach lit to honor conditional directives. The syntax is:
IF(condition(value)):
If the value satisfies the condition, the line is processed by lit;  otherwise
it is skipped.  A test with no unignored directives is resolved as Unsupported.

The test suite is responsible for defining conditions;  conditions are unary
functions over strings.  I've defined two conditions in the LLVM test suite,
TARGET (with values like those in TARGETS_TO_BUILD) and BINDING (with values
like those in llvm_bindings).  So for example you can write:
  IF(BINDING(ocaml)): RUN: %blah %s -o -
and the RUN line will only execute if LLVM was configured with the ocaml
bindings.

llvm-svn: 97726
2010-03-04 09:36:50 +00:00
Nick Lewycky
58ab63e179 Make the 'icmp pred trunc(ext(X)), CST --> icmp pred X, ext(trunc(CST))'
transformation much more careful. Truncating binary '01' to '1' sounds like it's
safe until you realize that it switched from positive to negative under a signed
interpretation, and that depends on the icmp predicate.

Also a few miscellaneous cleanups.

llvm-svn: 97721
2010-03-04 06:54:10 +00:00
Jeffrey Yasskin
14080c578d Fix PR5291, in which a SmallPtrSet iterator was held across an insertion into
the set.

llvm-svn: 97720
2010-03-04 06:50:01 +00:00
Evan Cheng
df8f4b6142 Rename -machine-cse to -enable-machine-cse.
llvm-svn: 97713
2010-03-04 02:08:04 +00:00
Chris Lattner
3d7dc22a7a add a comment.
llvm-svn: 97709
2010-03-04 01:43:43 +00:00
Chris Lattner
4f067261b6 so hey, it turns out that the histogram was completely wrong, because
we sometimes emit nodes multiple times to string buffers to size them.
Compute the histogram correctly.

llvm-svn: 97708
2010-03-04 01:34:29 +00:00
Evan Cheng
9120412740 Look ahead a bit to determine if a physical register def that is not marked dead is really alive. This is necessary to catch a lot of common cse opportunities for targets like x86.
llvm-svn: 97706
2010-03-04 01:33:55 +00:00
Chris Lattner
cf09c9dcef zap fixme.
llvm-svn: 97705
2010-03-04 01:26:00 +00:00
Chris Lattner
72df178091 now that complexpatterns are all emitted at the end of the match
sequence, just emit instruction predicates right before them.  This
exposes yet more factoring opportunitites, shrinking the X86 table 
to 79144 bytes.

llvm-svn: 97704
2010-03-04 01:25:36 +00:00
Chris Lattner
2bbca2de9e change the new isel matcher to emit ComplexPattern matches
as the very last thing before node emission.  This should
dramatically reduce the number of times we do 'MatchAddress'
on X86, speeding up compile time.  This also improves comments
in the tables and shrinks the table a bit, now down to 
80506 bytes for x86.

llvm-svn: 97703
2010-03-04 01:23:08 +00:00
Jeffrey Yasskin
15b3688e56 Make sure JITResolvers don't leave any stubs behind. When a JITResolver was
destroyed, it could leave stubs in the StubToResolverMap, which would confuse
the lookup for subsequent lazy compilations.

llvm-svn: 97698
2010-03-04 00:32:33 +00:00