1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 14:33:02 +02:00
Commit Graph

8742 Commits

Author SHA1 Message Date
Anton Korobeynikov
61a8f92b2c Use EmitAlignment consistently
llvm-svn: 54456
2008-08-07 09:53:38 +00:00
Anton Korobeynikov
a7b288b4d8 Cleanup
llvm-svn: 54455
2008-08-07 09:53:13 +00:00
Anton Korobeynikov
bb99d4b900 Cleanup
llvm-svn: 54454
2008-08-07 09:52:54 +00:00
Anton Korobeynikov
2755fabf07 Switch IA64 to new section-handling stuff
llvm-svn: 54453
2008-08-07 09:52:35 +00:00
Anton Korobeynikov
9d8232ec1d Cleanup
llvm-svn: 54452
2008-08-07 09:52:13 +00:00
Anton Korobeynikov
d3009663dd Provide convenient helpers
llvm-svn: 54451
2008-08-07 09:51:54 +00:00
Anton Korobeynikov
912a2a8114 Switch Sparc to new section handling stuff. Refactor printing of module-level GVs significantly.
llvm-svn: 54450
2008-08-07 09:51:25 +00:00
Anton Korobeynikov
ebd773939c Add hook for constant pool section selection for darwin.
llvm-svn: 54449
2008-08-07 09:51:02 +00:00
Anton Korobeynikov
d37daa2aeb Select section for constant pool entries
llvm-svn: 54448
2008-08-07 09:50:34 +00:00
Dan Gohman
74fa421281 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.

llvm-svn: 54444
2008-08-07 02:54:50 +00:00
Dan Gohman
cc784f1662 Re-introduce the 8-bit subreg zext-inreg patterns for x86-32,
this time using MOV32to32_ and MOV16to16_. Thanks to Evan for
suggesting this.

llvm-svn: 54418
2008-08-06 18:27:21 +00:00
Dan Gohman
99d70043f9 xchg does not modify FLAGS.
llvm-svn: 54411
2008-08-06 15:52:50 +00:00
Bruno Cardoso Lopes
fa0a8e3e2b 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.

llvm-svn: 54403
2008-08-06 06:14:43 +00:00
Evan Cheng
f4d1119fbd Fix PR2620: Fix X86cmppd selection code so it expects operands to be v2f64.
llvm-svn: 54376
2008-08-05 22:19:15 +00:00
Dan Gohman
1238bf634b Trim #includes.
llvm-svn: 54350
2008-08-05 15:32:23 +00:00
Owen Anderson
32ae9380f1 This option doesn't need to be a target option. It can be in SDISel instead.
llvm-svn: 54336
2008-08-05 00:27:28 +00:00
Owen Anderson
84fbc312d4 - Fix SelectionDAG to generate correct CFGs.
- Add a basic machine-level dead block eliminator.

These two have to go together, since many other parts of the code generator are unable to handle the unreachable blocks otherwise created.

llvm-svn: 54333
2008-08-04 23:54:43 +00:00
Dan Gohman
5d0df78ae0 Add an assert to catch invalid VECTOR_SHUFFLE mask indices.
llvm-svn: 54329
2008-08-04 23:09:15 +00:00
Bruno Cardoso Lopes
34f2582096 Mips ISelLowering cleanup : Removed old LowerCALL and FORMAL_ARGS helpers, they
aren't used anyway, they also used to broke compiling when fastcc was specified for a
function, but not anymore.

llvm-svn: 54316
2008-08-04 07:12:52 +00:00
Bruno Cardoso Lopes
463f306553 Handle i32->f32 bitconvert results.
llvm-svn: 54315
2008-08-04 06:44:31 +00:00
Andrew Lenharth
377c046675 Add atomic sub for other sizes
llvm-svn: 54314
2008-08-03 20:17:34 +00:00
Chris Lattner
9aaf1f7650 Emit saveri with the correct operand order, patch by Richard Pennington!
llvm-svn: 54313
2008-08-03 18:16:14 +00:00
Bruno Cardoso Lopes
e9f5a77b11 Fix PR2615
llvm-svn: 54312
2008-08-03 15:37:43 +00:00
Bruno Cardoso Lopes
b13d663126 Improved asm inline for hi,lo results
Added hi,lo registers to be used,def implicitly. This provides better handle of
instructions which use hi/lo.
Fixes a small BranchAnalysis bug

