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

26709 Commits

Author SHA1 Message Date
Evan Cheng
275825195a Make use of getStore().
llvm-svn: 30759
2006-10-05 23:01:46 +00:00
Evan Cheng
c9e079d0c1 Add getStore() helper function to create ISD::STORE nodes.
llvm-svn: 30758
2006-10-05 22:57:11 +00:00
Chris Lattner
eca9897bd5 Don't crash if an MBB doesn't have an LLVM BB
llvm-svn: 30757
2006-10-05 21:40:14 +00:00
Rafael Espindola
2e4743b6d1 use a const ref for passing the vector to ArgumentLayout
llvm-svn: 30756
2006-10-05 17:46:48 +00:00
Rafael Espindola
f0e4950ef4 implement a ArgumentLayout class to factor code common to LowerFORMAL_ARGUMENTS and LowerCALL
implement FMDRR
add support for f64 function arguments

llvm-svn: 30754
2006-10-05 16:48:49 +00:00
Jim Laskey
3f9f064fd1 Alias analysis code clean ups.
llvm-svn: 30753
2006-10-05 15:07:25 +00:00
Chris Lattner
513ba43053 add a new SimplifyDemandedVectorElts method, which works similarly to
SimplifyDemandedBits.  The idea is that some operations can be simplified if
not all of the computed elements are needed.  Some targets (like x86) have a
large number of intrinsics that operate on a single element, but pass other
elts through unmodified.  If those other elements are not needed, the
intrinsics can be simplified to scalar operations, and insertelement ops can
be removed.

This turns (f.e.):

