Commit Graph

24263 Commits

Author SHA1 Message Date
Owen Anderson
b12ab97bbd Reduce the entries in a phi before testing it for deadness, because removing the entries might make it dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54535 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 18:00:05 +00:00
Evan Cheng
42ccc21ce7 Undo most of r54519.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54534 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 17:56:50 +00:00
Chris Lattner
0dabb7e8f3 Don't call getAnalysisUsage unless -debug-pass is enabled. This speeds
up the passmgr by avoiding useless work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54528 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 15:14:09 +00:00
Evan Cheng
502f20b17e Add new parameter Fast to createJIT to enable the fast codegen path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54523 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 08:11:34 +00:00
Evan Cheng
381cb07544 Add skeleton of simple basic block instruction selector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54522 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 07:27:28 +00:00
Evan Cheng
711b6dce24 It's not legal to output a GV in a coalesced section if it's used in an ARM PIC relative constantpool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54519 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 06:56:16 +00:00
Evan Cheng
15621a2569 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54518 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 06:43:59 +00:00
Nick Lewycky
d6227385fc Don't crash printing the asm for a ConstantExpr PtrToInt just because the int
is narrower than the pointer. This testcase emits:

  .byte (((17) - 16) & 255)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54517 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 06:34:07 +00:00
Bruno Cardoso Lopes
65ad452536 Support added for ctlz intrinsic, test case added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54516 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 06:16:31 +00:00
Chris Lattner
fc65d38085 Speed up the passmgr by avoiding heap thrashing on vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54515 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 05:33:04 +00:00
Bruno Cardoso Lopes
f131fa26e6 Match raw "psp" triple target, as done by the homebrew toolchain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54514 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 04:49:42 +00:00
Bruno Cardoso Lopes
7da151cd5d Added Mips support for DYNAMIC_STACKALLOC
Fixed bug in adjustMipsStackFrame, which was breaking
while trying to access a dead stack object index. Also added
one more alignment before fixing the callee saved registers
stack offset adjustment.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54485 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 19:08:11 +00:00
Bruno Cardoso Lopes
e36bfe678d Add the remaining fp_round libcalls:
FPROUND_F80_F32, FPROUND_PPCF128_F32, 
FPROUND_F80_F64, FPROUND_PPCF128_F64

Support for soften float fp_round operands is added, Mips 
needs this to round f64->f32.

Also added support to soften float FABS result, Mips doesn't 
support double fabs results while in 'single float only' mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54484 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 19:01:24 +00:00
Owen Anderson
724acf1c52 Do a dominator walk when scheduling copies, rather than a DFS on the CFG. Also, fix a few problems when creating
live intervals for temporaries created by phi elimination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54483 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 18:28:07 +00:00
Matthijs Kooijman
7d942001fa Let SRETPromotion properly preserve the function name instead of (implicitly)
postfixing it with a number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 16:01:23 +00:00
Matthijs Kooijman
a7bab2c81c Fix SRETPromotion, it was generating functions without returns statements since
r53941 (but this was not noticed due to the lack of a basic test for
SRETPromotion). 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54467 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 15:58:09 +00:00
Matthijs Kooijman
81ec2486b3 Add some debug output to SRETPromotion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54464 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 15:14:04 +00:00
Anton Korobeynikov
6a35daed6f Remove dead forward decl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:55:25 +00:00
Anton Korobeynikov
feac94b18d Print section flags ok on platforms, which use '@' as comment string. Fix test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54460 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:55:06 +00:00
Anton Korobeynikov
1e27da3e6c Add assertion for easy debugging of missing stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54459 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:54:40 +00:00
Anton Korobeynikov
0f3cc65738 Switch ARM to new section handling stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54458 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:54:23 +00:00
Anton Korobeynikov
79579c911f Switch Alpha to new section handling stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54457 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:53:57 +00:00
Anton Korobeynikov
fcd99bb428 Use EmitAlignment consistently
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54456 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:53:38 +00:00
Anton Korobeynikov
2a166e9739 Cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54455 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:53:13 +00:00
Anton Korobeynikov
98a6dd0cf5 Cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54454 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:52:54 +00:00
Anton Korobeynikov
dc3ca2ec3c Switch IA64 to new section-handling stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54453 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:52:35 +00:00
Anton Korobeynikov
003bcab8f3 Cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54452 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:52:13 +00:00
Anton Korobeynikov
4578862dcc Provide convenient helpers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54451 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:51:54 +00:00
Anton Korobeynikov
5b794b98ce Switch Sparc to new section handling stuff. Refactor printing of module-level GVs significantly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54450 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:51:25 +00:00
Anton Korobeynikov
84e160e265 Add hook for constant pool section selection for darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54449 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:51:02 +00:00
Anton Korobeynikov
93cacf131d Select section for constant pool entries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54448 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:50:34 +00:00
Chris Lattner
e2c5ecd46a Don't verify passes when assertions are disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54446 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 07:34:50 +00:00
Dan Gohman
e3d920699c Re-enable elimination of unnecessary SUBREG_TO_REG instructions in
LowerSubregs, and fix an x86-64 isel bug that this exposed.