llvm-svn: 54274
2008-08-02 19:42:36 +00:00
Bruno Cardoso Lopes
402c28e400 Apply the same pattern used in 'and' lowering for 'or'
llvm-svn: 54273
2008-08-02 19:37:33 +00:00
Bruno Cardoso Lopes
9cb1f636b4 Expand fcopysign
llvm-svn: 54250
2008-07-31 18:50:54 +00:00
Bruno Cardoso Lopes
01c39058e8 Handle more SELECT corner cases considering legalize types, probabily wont work with
the default legalizer.

llvm-svn: 54249
2008-07-31 18:31:28 +00:00
Dale Johannesen
f669e7c14f Add a flag to disable jump table generation (all
switches use the binary search algorithm) for
environments that don't support it.  PPC64 JIT
is such an environment; turn the flag on for that.

llvm-svn: 54248
2008-07-31 18:13:12 +00:00
Bruno Cardoso Lopes
9181910033 Added pattern for floating point zero immediate (avoiding a constant pool
access).
Added pattern to match bitconvert node.
Fixed MTC1 asm string bug.

llvm-svn: 54229
2008-07-30 19:00:31 +00:00
Dan Gohman
efb5d2ce6e Reapply r54147 with a constraint to only use the 8-bit
subreg form on x86-64, to avoid the problem with x86-32
having GPRs that don't have 8-bit subregs.

Also, change several 16-bit instructions to use 
equivalent 32-bit instructions. These have a smaller
encoding and avoid partial-register updates.

llvm-svn: 54223
2008-07-30 18:09:17 +00:00
Bruno Cardoso Lopes
df5916fff6 Fixed bug in global address lowering for functions and in Brcond lowering
llvm-svn: 54215
2008-07-30 17:06:13 +00:00
Bruno Cardoso Lopes
e130052d1d Removed small section flag for mips, the assembler doesnt support this flag
llvm-svn: 54214
2008-07-30 17:04:04 +00:00
Bruno Cardoso Lopes
f2a6400d3e Added new features to represent specific instructions groups
llvm-svn: 54213
2008-07-30 17:01:06 +00:00
Bruno Cardoso Lopes
53fdaf7763 Instruction definition cleanup
llvm-svn: 54212
2008-07-30 16:58:59 +00:00
Bruno Cardoso Lopes
2188281cd4 Changed some methods order.
llvm-svn: 54169
2008-07-29 19:29:50 +00:00
Nate Begeman
f76a814673 Fix broken CellSPU lowering, re-instate braces in Legalize
llvm-svn: 54168
2008-07-29 19:07:27 +00:00
Bruno Cardoso Lopes
9d91fab260 Added floating point lowering for select.
llvm-svn: 54167
2008-07-29 19:05:28 +00:00
Dan Gohman
ebe629a4b2 Revert 54147.
llvm-svn: 54148
2008-07-29 01:02:18 +00:00
Dan Gohman
1816900fd1 Add x86 isel patterns to match what would be a ZERO_EXTEND_INREG operation,
which is represented in codegen as an 'and' operation. This matches them
with movz instructions, instead of leaving them to be matched by and
instructions with an immediate field.

llvm-svn: 54147
2008-07-28 22:18:25 +00:00
Bruno Cardoso Lopes
4223351620 Disable gp_rel relocation for constant pools access for now.
llvm-svn: 54142
2008-07-28 19:26:25 +00:00
Duncan Sands
3df25c8758 Since build_vector is a variadic node, the number
of operands should be -1 not 0.

llvm-svn: 54141
2008-07-28 19:17:21 +00:00
Bruno Cardoso Lopes
67af9a72f4 Added floating point lowering for setcc and brcond.
Fixed COMM asm directive usage.
ConstantPool using custom FourByteConstantSection.

llvm-svn: 54139
2008-07-28 19:11:24 +00:00
Bill Wendling
86c1243f5e Remove <iostream> include.
llvm-svn: 54131
2008-07-27 23:18:30 +00:00
Dan Gohman
9742f7772d Rename SDOperand to SDValue.
llvm-svn: 54128
2008-07-27 21:46:04 +00:00
Dan Gohman
47c5cdbc34 Tidy SDNode::use_iterator, and complete the transition to have it
parallel its analogue, Value::value_use_iterator. The operator* method
now returns the user, rather than the use.

