Commit Graph

28747 Commits

Author SHA1 Message Date
Devang Patel
5c06f61e57 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72970 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 23:08:56 +00:00
Dan Gohman
2392efef1b Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 23:05:51 +00:00
Devang Patel
da634298fc Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72965 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 22:39:21 +00:00
Devang Patel
578efa920a Add new function attribute - noimplicitfloat
Update code generator to use this attribute and remove NoImplicitFloat target option.
Update llc to set this attribute when -no-implicit-float command line option is used.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 21:57:13 +00:00
Nate Begeman
abc0199680 Adapt the x86 build_vector dagcombine to the current state of the legalizer.
build vectors with i64 elements will only appear on 32b x86 before legalize.
Since vector widening occurs during legalize, and produces i64 build_vector 
elements, the dag combiner is never run on these before legalize splits them
into 32b elements.

Teach the build_vector dag combine in x86 back end to recognize consecutive 
loads producing the low part of the vector.

Convert the two uses of TLI's consecutive load recognizer to pass LoadSDNodes
since that was required implicitly.

Add a testcase for the transform.

Old:
	subl	$28, %esp
	movl	32(%esp), %eax
	movl	4(%eax), %ecx
	movl	%ecx, 4(%esp)
	movl	(%eax), %eax
	movl	%eax, (%esp)
	movaps	(%esp), %xmm0
	pmovzxwd	%xmm0, %xmm0
	movl	36(%esp), %eax
	movaps	%xmm0, (%eax)
	addl	$28, %esp
	ret

New:
	movl	4(%esp), %eax
	pmovzxwd	(%eax), %xmm0
	movl	8(%esp), %eax
	movaps	%xmm0, (%eax)
	ret




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 21:37:30 +00:00
Evan Cheng
925492279a Changing allocation ordering from r3 ... r0 back to r0 ... r3. The order change no longer make sense after the coalescing changes we have made since then.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 19:08:58 +00:00
Devang Patel
6a784894b1 Evan thinks NoImplicitFloat check is not required here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72954 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 18:48:29 +00:00
Dan Gohman
f38fd690ad Fix a copy+pasto in an assertion string that Jay Foad noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 18:34:16 +00:00
Evan Cheng
87d59e49e9 When merging multiple load / store instructions. Use the DebugLoc of the first one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72952 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 18:19:23 +00:00
Evan Cheng
5ba71887f9 Code clean up: return vector by reference rather than by value. No functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 17:56:14 +00:00
Dan Gohman
1d09de3eca Move SCEVExpander::getOrInsertCanonicalInductionVariable out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72949 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 16:35:53 +00:00
Dan Gohman
c965ee223c Remove some unnecessary #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 16:32:58 +00:00
Dan Gohman
11cc35de41 Update the Verifier to be aware of the difference between Add and FAdd, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 16:10:00 +00:00
Sanjiv Gupta
4680077959 Lower i16/i32 sdiv/udiv/srem/urem using libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72942 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 14:43:12 +00:00
Sanjiv Gupta
a43a7aefd7 Allow libcalls for i16 sdiv/udiv/rem operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72941 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 14:41:10 +00:00
Bruno Cardoso Lopes
5d41910396 ELF Code Emitter now uses CurBufferPtr, BufferBegin and BufferEnd, as do JIT and
MachO Writer. This will change with the arrival of ObjectCodeEmitter and
BinaryObject


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72906 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 00:22:10 +00:00
Dan Gohman
9f5f322a03 Fix an erroneous check for isFNeg; the FNeg case is handled
a few lines later on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 23:43:29 +00:00
Bill Wendling
e075a62746 The DWARF unwind info was incorrect. While compiling with
`-fomit-frame-pointer', we would lack the DW_CFA_advance_loc information for a
lot of function, and then they would be `0'. The linker (at least on Darwin)
needs to encode the stack size. In some cases, the stack size is too large to
directly encode. So the linker checks to see if there is a "subl $xxx,%esp"
instruction at the point where the `DW_CFA_def_cfa_offset' says the pc was. If
so, the compact encoding records the offset in the function to where the stack
size is embedded. But because the `DW_CFA_advance_loc' instructions are missing,
it looks before the function and dies.

So, instead of emitting the EH debug label before the stack adjustment
operations, emit it afterwards, right before the frame move stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72898 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 22:52:30 +00:00
Dan Gohman
ae3a0be92e Split the Add, Sub, and Mul instruction opcodes into separate
integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.

For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.