SUBREG_TO_REG for x86-64 implicit zero extension is only safe for
isel to generate when the source is known to always have zeros in
the high 32 bits. The EXTRACT_SUBREG instruction does not clear
the high 32 bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54444 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 02:54:50 +00:00
Dale Johannesen
dd947ea3c5 Rewrite JIT handling of GlobalVariables so they
are allocated in the same buffer as the code,
jump tables, etc.

The default JIT memory manager does not handle buffer
overflow well.  I didn't introduce this and I'm not
attempting to fix it here, but it is more likely to
be hit now since we're putting more stuff in the
buffer.  This affects one test that I know of so far,
MultiSource/Benchmarks/NPB-serial/is.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54442 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 01:30:15 +00:00
Evan Cheng
39fd6e81b1 Factor code that finalize PHI nodes, jump tables, etc. out of SelectBasicBlock. No functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54438 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 00:43:25 +00:00
Owen Anderson
9200e81a18 SDISel's constant branch folding can fold away self-loops, which doesn't result in any dead blocks, but
rather an incorrect phi input.  Add code to UnreachableMachineBlockElim to get rid of these entries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54432 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 23:16:52 +00:00
Owen Anderson
883771f86a Correct handle cases where two phis are coalesced together, and correct break up the case where two different
phis want to coalesce with the same vreg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54426 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 22:08:58 +00:00
Owen Anderson
aa111080df Oops, didn't mean to commit this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54425 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 20:58:38 +00:00
Owen Anderson
9860b71b6a We don't need to try to coalesce input vregs that are the same as the output vreg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54422 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 20:29:20 +00:00
Owen Anderson
9b49120408 Only trim a live interval if the register is not used after the PHI node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54421 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 18:36:17 +00:00
Owen Anderson
788d04152a Only remap each VNInfo once when doing renumbering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54420 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 18:35:45 +00:00
Dan Gohman
8a1510d192 Re-introduce the 8-bit subreg zext-inreg patterns for x86-32,
this time using MOV32to32_ and MOV16to16_. Thanks to Evan for
suggesting this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54418 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 18:27:21 +00:00
Dan Gohman
4ce9627e97 Fix a shufflevector instcombine that was emitting invalid masks indices
when it meant to be emitting undef indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54417 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 18:17:32 +00:00
Evan Cheng
f5e25f32c7 Fix PR2355: bug in ChangeCompareStride. When the loop termination compare is the only use of its iv stride, the stride can be eliminated by moving it to another stride. If the scale is negative, swap the predicate instead of using a inverse predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54415 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 18:04:43 +00:00
Dan Gohman
165660e417 xchg does not modify FLAGS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54411 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 15:52:50 +00:00
Chris Lattner
46bbad217b optimize a common idiom generated by clang for bitfield access, PR2638.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54408 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 07:35:52 +00:00
Bruno Cardoso Lopes
bbe51362d5 Added support for fp callee saved registers.
Added fp register clobbering during calls.
Added AsmPrinter support for "fmask", a bitmask that indicates where on the 
stack the fp callee saved registers are.

Fixed the stack frame layout for Mips, now the callee saved regs 
are in the right stack location (a little documentation about how this
stack frame must look like is present in MipsRegisterInfo.cpp).
This was done using the method MipsRegisterInfo::adjustMipsStackFrame
To be more clear, these are examples of what is solves :  

1) FP and RA are also callee saved, and despite they aren't in CSI they 
   must be saved before the fp callee saved registers. 
2) The ABI requires that local varibles are allocated before the callee 
   saved register area, the opposite behavior from the default allocation.
3) CPU and FPU saved register area must be aligned independent of each
   other.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54403 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 06:14:43 +00:00
Chris Lattner
5af5f463e1 Zap sitofp/fptoui pairs. In all cases when the sign difference
matters, the result is undefined anyway.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54396 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 05:13:06 +00:00
Nick Lewycky
b30591ec64 Reinstate this optimization, but without the miscompile. Thanks to Bill for
tracking down that this was breaking llvm-gcc bootstrap on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54394 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-06 04:54:03 +00:00
Dan Gohman
1eac4e0844 Use strcpy instead of sprintf here. This avoids a GCC 4.3 format-string
warning. There wasn't actually a problem here, because the contents of
the string are known.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54385 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 23:36:35 +00:00