llvm-svn: 54127
2008-07-27 20:43:25 +00:00
Nate Begeman
5523d40e4b Disable mov{L, LP, HP, HLP, *DUP} shuffles for mmx
mmx needs its own fancy shuffle logic based on unpack; for now we get correct but awful code.

Also commit Mon Ping's VSETCC patch

llvm-svn: 54039
2008-07-25 19:05:58 +00:00
Nate Begeman
730880eec2 Fit in 80 cols
llvm-svn: 54029
2008-07-25 17:34:41 +00:00
Nate Begeman
73efed7a4c Remove dead PatLeaf; there are a number of issues around MMX movl that need to be fixed.
llvm-svn: 54026
2008-07-25 17:25:04 +00:00
Evan Cheng
d4eb684258 Teach ARM isLegalAddressingMode to handle unknown type without crashing. This fixes pr2589.
llvm-svn: 54004
2008-07-25 00:55:17 +00:00
Dan Gohman
41eaf577d6 Avoid emitting casts in static initializer contexts. This fixes
large numbers of CBE regressions caused by r53958.

llvm-svn: 53990
2008-07-24 17:57:48 +00:00
Evan Cheng
9c8cac5fd7 Fix a catastrophic PPC64 ABI bug: i32 operands which are passed in memory (all of the parameter registers are used) are loaded from sp offsets that were off by 4.
llvm-svn: 53979
2008-07-24 08:17:07 +00:00
Dan Gohman
8d04607133 Use C99 aggregate literal syntax for first-class struct and array values.
This fixes several recent CBE regressions.

llvm-svn: 53958
2008-07-23 18:41:03 +00:00
Bruno Cardoso Lopes
3b775c0d28 Minor fixes.
Added ConstantPool support.

llvm-svn: 53951
2008-07-23 16:01:50 +00:00
Dan Gohman
6564581be0 Enable first-class aggregates support.
Remove the GetResultInst instruction. It is still accepted in LLVM assembly
and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove
support for return instructions with multiple values. These are auto-upgraded
to use InsertValueInst instructions.

The IRBuilder still accepts multiple-value returns, and auto-upgrades them
to InsertValueInst instructions.

llvm-svn: 53941
2008-07-23 00:34:11 +00:00
Evan Cheng
20c9cdbe69 Fix PR2485: do all 4-element SSE shuffles in max. of 2 shuffle instructions.
Based on patch by Nicolas Capens.

llvm-svn: 53939
2008-07-23 00:22:17 +00:00
Evan Cheng
ff0bd19937 Factor out SSE 4 wide shuffle lowering code into its own function. No functionality changes.
llvm-svn: 53933
2008-07-22 21:13:36 +00:00
Evan Cheng
901d469e05 Fix PR2574: implement v2f32 scalar_to_vector.
llvm-svn: 53927
2008-07-22 18:39:19 +00:00
Anton Korobeynikov
af50b3159f Provide default implementation of different small-sections related stuff
llvm-svn: 53920
2008-07-22 17:09:59 +00:00
Anton Korobeynikov
090eca95ab Tie small stuff to non-small by default on ELF platforms
llvm-svn: 53919
2008-07-22 17:09:41 +00:00
Bruno Cardoso Lopes
a4a3546fec simplified small section logic
llvm-svn: 53912
2008-07-22 16:24:21 +00:00
Anton Korobeynikov
f13fbd6879 Fix encoding of atomic compare and swap for i64
llvm-svn: 53911
2008-07-22 16:22:48 +00:00
Bruno Cardoso Lopes
1253b2ac48 Added small section asm emition logic for mips.
Fixed small bug.

