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

1644 Commits

Author SHA1 Message Date
Dale Johannesen
862ade6f10 Use the output of the asm so the optimizer won't
delete it.

llvm-svn: 69018
2009-04-14 01:51:40 +00:00
Evan Cheng
9f44d3148c Fix PR3934 part 2. findOnlyInterestingUse() was not setting IsCopy and IsDstPhys which are returned by value and used by callee. This happened to work on the earlier test cases because of a logic error in the caller side.
llvm-svn: 69006
2009-04-14 00:32:25 +00:00
Evan Cheng
fa48d5c8d0 PR3934: Fix a bogus two-address pass assertion.
llvm-svn: 68979
2009-04-13 20:04:24 +00:00
Dan Gohman
be7227005f Implement x86 h-register extract support.
- Add patterns for h-register extract, which avoids a shift and mask,
   and in some cases a temporary register.
 - Add address-mode matching for turning (X>>(8-n))&(255<<n), where
   n is a valid address-mode scale value, into an h-register extract
   and a scaled-offset address.
 - Replace X86's MOV32to32_ and related instructions with the new
   target-independent COPY_TO_SUBREG instruction.

On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.

These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.

llvm-svn: 68962
2009-04-13 16:09:41 +00:00
Rafael Espindola
72347bffce X86-64 TLS support for local exec and initial exec.
llvm-svn: 68947
2009-04-13 13:02:49 +00:00
Chris Lattner
c1bfdc9bb2 Add a new "available_externally" linkage type. This is intended
to support C99 inline, GNU extern inline, etc.  Related bugzilla's
include PR3517, PR3100, & PR2933.  Nothing uses this yet, but it
appears to work.

llvm-svn: 68940
2009-04-13 05:44:34 +00:00
Rafael Espindola
ad8137187c In X86DAGToDAGISel::MatchWrapper, if base or index are set, avoid matching
only if symbolic addresses are RIP relatives.

llvm-svn: 68924
2009-04-12 23:00:38 +00:00
Rafael Espindola
412b15f4ed Add tests for the parts of X86-64 TLS that are already implemented.
llvm-svn: 68901
2009-04-12 10:43:41 +00:00
Chris Lattner
6d6cf3ff4a fix a cross-block fastisel crash handling overflow intrinsics.
See comment for details.  This fixes rdar://6772169

llvm-svn: 68890
2009-04-12 07:51:14 +00:00
Chris Lattner
42b8e431b6 move a target-specific test into its directory so it isn't run if you
don't configure the ARM target in.

llvm-svn: 68843
2009-04-10 23:58:38 +00:00
Chris Lattner
0577b8e2ef fix two problems with machine sinking:
1. Sinking would crash when the first instruction of a block was
   sunk due to iterator problems.
2. Instructions could be sunk to their current block, causing an
   infinite loop.

This fixes PR3968

llvm-svn: 68787
2009-04-10 16:38:36 +00:00
Rafael Espindola
88986ef511 Don't fold a load if the other operand is a TLS address.
With this we generate

movl    %gs:0, %eax
leal    i@NTPOFF(%eax), %eax

instead of

movl    $i@NTPOFF, %eax
addl    %gs:0, %eax

llvm-svn: 68778
2009-04-10 10:09:34 +00:00
Bob Wilson
c53238dff1 Fix pr3954. The register scavenger asserts for inline assembly with
register destinations that are tied to source operands.  The
TargetInstrDescr::findTiedToSrcOperand method silently fails for inline
assembly.  The existing MachineInstr::isRegReDefinedByTwoAddr was very
close to doing what is needed, so this revision makes a few changes to
that method and also renames it to isRegTiedToUseOperand (for consistency
with the very similar isRegTiedToDefOperand and because it handles both
two-address instructions and inline assembly with tied registers).

llvm-svn: 68714
2009-04-09 17:16:43 +00:00
Chris Lattner
301c4f39a0 reg0 references are not real registers. This fixes a crash on the
attached testcase.

llvm-svn: 68712
2009-04-09 16:50:43 +00:00
Dan Gohman
68de98eef3 Generalize ExtendUsesToFormExtLoad to be usable for ANY_EXTEND,
in addition to ZERO_EXTEND and SIGN_EXTEND. Fix a bug in the
way it checked for live-out values, and simplify the way it
find users by using SDNode::use_iterator's (relatively) new
features. Also, make it slightly more permissive on targets
with free truncates.

In SelectionDAGBuild, avoid creating ANY_EXTEND nodes that are
larger than necessary. If the target's SwitchAmountTy has
enough bits, use it. This exposes the truncate to optimization
early, enabling more optimizations.

llvm-svn: 68670
2009-04-09 03:51:29 +00:00
Rafael Espindola
7eb72dc5f2 Re-apply 68552.
Tested by bootstrapping llvm-gcc and using that to build llvm.