This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 22:49:04 +00:00
Devang Patel
d18e31ae17 Add new function attribute - noredzone.
Update code generator to use this attribute and remove DisableRedZone target option.
Update llc to set this attribute when -disable-red-zone command line option is used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 22:05:33 +00:00
Dale Johannesen
4c9369df57 Fix FP_TO_UINT->i32 on ppc32 -mcpu=g5. This was
using Promote which won't work because i64 isn't
a legal type.  It's easy enough to use Custom, but
then we have the problem that when the type
legalizer is promoting FP_TO_UINT->i16, it has no
way of telling it should prefer FP_TO_SINT->i32
to FP_TO_UINT->i32.  I have uncomfortably hacked
this by making the type legalizer choose FP_TO_SINT
when both are Custom.
This fixes several regressions in the testsuite.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72891 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 20:53:52 +00:00
Evan Cheng
073e7e5807 RALinScan::attemptTrivialCoalescing() was returning a virtual register instead of the physical register it is allocated to. This resulted in virtual register(s) being added the live-in sets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72890 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 20:53:36 +00:00
Evan Cheng
550aacb978 A value defined by an implicit_def can be liven to a use BB. This is unfortunate. But register allocator still has to add it to the live-in set of the use BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 20:28:22 +00:00
Lang Hames
ac2764040f Removed SimpleRewriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72880 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 18:45:36 +00:00
Dan Gohman
77b81fe487 Don't do the X * 0.0 -> 0.0 transformation in instcombine, because
instcombine doesn't know when it's safe. To partially compensate
for this, introduce new code to do this transformation in
dagcombine, which can use UnsafeFPMath.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72872 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 17:12:12 +00:00
Dan Gohman
68f32cbb1f Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72870 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 16:49:15 +00:00
Sanjiv Gupta
82f1d1b572 Remove unused code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72866 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 15:16:24 +00:00
Sanjiv Gupta
3b0a4f186b Custom lower SUB with two register operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 08:52:28 +00:00
Torok Edwin
6c8db34165 Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72858 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 08:18:25 +00:00
Torok Edwin
e8ebb0fe1b Add support for outputting ANSI colors to raw_fd_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72854 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 07:09:50 +00:00
Eli Friedman
bccf4b3050 PR3739, part 2: Use an explicit store to spill XMM registers. (Previously,
the code tried to use "push", which doesn't exist for XMM registers.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72836 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 02:32:04 +00:00
Eli Friedman
9a41712122 PR3739, part 1: Disable the red zone on Win64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 02:02:01 +00:00
Dan Gohman
e5eb6d2fdb Remove a #include of <iostream>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 01:59:35 +00:00
Evan Cheng
1488326156 Re-apply 72756 with fixes. One of those was introduced by we changed MachineInstrBuilder::addReg() interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72826 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 01:15:28 +00:00
Lang Hames
fcad172006 Removed more testing code that snuck in earlier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 01:04:22 +00:00
Bruno Cardoso Lopes
186c670e15 Use uint8_t and int32_t in {JIT,Machine}CodeEmiters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72821 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 00:15:51 +00:00
Stuart Hastings
d58902a19b Evan says it's wrong; back out 72808.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72817 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 22:59:34 +00:00
Stuart Hastings
77648cfd75 Recognize another euphemism for MOVDQ2Q.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72808 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 21:39:14 +00:00
Evan Cheng
424f8f339a For Darwin / x86_64, override -relocation-model=static to pic if the output is assembly since Darwin assembler does not really support -static codeine.
I view this as a temporary workaround until the assembler / linker changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72806 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 21:13:54 +00:00
Dan Gohman
9911405183 Convert Alpha and Mips to use a MachineFunctionInfo subclass to
carry GlobalBaseReg, and GlobalRetAddr too in Alpha's case. This
eliminates the need for them to search through the
MachineRegisterInfo livein list in order to identify these
virtual registers. EmitLiveInCopies is now the only user of the
virtual register portion of MachineRegisterInfo's livein data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 20:30:14 +00:00
Dan Gohman
c553462c29 Remove the redundant TM member from X86DAGToDAGISel; replace it
with an accessor method which simply casts the parent class
SelectionDAGISel's TM to the target-specific type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72801 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 20:20:00 +00:00
Dan Gohman
68c9344056 Don't attempt to simplify an non-affine IV expression if it can't
be simplified to a loop-invariant value. This fixes PR4315.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 19:11:31 +00:00
Mike Stump
222858256f Make the buildbot see green (to make it easier to spot the next person
that puts a new warning in).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 19:07:46 +00:00
Bruno Cardoso Lopes
4cb31436bd Move ELFCodeEmiter stuff to new files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72785 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 17:47:27 +00:00
Bruno Cardoso Lopes
bae049cd9e Revert 72650
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72783 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 16:55:02 +00:00
Dan Gohman
974d90bb70 Remove unnecessary #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72782 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 16:47:12 +00:00
Sanjiv Gupta
3fc7e532aa Emit file directives correctly in case of a .bc is generated by llvm-ld after linking in several .bc files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72781 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 16:27:49 +00:00
Sanjiv Gupta
892c8caa3c FrameIndex could be used as a value (addressof (arg)) or as an address.
Expand it exactly like GlobalAddress.
Fix some more crashes (InsertBranch() not being implemented) for compiling hitec libs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72776 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 15:31:12 +00:00
Oscar Fuentes
030019f113 CMake: Added missing source file to lib/CodeGen/CMakeLists.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 15:29:09 +00:00
Sanjiv Gupta
703e235f0c Fixed a bug in which signed comparisons were being used instead of unsigned comparisons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72771 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-03 13:36:44 +00:00