llvm-svn: 53908
2008-07-22 15:34:27 +00:00
Bruno Cardoso Lopes
96ab649026 Basic support for small sections
llvm-svn: 53907
2008-07-22 15:26:53 +00:00
Bill Wendling
5e6c729e8b Remove another tab.
llvm-svn: 53904
2008-07-22 08:54:38 +00:00
Bill Wendling
1b355889f6 More tab removals.
llvm-svn: 53903
2008-07-22 08:50:44 +00:00
Dan Gohman
184839a58d Fix a typo in a comment.
llvm-svn: 53894
2008-07-22 00:52:04 +00:00
Evan Cheng
a2bb31372d Eliminate a compilation warning.
llvm-svn: 53873
2008-07-21 20:02:45 +00:00
Dan Gohman
b91bef08a7 Add titles to the various SelectionDAG viewGraph calls
that include useful information like the name of the
block being viewed and the current phase of compilation.

llvm-svn: 53872
2008-07-21 20:00:07 +00:00
Bruno Cardoso Lopes
e6a9345187 Added initial support for small sections on Mips.
Added gp_rel relocations to support addressing small section contents.
Added command line to specify small section threshold in bytes.

llvm-svn: 53869
2008-07-21 18:52:34 +00:00
Anton Korobeynikov
78bab0e7f2 Use better variable names
llvm-svn: 53859
2008-07-21 18:29:23 +00:00
Anton Korobeynikov
3d4c55bb7a Don't use larger alignment.
llvm-svn: 53857
2008-07-21 18:25:17 +00:00
Duncan Sands
6e31474e71 Add VerifyNode, a place to put sanity checks on
generic SDNode's (nodes with their own constructors
should do sanity checking in the constructor).  Add
sanity checks for BUILD_VECTOR and fix all the places
that were producing bogus BUILD_VECTORs, as found by
"make check".  My favorite is the BUILD_VECTOR with
only two operands that was being used to build a
vector with four elements!

llvm-svn: 53850
2008-07-21 10:20:31 +00:00
Evan Cheng
ffd51ccf6b Use movaps instead of movups to spill 16-byte vector values when default alignment is >= 16. This fixes some massive performance regressions.
llvm-svn: 53844
2008-07-21 06:34:17 +00:00
Bill Wendling
98b6e63176 Fix for first part of PR2562. Generate the "pinsrw" instruction for inserts
into v4i16 vectors.

llvm-svn: 53807
2008-07-20 02:32:23 +00:00
Anton Korobeynikov
b49440f266 Unbreak build: 'DarwinTargetAsmInfo' was already taken as PPC TAI flavour.
llvm-svn: 53801
2008-07-19 21:44:57 +00:00
Duncan Sands
ad24fa3ff4 Make sure custom lowering for LegalizeTypes
returns a node with the right number of
return values.  This fixes codegen of
Generic/cast-fp.ll, Generic/fp_to_int.ll
and PowerPC/multiple-return-values.ll
when using -march=ppc32 -mattr=+64bit.

llvm-svn: 53794
2008-07-19 16:26:02 +00:00
Anton Korobeynikov
cab6b6d44d Use chars, where possible
llvm-svn: 53791
2008-07-19 13:16:32 +00:00
Anton Korobeynikov
099f340556 Switch MIPS to new ELFTargetAsmInfo. Add few FIXMEs.
llvm-svn: 53790
2008-07-19 13:16:11 +00:00
Anton Korobeynikov
449fb584e4 Fix a FIXME :)
llvm-svn: 53789
2008-07-19 13:15:46 +00:00
Anton Korobeynikov
5c0eb7e991 Use generic ELFTargetAsmInfo and DarwinTargetAsmInfo for X86 code
llvm-svn: 53788
2008-07-19 13:15:21 +00:00
Anton Korobeynikov
5298428cff Add TargetAsmInfo stuff for all darwin-based targets
llvm-svn: 53787
2008-07-19 13:14:46 +00:00
Anton Korobeynikov
3724600253 Add TargetAsmInfo for all ELF-based targets
llvm-svn: 53786
2008-07-19 13:14:11 +00:00
Anton Korobeynikov
6e00357dd6 Use aligned stack spills, where possible. This fixes PR2549.
llvm-svn: 53784
2008-07-19 06:30:51 +00:00
Dan Gohman
b97c076af4 In the CBackend, use casts to force integer add, subtract, and
multiply to be done as unsigned, so that they have well defined
behavior on overflow. This fixes PR2408.