llvm-svn: 68645
2009-04-08 21:14:34 +00:00
Bob Wilson
e0e4a070da Add testcase for PR3795.
llvm-svn: 68620
2009-04-08 18:00:55 +00:00
Duncan Sands
d0e186d90f Soft float support for FREM.
llvm-svn: 68614
2009-04-08 16:20:57 +00:00
Duncan Sands
ee34b0d05d Soft float support for undef. Reported by Xerxes Rånby.
llvm-svn: 68607
2009-04-08 13:33:37 +00:00
Dan Gohman
94fde57da3 Fully escape the grep string for this test.
llvm-svn: 68580
2009-04-08 00:54:40 +00:00
Dan Gohman
b979f332fd Update this test for recent codegen improvements. CodeGen is now
using an lea in place of a mov and an add for this test.

llvm-svn: 68579
2009-04-08 00:51:11 +00:00
Dan Gohman
c9ce27d6b7 Implement support for using modeling implicit-zero-extension on x86-64
with SUBREG_TO_REG, teach SimpleRegisterCoalescing to coalesce
SUBREG_TO_REG instructions (which are similar to INSERT_SUBREG
instructions), and teach the DAGCombiner to take advantage of this on
targets which support it. This eliminates many redundant
zero-extension operations on x86-64.

This adds a new TargetLowering hook, isZExtFree. It's similar to
isTruncateFree, except it only applies to actual definitions, and not
no-op truncates which may not zero the high bits.

Also, this adds a new optimization to SimplifyDemandedBits: transform
operations like x+y into (zext (add (trunc x), (trunc y))) on targets
where all the casts are no-ops. In contexts where the high part of the
add is explicitly masked off, this allows the mask operation to be
eliminated. Fix the DAGCombiner to avoid undoing these transformations
to eliminate casts on targets where the casts are no-ops.

Also, this adds a new two-address lowering heuristic. Since
two-address lowering runs before coalescing, it helps to be able to
look through copies when deciding whether commuting and/or
three-address conversion are profitable.

Also, fix a bug in LiveInterval::MergeInClobberRanges. It didn't handle
the case that a clobber range extended both before and beyond an
existing live range. In that case, multiple live ranges need to be
added. This was exposed by the new subreg coalescing code.

Remove 2008-05-06-SpillerBug.ll. It was bugpoint-reduced, and the
spiller behavior it was looking for no longer occurrs with the new
instruction selection.

llvm-svn: 68576
2009-04-08 00:15:30 +00:00
Bill Wendling
6e702cf68c Temporarily revert r68552. This was causing a failure in the self-hosting LLVM
builds.

--- Reverse-merging (from foreign repository) r68552 into '.':
U    test/CodeGen/X86/tls8.ll
U    test/CodeGen/X86/tls10.ll
U    test/CodeGen/X86/tls2.ll
U    test/CodeGen/X86/tls6.ll
U    lib/Target/X86/X86Instr64bit.td
U    lib/Target/X86/X86InstrSSE.td
U    lib/Target/X86/X86InstrInfo.td
U    lib/Target/X86/X86RegisterInfo.cpp
U    lib/Target/X86/X86ISelLowering.cpp
U    lib/Target/X86/X86CodeEmitter.cpp
U    lib/Target/X86/X86FastISel.cpp
U    lib/Target/X86/X86InstrInfo.h
U    lib/Target/X86/X86ISelDAGToDAG.cpp
U    lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
U    lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
U    lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
U    lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h
U    lib/Target/X86/X86ISelLowering.h
U    lib/Target/X86/X86InstrInfo.cpp
U    lib/Target/X86/X86InstrBuilder.h
U    lib/Target/X86/X86RegisterInfo.td

llvm-svn: 68560
2009-04-07 22:35:25 +00:00
Rafael Espindola
0324937229 Reduce code duplication on the TLS implementation.
This introduces a small regression on the generated code
quality in the case we are just computing addresses, not
loading values.

Will work on it and on X86-64 support.

llvm-svn: 68552
2009-04-07 21:37:46 +00:00
Dan Gohman
e98c3b1ea1 Don't attempt to handle aggregate argument values in FastISel; let
SelectionDAG do those. This fixes PR3955.

llvm-svn: 68546
2009-04-07 20:40:11 +00:00
Bob Wilson
39c7bec188 Handle 'a' modifier in ARM inline assembly.
Patch by Richard Pennington.

llvm-svn: 68464
2009-04-06 21:46:51 +00:00
Nick Lewycky
811a7377b0 Try SSE2?
llvm-svn: 68423
2009-04-04 10:24:24 +00:00
Nick Lewycky
49df985ad9 Fix test on non-x86 platforms.
llvm-svn: 68419
2009-04-04 07:20:43 +00:00
Dan Gohman
ea48adc739 Fix a TargetLowering optimization so that it doesn't duplicate
loads when an input node has multiple uses.

