1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

45357 Commits

Author SHA1 Message Date
Daniel Dunbar
2cdac55ad0 Add newlines at end of file (this can annoy gcov)
llvm-svn: 67000
2009-03-14 01:53:05 +00:00
Mon P Wang
1cd6172342 Avoid doing the transformation c ? 1.0 : 2.0 as load { 2.0, 1.0 } + c*4
if FPConstant is legal because if the FPConstant doesn't need to be stored
in a constant pool, the transformation is unlikely to be profitable.

llvm-svn: 66994
2009-03-14 00:25:19 +00:00
Dan Gohman
5c4cd59ce4 Add a few more ptrtoint/inttoptr cast tests.
llvm-svn: 66989
2009-03-13 23:54:51 +00:00
Dan Gohman
fa0a3504ba Improve FastISel's handling of truncates to i1, and implement
ptrtoint and inttoptr in X86FastISel. These casts aren't always
handled in the generic FastISel code because X86 sometimes needs
custom code to do truncation and zero-extension.

llvm-svn: 66988
2009-03-13 23:53:06 +00:00
Dale Johannesen
7c23238784 Fix -strip-debug-declare to work when there are
llvm.global.variable's but no llvm.declare's.

llvm-svn: 66977
2009-03-13 22:59:47 +00:00
Evan Cheng
cda58e565f Fix PR3784: If the source of a phi comes from a bb ended with an invoke, make sure the copy is inserted before the try range (unless it's used as an input to the invoke, then insert it after the last use), not at the end of the bb.
Also re-apply r66140 which was disabled as a workaround.

llvm-svn: 66976
2009-03-13 22:59:14 +00:00
Ted Kremenek
2b3f72d6d7 Add (hidden) TableGen command option '-clang-component' which specifies the
component's warnings to process for '-gen-clang-diags-defs'.

Also, when the component is specified, generate a '#if' prologue at the top of
the generated .def file (to match the current files).

llvm-svn: 66975
2009-03-13 22:53:41 +00:00
Ted Kremenek
bbde499c43 Add initial implementation of a TableGen backend for converting Clang-warnings
tablegen files to the original .def preprocessor include files. This is my first
TableGen backend; I don't claim that it is awesome.

llvm-svn: 66971
2009-03-13 22:21:17 +00:00
Ted Kremenek
68e7aca3cb Further constify Record::isSubClassOf.
llvm-svn: 66970
2009-03-13 22:20:10 +00:00
Devang Patel
064fa065a4 Fix test case. Now, llvm-gcc emits debug info for artificiaal variable _comp_ctor.
llvm-svn: 66963
2009-03-13 21:57:16 +00:00
Stuart Hastings
4ee393a21a Fix a hashing bug in APInt. A certain pathological testcase (too
large for the testsuite) took over six minutes to compile on my Mac.
The patched LLVM-GCC compiles that testcase in three seconds (GCC
takes less than one second).  This hash function is more complex
(about 35 instructions on x86) than what Chris wanted, but I expect it
will be well-behaved with arbitrary inputs.

Thank you to everyone who responded to my previous request for advice.

llvm-svn: 66962
2009-03-13 21:51:13 +00:00
Chris Lattner
e4db3f1556 Fix escaping in asm string literals correctly by having tblgen unescape
them, then the asmprinter emitter reescape them.

llvm-svn: 66958
2009-03-13 21:33:17 +00:00
Chris Lattner
8b349828db add a horrible hack to fix the build.
llvm-svn: 66957
2009-03-13 21:23:43 +00:00
Bill Wendling
96e37540a0 Revert r66920. It was causing failures in the self-hosting buildbot (in release
mode).

Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes > /dev/null
0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4   bugpoint          0x00021d1c main + 92
5   bugpoint          0x00002106 start + 54
6   bugpoint          0x00000004 start + 18446744073709543220
Stack dump:
0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes 

FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes
0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4   bugpoint          0x00021d1c main + 92
5   bugpoint          0x00002106 start + 54
6   bugpoint          0x00000006 start + 18446744073709543222
Stack dump:
0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes 

FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll  -bugpoint-crashcalls -silence-passes
0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4   bugpoint          0x00021d1c main + 92
5   bugpoint          0x00002106 start + 54
Stack dump:
0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes 

--- Reverse-merging (from foreign repository) r66920 into '.':
U    include/llvm/Support/CallSite.h
U    include/llvm/Instructions.h
U    lib/Analysis/IPA/GlobalsModRef.cpp
U    lib/Analysis/IPA/Andersens.cpp
U    lib/Bitcode/Writer/BitcodeWriter.cpp
U    lib/VMCore/Instructions.cpp
U    lib/VMCore/Verifier.cpp
U    lib/VMCore/AsmWriter.cpp
U    lib/Transforms/Utils/LowerInvoke.cpp
U    lib/Transforms/Scalar/SimplifyCFGPass.cpp
U    lib/Transforms/IPO/PruneEH.cpp
U    lib/Transforms/IPO/DeadArgumentElimination.cpp

llvm-svn: 66953
2009-03-13 21:15:59 +00:00
Chris Lattner
ec4303f889 add support for a few simple escape characters in tblgen strings.
llvm-svn: 66949
2009-03-13 21:03:27 +00:00
Daniel Dunbar
5c982814cf Add ENABLE_COVERAGE, for building a +Coverage (gcov) configuration.
- Required some extra makefile tweaks to introduce a new flag var
   which only goes to compile/link tools but not the relink step,
   otherwise we get a copy of libgcov in the relinked .o files.

 - No configure magic for this.

llvm-svn: 66945
2009-03-13 20:59:41 +00:00
Dan Gohman
790659c0d6 Fix FastISel's assumption that i1 values are always zero-extended
by inserting explicit zero extensions where necessary. Included
is a testcase where SelectionDAG produces a virtual register
holding an i1 value which FastISel previously mistakenly assumed
to be zero-extended.

llvm-svn: 66941
2009-03-13 20:42:20 +00:00
Chris Lattner
120540fec6 remove a test that depends on -debug.
llvm-svn: 66937
2009-03-13 20:31:48 +00:00
Chris Lattner
0a0fa539da remove a testcase that depends on -debug existing.
llvm-svn: 66936
2009-03-13 20:31:25 +00:00
Rafael Espindola
aadb9af093 add 8 and 16 bit TLS moves.
add a fixme note on how to remove code duplication.

llvm-svn: 66932
2009-03-13 19:39:55 +00:00
Dale Johannesen
a4bb3e6d14 One more place where debug info affects codegen.
llvm-svn: 66930
2009-03-13 19:23:20 +00:00
Devang Patel
fff3cffbba Test case for rev. 66925
llvm-svn: 66927
2009-03-13 18:50:51 +00:00
Rafael Espindola
ff17d02271 Improve sext and zext of TLS variables.
llvm-svn: 66922
2009-03-13 18:37:06 +00:00
Gabor Greif
6a76677e1b Second installment of "BasicBlock operands to the back"
changes.

For InvokeInst now all arguments begin at op_begin().
The Callee, Cont and Fail are now faster to get by
access relative to op_end().

This patch introduces some temporary uglyness in CallSite.
Next I'll bring CallInst up to a similar scheme and then
the uglyness will magically vanish.

This patch also exposes all the reliance of the libraries
on InvokeInst's operand ordering. I am thinking of taking
care of that too.

llvm-svn: 66920
2009-03-13 18:27:29 +00:00
Chris Lattner
5972bc6234 remove a buggy test, it is not ok to use -debug in RUN line.
llvm-svn: 66918
2009-03-13 18:19:34 +00:00
Chris Lattner
63569fa327 generalize this code so that fast isel handles integer truncates to i1, which
codegen to the same thing as integer truncates to i8 (the top bits are 
just undefined).  This implements rdar://6667338

llvm-svn: 66902
2009-03-13 16:36:42 +00:00
Chris Lattner
7af521bd0c add a new TGError class and use it to propagate location info with
errors when thrown.  This gets us nice errors like this from tblgen:

CMOVL32rr: 	(set GR32:i32:$dst, (X86cmov GR32:$src1, GR32:$src2))
/Users/sabre/llvm/Debug/bin/tblgen: error:
Included from X86.td:116:
Parsing X86InstrInfo.td:922: In CMOVL32rr: X86cmov node requires exactly 4 operands!
def CMOVL32rr : I<0x4C, MRMSrcReg,       // if <s, GR32 = GR32
^

instead of just:

CMOVL32rr: 	(set GR32:i32:$dst, (X86cmov GR32:$src1, GR32:$src2))
/Users/sabre/llvm/Debug/bin/tblgen: In CMOVL32rr: X86cmov node requires exactly 4 operands!

This is all I plan to do with this, but it should be easy enough to improve if anyone 
cares (e.g. keeping more loc info in "dag" expr records in tblgen.

llvm-svn: 66898
2009-03-13 16:25:21 +00:00
Chris Lattner
11707a5c89 give each Record a location.
llvm-svn: 66897
2009-03-13 16:09:24 +00:00
Chris Lattner
07709d8b69 make "locations" a class instead of a typedef.
llvm-svn: 66895
2009-03-13 16:01:53 +00:00
Duncan Sands
6acf707101 Update these for the 2.5 release.
llvm-svn: 66890
2009-03-13 13:42:20 +00:00
Bill Wendling
2fe64f48aa These instructions have special lowering that may lower them to SSE
instructions. Prevent that if we don't want implicit uses of SSE.

llvm-svn: 66877
2009-03-13 08:41:47 +00:00
Argyrios Kyrtzidis
b277b8187d Unbreak build, bring in std::string for GCC 4.3
llvm-svn: 66876
2009-03-13 08:12:13 +00:00
Evan Cheng
f9951d1557 Fix some significant problems with constant pools that resulted in unnecessary paddings between constant pool entries, larger than necessary alignments (e.g. 8 byte alignment for .literal4 sections), and potentially other issues.
1. ConstantPoolSDNode alignment field is log2 value of the alignment requirement. This is not consistent with other SDNode variants.
2. MachineConstantPool alignment field is also a log2 value.
3. However, some places are creating ConstantPoolSDNode with alignment value rather than log2 values. This creates entries with artificially large alignments, e.g. 256 for SSE vector values.
4. Constant pool entry offsets are computed when they are created. However, asm printer group them by sections. That means the offsets are no longer valid. However, asm printer uses them to determine size of padding between entries.
5. Asm printer uses expensive data structure multimap to track constant pool entries by sections.
6. Asm printer iterate over SmallPtrSet when it's emitting constant pool entries. This is non-deterministic.


Solutions:
1. ConstantPoolSDNode alignment field is changed to keep non-log2 value.
2. MachineConstantPool alignment field is also changed to keep non-log2 value.
3. Functions that create ConstantPool nodes are passing in non-log2 alignments.
4. MachineConstantPoolEntry no longer keeps an offset field. It's replaced with an alignment field. Offsets are not computed when constant pool entries are created. They are computed on the fly in asm printer and JIT.
5. Asm printer uses cheaper data structure to group constant pool entries.
6. Asm printer compute entry offsets after grouping is done.
7. Change JIT code to compute entry offsets on the fly.

llvm-svn: 66875
2009-03-13 07:51:59 +00:00
Evan Cheng
a7e21323da Unbreak build.
llvm-svn: 66874
2009-03-13 07:41:30 +00:00
Chris Lattner
2f68f87510 split buffer management and diagnostic printing out of the tblgen
lexer into its own TGSourceMgr class.

llvm-svn: 66873
2009-03-13 07:05:43 +00:00
Owen Anderson
dd7e4f8c43 Convert VirtRegMap to a MachineFunctionPass.
llvm-svn: 66870
2009-03-13 05:55:11 +00:00
Chris Lattner
cbbdd230dd generalize the previous code to use the full generality of LEA
for i32/i64 expressions (we could also do i16 on cpus where
i16 lea is fast, but I didn't add this).  On the example, we now
generate:

_test:
	movl	4(%esp), %eax
	cmpl	$42, (%eax)
	setl	%al
	movzbl	%al, %eax
	leal	4(%eax,%eax,8), %eax
	ret

instead of:

_test:
	movl	4(%esp), %eax
	cmpl	$41, (%eax)
	movl	$4, %ecx
	movl	$13, %eax
	cmovg	%ecx, %eax
	ret

llvm-svn: 66869
2009-03-13 05:53:31 +00:00
Chris Lattner
878d951f8f optimize the case of cond ? 42 : 41 and friends. This compiles the
example to:

_test:
	movl	4(%esp), %eax
	cmpl	$41, (%eax)
	setg	%al
	movzbl	%al, %eax
	orl	$4294967294, %eax
	ret

instead of:

        movl    4(%esp), %eax
        cmpl    $41, (%eax)
	movl	$4294967294, %ecx
	movl	$4294967295, %eax
	cmova	%ecx, %eax
	ret

which is smaller in code size and faster. rdar://6668608

llvm-svn: 66868
2009-03-13 05:22:11 +00:00
Bill Wendling
5499163a0a Oops...I committed too much.
llvm-svn: 66867
2009-03-13 04:39:26 +00:00
Bill Wendling
02a239b837 Temporarily XFAIL this test.
llvm-svn: 66866
2009-03-13 04:37:11 +00:00
Dan Gohman
37d843c129 Enhance address-mode folding of ISD::ADD to handle cases where the
operands can't both be fully folded at the same time. For example,
in the included testcase, a global variable is being added with
an add of two values. The global variable wants RIP-relative
addressing, so it can't share the address with another base
register, but it's still possible to fold the initial add.

llvm-svn: 66865
2009-03-13 02:25:09 +00:00
Dale Johannesen
3edb15a6c7 Fix one more place where debug info affected
codegen (speculative execution).

llvm-svn: 66859
2009-03-13 01:05:24 +00:00
Chris Lattner
6f7628bd8e just initialize the first element, we don't need to set the rest to zeros.
llvm-svn: 66850
2009-03-13 00:24:01 +00:00
Chris Lattner
99b48e57ba Eliminate a 9640 byte static mutable initialized data item by moving it
to the stack.  This shrinks all llvm tools by 9k, and improves reentrancy.

llvm-svn: 66847
2009-03-13 00:03:51 +00:00
Chris Lattner
f835ec9a9d static functions don't need an anonymous namespace.
llvm-svn: 66845
2009-03-12 23:59:55 +00:00
Dan Gohman
71245ea439 Fix a typo in a comment.
llvm-svn: 66843
2009-03-12 23:55:10 +00:00
Dale Johannesen
67278f57e8 Previous debug info fix to this code wasn't quite
right; did the wrong thing when there are exactly 11
non-debug instructions, followed by debug info.
Remove a FIXME since it's apparently been fixed along the way.

llvm-svn: 66840
2009-03-12 23:18:09 +00:00
Gabor Greif
14f7758af5 cosmetic change, in preparation of future change
llvm-svn: 66839
2009-03-12 23:13:03 +00:00
Evan Cheng
27be5272b4 Add this test back.
llvm-svn: 66838
2009-03-12 23:01:35 +00:00
Daniel Dunbar
0401add555 raw_ostream: unbuffered streams weren't being immediately flushed on
single character writes.

llvm-svn: 66827
2009-03-12 22:02:44 +00:00