llvm-svn: 53767
2008-07-18 18:43:12 +00:00
Dan Gohman
8981962672 Add a new function, ReplaceAllUsesOfValuesWith, which handles bulk
replacement of multiple values. This is slightly more efficient
than doing multiple ReplaceAllUsesOfValueWith calls, and theoretically
could be optimized even further. However, an important property of this
new function is that it handles the case where the source value set and
destination value set overlap. This makes it feasible for isel to use
SelectNodeTo in many very common cases, which is advantageous because
SelectNodeTo avoids a temporary node and it doesn't require CSEMap
updates for users of values that don't change position.

Revamp MorphNodeTo, which is what does all the work of SelectNodeTo, to
handle operand lists more efficiently, and to correctly handle a number
of corner cases to which its new wider use exposes it.

This commit also includes a change to the encoding of post-isel opcodes
in SDNodes; now instead of being sandwiched between the target-independent
pre-isel opcodes and the target-dependent pre-isel opcodes, post-isel
opcodes are now represented as negative values. This makes it possible
to test if an opcode is pre-isel or post-isel without having to know
the size of the current target's post-isel instruction set.

These changes speed up llc overall by 3% and reduce memory usage by 10%
on the InstructionCombining.cpp testcase with -fast and -regalloc=local.

llvm-svn: 53728
2008-07-17 19:10:17 +00:00
Nate Begeman
64f8f7f6bb Remove unnecessary readme entry
llvm-svn: 53722
2008-07-17 17:21:14 +00:00
Nate Begeman
61f6c21028 Fix a typo in last commit
llvm-svn: 53720
2008-07-17 17:04:58 +00:00
Nate Begeman
af01bfff99 SSE codegen for vsetcc nodes
llvm-svn: 53719
2008-07-17 16:51:19 +00:00
Mon P Wang
57cd9d6e5a When lowering certain atomics, we need to copy the memoperand from the old
atomic operation to the new one.

llvm-svn: 53714
2008-07-17 04:54:06 +00:00
Devang Patel
a6c5ff690a Mark function used by asm block as used, otherwise optimizer may not see the use and may delete the function.
llvm-svn: 53692
2008-07-16 17:54:34 +00:00
Scott Michel
ba160e6396 Somehow, custom lowering of i64 multiplications got dropped along the way.
llvm-svn: 53689
2008-07-16 17:17:29 +00:00
Dan Gohman
4c8c8e3aad Fix the result type of X86's truncate to i8.
llvm-svn: 53688
2008-07-16 16:20:48 +00:00
Evan Cheng
face16f9d8 x86-64 PIC JIT fixes: do not generate the extra load for external GV's.
llvm-svn: 53661
2008-07-16 01:34:02 +00:00
Evan Cheng
cabfd3f78c X86-64 PIC jump table values are different from x86-32 cases, they are dest - table base.
llvm-svn: 53660
2008-07-16 01:33:08 +00:00
Dan Gohman
8cf62e122f TargetAsmInfo::SectionForGlobal showed up in a profile. Simplify it a little.
llvm-svn: 53639
2008-07-15 18:37:51 +00:00
Bruno Cardoso Lopes
0c154df07f Fixed call stack alignment. Improved AsmPrinter alignment issues.
llvm-svn: 53585
2008-07-15 02:03:36 +00:00
Bruno Cardoso Lopes
f5a55301e0 Added Subtarget support into RegisterInfo
Added HasABICall and HasAbsoluteCall (equivalent to gcc -mabicall and 
-mno-shared). HasAbsoluteCall is not implemented but HasABICall is the 
default for o32 ABI. Now, both should help into a more accurate 
relocation types implementation. 
Added IsLinux is needed to choose between asm directives.
Instruction name strings cleanup.
AsmPrinter improved.

llvm-svn: 53551
2008-07-14 14:42:54 +00:00
Chris Lattner
15ae951af5 Add a note.
llvm-svn: 53535
2008-07-14 00:19:59 +00:00
Evan Cheng
c69b53dff9 Implement llvm.atomic.cmp.swap.i32 on PPC. Patch by Gary Benson!
llvm-svn: 53505
2008-07-12 02:23:19 +00:00
Dan Gohman
bf47a27643 Add a utility function to MachineInstr for testing whether an instruction
has exactly one MachineMemOperand, and change some X86 lowering code to
make use of it.

llvm-svn: 53498
2008-07-12 00:10:52 +00:00