llvm-svn: 68398
2009-04-03 20:11:30 +00:00
Mon P Wang
f829fb5cab Added a x86 dag combine to increase the chances to use a
movq for v2i64 on x86-32.

llvm-svn: 68368
2009-04-03 02:43:30 +00:00
Bob Wilson
5b42ebe6a9 Fix PR3862: Recognize some ARM-specific constraints for immediates in inline
assembly.

llvm-svn: 68218
2009-04-01 17:58:54 +00:00
Evan Cheng
0674a512bf Fully general expansion of integer shift of any size.
llvm-svn: 68134
2009-03-31 19:39:24 +00:00
Dan Gohman
9f7d1f2bd4 Add an explicit -asm-verbose to these tests, to make it
possible to run the tests with -asm-verbose defaulting
to false.

llvm-svn: 68124
2009-03-31 18:20:47 +00:00
Owen Anderson
59cff6919d Remove the "fast" cases for spill and restore point determination, as these were subtlely wrong in obscure cases. Patch the testcase
to account for this change.

llvm-svn: 68093
2009-03-31 08:27:09 +00:00
Dan Gohman
cba99ee717 Fix live-out reg logic to not insert over-aggressive AssertZExt
instructions. This fixes lua.

llvm-svn: 68083
2009-03-31 01:38:29 +00:00
Evan Cheng
d7824e208a Turn a 2-address instruction into a 3-address one when it's profitable even if the two-address operand is killed.
e.g.
%reg1024<def> = MOV r1
%reg1025<def> = ADD %reg1024, %reg1026
r0            = MOV %reg1025

If it's not possible / profitable to commute ADD, then turning ADD into a LEA saves a copy.

llvm-svn: 68065
2009-03-30 21:34:07 +00:00
Anton Korobeynikov
497fd0e996 Tweak test for recent relro stuff
llvm-svn: 68035
2009-03-30 15:28:40 +00:00
Evan Cheng
5c460dbc3d Forgot this test.
llvm-svn: 68025
2009-03-30 06:17:34 +00:00
Anton Korobeynikov
d24f576124 Testcase for recent ro/relocs stuff
llvm-svn: 68008
2009-03-29 17:14:57 +00:00
Duncan Sands
602234cdf3 Fix PR3899: add support for extracting floats from vectors
when using -soft-float.
Based on a patch by Jakob Stoklund Olesen.

llvm-svn: 67996
2009-03-29 13:51:06 +00:00
Arnold Schwaighofer
76188bc8a1 Make check in CheckTailCallReturnConstraints for ignorable instructions between
a CALL and a RET node more generic. Add a test for tail calls with a void
return.

llvm-svn: 67943
2009-03-28 12:36:29 +00:00
Arnold Schwaighofer
636127325b Enable tail call optimization for functions that return a struct (bug 3664) and for functions that return types that need extending (e.g i1).
llvm-svn: 67934
2009-03-28 08:33:27 +00:00
Evan Cheng
a15fdaa292 Optimize some 64-bit multiplication by constants into two lea's or one lea + shl since imulq is slow (latency 5). e.g.
x * 40
=>
shlq    $3, %rdi
leaq    (%rdi,%rdi,4), %rax

This has the added benefit of allowing more multiply to be folded into addressing mode. e.g.
a * 24 + b
=>
leaq    (%rdi,%rdi,2), %rax
leaq    (%rsi,%rax,8), %rax

llvm-svn: 67917
2009-03-28 05:57:29 +00:00
Dan Gohman
66fc2f0a88 Fix this test so that it doesn't spuriously fail due to some
unrelated debugging output happening to contain the string "store".

llvm-svn: 67849
2009-03-27 16:17:22 +00:00
Evan Cheng
86f6af35bf Add -march=x86.
llvm-svn: 67783
2009-03-26 23:03:32 +00:00
Bill Wendling
e59b8d1cad Add -f to RUN line.
llvm-svn: 67744
2009-03-26 06:17:54 +00:00
Chris Lattner
ad28e0de5f no need for eh info
llvm-svn: 67740
2009-03-26 05:51:18 +00:00
Bill Wendling
3b9278a1c5 Add testcase for r67728.
llvm-svn: 67729
2009-03-26 01:52:47 +00:00
Evan Cheng
bddc7d1032 Add a test case for PR3779: when to promote the function return value.
llvm-svn: 67702
2009-03-25 20:30:19 +00:00
Evan Cheng
7e4217176a Revert 67132. This is breaking some objective-c apps.
Also fixes SDISel so it *does not* force promote return value if the function is not marked signext / zeroext.

llvm-svn: 67701
2009-03-25 20:20:11 +00:00