ushort %Convert_sse(float %f) {
        %tmp = insertelement <4 x float> undef, float %f, uint 0                ; <<4 x float>> [#uses=1]
        %tmp10 = insertelement <4 x float> %tmp, float 0.000000e+00, uint 1             ; <<4 x float>> [#uses=1]
        %tmp11 = insertelement <4 x float> %tmp10, float 0.000000e+00, uint 2           ; <<4 x float>> [#uses=1]
        %tmp12 = insertelement <4 x float> %tmp11, float 0.000000e+00, uint 3           ; <<4 x float>> [#uses=1]
        %tmp28 = tail call <4 x float> %llvm.x86.sse.sub.ss( <4 x float> %tmp12, <4 x float> < float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > )               ; <<4 x float>> [#uses=1]
        %tmp37 = tail call <4 x float> %llvm.x86.sse.mul.ss( <4 x float> %tmp28, <4 x float> < float 5.000000e-01, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > )               ; <<4 x float>> [#uses=1]
        %tmp48 = tail call <4 x float> %llvm.x86.sse.min.ss( <4 x float> %tmp37, <4 x float> < float 6.553500e+04, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00 > )               ; <<4 x float>> [#uses=1]
        %tmp59 = tail call <4 x float> %llvm.x86.sse.max.ss( <4 x float> %tmp48, <4 x float> zeroinitializer )          ; <<4 x float>> [#uses=1]
        %tmp = tail call int %llvm.x86.sse.cvttss2si( <4 x float> %tmp59 )              ; <int> [#uses=1]
        %tmp69 = cast int %tmp to ushort                ; <ushort> [#uses=1]
        ret ushort %tmp69
}

into:

ushort %Convert_sse(float %f) {
entry:
        %tmp28 = sub float %f, 1.000000e+00             ; <float> [#uses=1]
        %tmp37 = mul float %tmp28, 5.000000e-01         ; <float> [#uses=1]
        %tmp375 = insertelement <4 x float> undef, float %tmp37, uint 0         ; <<4 x float>> [#uses=1]
        %tmp48 = tail call <4 x float> %llvm.x86.sse.min.ss( <4 x float> %tmp375, <4 x float> < float 6.553500e+04, float undef, float undef, float undef > )           ; <<4 x float>> [#uses=1]
        %tmp59 = tail call <4 x float> %llvm.x86.sse.max.ss( <4 x float> %tmp48, <4 x float> < float 0.000000e+00, float undef, float undef, float undef > )            ; <<4 x float>> [#uses=1]
        %tmp = tail call int %llvm.x86.sse.cvttss2si( <4 x float> %tmp59 )              ; <int> [#uses=1]
        %tmp69 = cast int %tmp to ushort                ; <ushort> [#uses=1]
        ret ushort %tmp69
}

which improves codegen from:

_Convert_sse:
        movss LCPI1_0, %xmm0
        movss 4(%esp), %xmm1
        subss %xmm0, %xmm1
        movss LCPI1_1, %xmm0
        mulss %xmm0, %xmm1
        movss LCPI1_2, %xmm0
        minss %xmm0, %xmm1
        xorps %xmm0, %xmm0
        maxss %xmm0, %xmm1
        cvttss2si %xmm1, %eax
        andl $65535, %eax
        ret

to:

_Convert_sse:
        movss 4(%esp), %xmm0
        subss LCPI1_0, %xmm0
        mulss LCPI1_1, %xmm0
        movss LCPI1_2, %xmm1
        minss %xmm1, %xmm0
        xorps %xmm1, %xmm1
        maxss %xmm1, %xmm0
        cvttss2si %xmm0, %eax
        andl $65535, %eax
        ret


This is just a first step, it can be extended in many ways.  Testcase here:
Transforms/InstCombine/vec_demanded_elts.ll

llvm-svn: 30752
2006-10-05 06:55:50 +00:00
Chris Lattner
6f645eeac6 new testcase
llvm-svn: 30751
2006-10-05 06:51:54 +00:00
Chris Lattner
14ad447136 Add insertelement/extractelement helper ctors.
llvm-svn: 30750
2006-10-05 06:24:58 +00:00
Chris Lattner
7f98896c02 Lower some min/max idioms to minss/maxss when unsafe fp math is enabled.
llvm-svn: 30748
2006-10-05 04:11:26 +00:00
Andrew Lenharth
ff4a3b5545 Check that jump tables wind up in the rodata section
llvm-svn: 30747
2006-10-05 03:27:52 +00:00
Chris Lattner
94d1cfd32d remove JumpTableTextSection
llvm-svn: 30746
2006-10-05 03:14:23 +00:00
Chris Lattner
08da1a510d Don't bother setting JumpTableTextSection, it is about to disappear
llvm-svn: 30745
2006-10-05 03:13:59 +00:00
Chris Lattner
4f41b86e7f Emit pic jumptables to the same section that the function is emitted to,
allowing label differences to work.  This fixes CodeGen/X86/pic_jumptable.ll

llvm-svn: 30744
2006-10-05 03:13:28 +00:00
Chris Lattner
bf18a53eb9 Verify that jump tables are emitted to the same section as the function is,
when codegen'ing in pic mode.  This fixes a miscompilation of a switch stmt
in a template, as the template goes to a non-.text section.

llvm-svn: 30743
2006-10-05 03:12:36 +00:00
Chris Lattner
068190eb91 Pass the MachineFunction into EmitJumpTableInfo.
llvm-svn: 30742
2006-10-05 03:01:21 +00:00
Chris Lattner
75e572ab20 implement and use getSectionForFunction
llvm-svn: 30741
2006-10-05 02:51:36 +00:00
Chris Lattner
cc21d20348 Use getSectionForFunction.
llvm-svn: 30740
2006-10-05 02:49:23 +00:00
Chris Lattner
d62ecab2e3 Use getSectionForFunction
llvm-svn: 30739
2006-10-05 02:48:40 +00:00
Chris Lattner
a293b73042 use getSectionForFunction to decide which section to emit code into
llvm-svn: 30738
2006-10-05 02:47:13 +00:00
Chris Lattner
758352e9b1 Implement getSectionForFunction, use it when printing function body.
llvm-svn: 30737
2006-10-05 02:43:52 +00:00
Chris Lattner
b92a46c4f6 move getSectionForFunction to AsmPrinter
llvm-svn: 30736
2006-10-05 02:42:47 +00:00
Chris Lattner
ca844c6695 Move getSectionForFunction to AsmPrinter, change it to return a string.
llvm-svn: 30735
2006-10-05 02:42:20 +00:00
Chris Lattner
da8321b52e move getSectionForFunction to AsmPrinter.
llvm-svn: 30734
2006-10-05 02:41:43 +00:00
Chris Lattner
0ca8a69c28 implement DarwinTargetAsmInfo::getSectionForFunction, use it when outputting
function bodies

llvm-svn: 30733
2006-10-05 00:35:50 +00:00
Chris Lattner
6ba6d0e937 Give TargetAsmInfo a virtual dtor, add a new getSectionForFunction method.
llvm-svn: 30732
2006-10-05 00:35:16 +00:00
Chris Lattner
2e10b0c095 emit jump table before debug info
llvm-svn: 30731
2006-10-05 00:26:05 +00:00
Chris Lattner
dd6343bd8d Always emit the jump table after the function so it's part of the same 'atom'
as the function body.

llvm-svn: 30730
2006-10-05 00:24:46 +00:00
Chris Lattner
f943ae3b8a getFilename/getDirectory shouldn't abort if the global has no init. This
can happen on bugpoint reduced testcases f.e..

llvm-svn: 30729
2006-10-04 23:06:26 +00:00
Evan Cheng
5974db9813 Fix some typos that can cause a flag value to have more than one use.
llvm-svn: 30727
2006-10-04 22:23:53 +00:00
Chris Lattner
ba99215347 Fix a static dtor issue
llvm-svn: 30726
2006-10-04 22:13:11 +00:00
Chris Lattner
d55928d5f6 Fix more static dtor issues
llvm-svn: 30725
2006-10-04 21:52:35 +00:00
Chris Lattner
de1ba6dc70 Fix some more static dtor issues.
llvm-svn: 30724
2006-10-04 21:49:37 +00:00
Evan Cheng
a77dd83caf Added option -disable-x86-shuffle-opti to disable X86 specific vector shuffle optimizations.
llvm-svn: 30723
2006-10-04 18:33:38 +00:00
Evan Cheng
54a8d5a6e0 Formating.
llvm-svn: 30722
2006-10-04 18:33:00 +00:00
Jim Laskey
dd74085b55 More extensive alias analysis.
llvm-svn: 30721
2006-10-04 16:53:27 +00:00
Jim Laskey
ef4d9453b9 More long term solution
llvm-svn: 30720
2006-10-04 10:40:15 +00:00
Chris Lattner
4ec6c298d8 Pattern match min/max nodes when we have sse. This implements
CodeGen/X86/scalar_sse_minmax.ll

llvm-svn: 30719
2006-10-04 06:57:07 +00:00
Chris Lattner
097967c438 pattern match min/max nodes
llvm-svn: 30718
2006-10-04 06:56:02 +00:00
Chris Lattner
9d335a2a75 add a note :(
llvm-svn: 30717
2006-10-04 05:52:13 +00:00
Chris Lattner
c8225bc92a This case isn't implemented yet. It seems unlikely to be needed, but if it
ever is, we want to get an assert instead of silent bad codegen.

llvm-svn: 30716
2006-10-04 04:58:58 +00:00
Jim Laskey
b2dbdc5a38 Work around for some problems with templates.
llvm-svn: 30715
2006-10-04 01:43:13 +00:00
Evan Cheng
494e8e6971 Combine ISD::EXTLOAD, ISD::SEXTLOAD, ISD::ZEXTLOAD into ISD::LOADX. Add an
extra operand to LOADX to specify the exact value extension type.

llvm-svn: 30714
2006-10-04 00:56:09 +00:00
Chris Lattner
11590ccf0c Use $( $| $) to represent alternatives in asm blocks instead of {|}. This
is needed to support targets where {|} aren't special symbols.

llvm-svn: 30712
2006-10-03 23:27:09 +00:00
Evan Cheng
7b52bbd60c Fix an obvious typo.
llvm-svn: 30711
2006-10-03 23:08:27 +00:00
Chris Lattner
8b03e5ec6b Bugfixes
llvm-svn: 30709
2006-10-03 20:19:23 +00:00
Chris Lattner
4dde0288ed Print the MBB ID # along with the bb tag in the -print-machine-instrs output.
llvm-svn: 30708
2006-10-03 20:17:24 +00:00
Chris Lattner
a05ee6de92 ADd a method
llvm-svn: 30707
2006-10-03 20:16:45 +00:00
Chris Lattner
77aa419991 Provide a function that ensures MBB numbering is dense and inorder. This
can be used by MachineFunctionPasses who need this property.

llvm-svn: 30706
2006-10-03 19:18:57 +00:00
Nick Lewycky
f5ad6f5e2e Simplify logic further.
Ensure that we copy KnownProperties before calling visitBasicBlock, else
we may leak properties into blocks where they don't belong.

llvm-svn: 30705
2006-10-03 17:36:01 +00:00