summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Consider the livein/out set for a function, allowing targets to not have toChris Lattner2005-04-091-0/+20
| | | | | | use ugly imp_def/imp_uses for arguments and return values. llvm-svn: 21180
* recognize some patterns as fabs operations, so that fabs at the source levelChris Lattner2005-04-091-0/+21
| | | | | | | | | | | | | is deconstructed then reconstructed here. This catches 19 fabs's in 177.mesa 9 in 168.wupwise, 5 in 171.swim, 3 in 172.mgrid, and 14 in 173.applu out of specfp2000. This allows the X86 code generator to make MUCH better code than before for each of these and saves one instr on ppc. This depends on the previous CFE patch to expose these correctly. llvm-svn: 21171
* Emit BRCONDTWOWAY when possible.Chris Lattner2005-04-091-7/+6
| | | | llvm-svn: 21167
* Legalize BRCONDTWOWAY into a BRCOND/BR pair if a target doesn't support it.Chris Lattner2005-04-091-0/+33
| | | | llvm-svn: 21166
* print and fold BRCONDTWOWAY correctlyChris Lattner2005-04-091-11/+25
| | | | llvm-svn: 21165
* canonicalize a bunch of operations involving fnegChris Lattner2005-04-091-0/+21
| | | | llvm-svn: 21160
* If a target zero or sign extends the result of its setcc, allow folding ofChris Lattner2005-04-071-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this into sign/zero extension instructions later. On PPC, for example, this testcase: %G = external global sbyte implementation void %test(int %X, int %Y) { %C = setlt int %X, %Y %D = cast bool %C to sbyte store sbyte %D, sbyte* %G ret void } Now codegens to: cmpw cr0, r3, r4 li r3, 1 li r4, 0 blt .LBB_test_2 ; .LBB_test_1: ; or r3, r4, r4 .LBB_test_2: ; addis r2, r2, ha16(L_G$non_lazy_ptr-"L00000$pb") lwz r2, lo16(L_G$non_lazy_ptr-"L00000$pb")(r2) stb r3, 0(r2) instead of: cmpw cr0, r3, r4 li r3, 1 li r4, 0 blt .LBB_test_2 ; .LBB_test_1: ; or r3, r4, r4 .LBB_test_2: ; *** rlwinm r3, r3, 0, 31, 31 addis r2, r2, ha16(L_G$non_lazy_ptr-"L00000$pb") lwz r2, lo16(L_G$non_lazy_ptr-"L00000$pb")(r2) stb r3, 0(r2) llvm-svn: 21148
* Remove somethign I had for testingChris Lattner2005-04-071-1/+1
| | | | llvm-svn: 21144
* This patch does two things. First, it canonicalizes 'X >= C' -> 'X > C-1'Chris Lattner2005-04-071-7/+49
| | | | | | | | | | | | | | | | | | | | (likewise for <= >=u >=u). Second, it implements a special case hack to turn 'X gtu SINTMAX' -> 'X lt 0' On powerpc, for example, this changes this: lis r2, 32767 ori r2, r2, 65535 cmplw cr0, r3, r2 bgt .LBB_test_2 into: cmpwi cr0, r3, 0 blt .LBB_test_2 llvm-svn: 21142
* Fix a really scary bug that Nate found where we weren't deleting the rightChris Lattner2005-04-071-1/+1
| | | | | | elements auto of the autoCSE maps. llvm-svn: 21128
* Teach ExpandShift how to handle shifts by a constant. This allows targetsNate Begeman2005-04-061-8/+64
| | | | | | like PowerPC to codegen long shifts in many fewer instructions. llvm-svn: 21122
* Expand SREM and UREM for targets that claim not to have them, like PowerPCNate Begeman2005-04-061-2/+25
| | | | llvm-svn: 21103
* Add MULHU and MULHS nodes for the high part of an (un)signed 32x32=64bNate Begeman2005-04-051-0/+2
| | | | | | multiply. llvm-svn: 21102
* Make sure to notice that explicit physregs are used in the functionChris Lattner2005-04-041-23/+29
| | | | llvm-svn: 21084
* Handle expanding arguments to ISD::TRUNCATE. This happens on PowerPC whenNate Begeman2005-04-041-1/+3
| | | | | | you have something like i16 = truncate i64. This fixes Regression/C/casts llvm-svn: 21073
* Fix sign_extend and zero_extend of promoted value types to expanded valueChris Lattner2005-04-031-3/+27
| | | | | | types. This occurs when casting short to long on PPC for example. llvm-svn: 21072
* add support for prefix/suffix strings to go around GlobalValue(s)Duraid Madina2005-04-021-5/+10
| | | | | | | | | | | (which may or be function pointers) in the asmprinter. For the moment, this changes nothing, except the IA64 backend which can use this to write: data8.ua @fptr(blah__blah__mangled_function_name) (by setting FunctionAddrPrefix/Suffix to "@fptr(" / ")") llvm-svn: 21024
* transform fabs/fabsf calls into FABS nodes.Chris Lattner2005-04-021-29/+39
| | | | llvm-svn: 21014
* Expand fabs into fnegChris Lattner2005-04-021-1/+9
| | | | llvm-svn: 21013
* Turn -0.0 - X -> fnegChris Lattner2005-04-021-1/+13
| | | | llvm-svn: 21011
* Several changes mixed up here. First when legalizing a DAG with pcmarker,Chris Lattner2005-04-021-12/+57
| | | | | | | | | dont' regen the whole dag if unneccesary. Second, fix and ugly bug with the _PARTS nodes that caused legalize to produce multiples of them. Finally, implement initial support for FABS and FNEG. Currently FNEG is the only one to be trusted though. llvm-svn: 21009
* print fneg/fabsChris Lattner2005-04-021-0/+5
| | | | llvm-svn: 21008
* fix some bugs in the implementation of SHL_PARTS and friends.Chris Lattner2005-04-022-11/+38
| | | | llvm-svn: 21004
* Turn expanded shift operations into (e.g.) SHL_PARTS if the target supports it.Chris Lattner2005-04-021-9/+39
| | | | llvm-svn: 21002
* Print some new nodesChris Lattner2005-04-021-1/+6
| | | | llvm-svn: 21001
* Fix a bug when inserting a libcall into a function with no other calls.Chris Lattner2005-04-021-2/+4
| | | | llvm-svn: 20999
* Fix a warning about an unhandled switch caseNate Begeman2005-04-021-3/+4
| | | | llvm-svn: 20994
* Add ISD::UNDEF nodeNate Begeman2005-04-012-0/+25
| | | | | | | | | Teach the SelectionDAG code how to expand and promote it Have PPC32 LowerCallTo generate ISD::UNDEF for int arg regs used up by fp arguments, but not shadowing their value. This allows us to do the right thing with both fixed and vararg floating point arguments. llvm-svn: 20988
* print the machine CFG in the -print-machineinstrs dumpChris Lattner2005-04-011-0/+8
| | | | llvm-svn: 20976
* PCMarker support for DAG and AlphaAndrew Lenharth2005-03-313-0/+11
| | | | llvm-svn: 20965
* Instead of setting up the CFG edges at selectiondag construction time, setChris Lattner2005-03-301-7/+15
| | | | | | | them up after the code has been emitted. This allows targets to select one mbb as multiple mbb's as needed. llvm-svn: 20937
* Fix a bug that andrew noticed where we do not correctly sign/zero extendChris Lattner2005-03-291-4/+13
| | | | | | | | returned integer values all of the way to 64-bits (we only did it to 32-bits leaving the top bits undefined). This causes problems for targets like alpha whose ABI's define the top bits too. llvm-svn: 20926
* implement legalization of build_pair for nateChris Lattner2005-03-281-0/+8
| | | | llvm-svn: 20901
* First step in adding pcmarker intrinsic. Second step (soon) is adding ↵Andrew Lenharth2005-03-281-0/+3
| | | | | | backend support. llvm-svn: 20900
* Change interface to LowerCallTo to take a boolean isVarArg argument.Nate Begeman2005-03-262-6/+9
| | | | llvm-svn: 20842
* Fix the missing symbols problem Bill was hitting. Patch contributed byChris Lattner2005-03-171-0/+1
| | | | | | Bill Wendling!! llvm-svn: 20649
* This mega patch converts us from using Function::a{iterator|begin|end} toChris Lattner2005-03-152-13/+13
| | | | | | | | using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*. This patch is contributed by Gabor Greif, thanks! llvm-svn: 20597
* I didn't mean to check this in. :(Chris Lattner2005-03-101-3/+1
| | | | llvm-svn: 20555
* Fix a bug where we would incorrectly do a sign ext instead of a zero extChris Lattner2005-03-101-1/+1
| | | | | | | because we were checking the wrong thing. Thanks to andrew for pointing this out! llvm-svn: 20554
* Allow the live interval analysis pass to be a bit more aggressive aboutChris Lattner2005-03-092-10/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | numbering values in live ranges for physical registers. The alpha backend currently generates code that looks like this: vreg = preg ... preg = vreg use preg ... preg = vreg use preg etc. Because vreg contains the value of preg coming in, each of the copies back into preg contain that initial value as well. In the case of the Alpha, this allows this testcase: void "foo"(int %blah) { store int 5, int *%MyVar store int 12, int* %MyVar2 ret void } to compile to: foo: ldgp $29, 0($27) ldiq $0,5 stl $0,MyVar ldiq $0,12 stl $0,MyVar2 ret $31,($26),1 instead of: foo: ldgp $29, 0($27) bis $29,$29,$0 ldiq $1,5 bis $0,$0,$29 stl $1,MyVar ldiq $1,12 bis $0,$0,$29 stl $1,MyVar2 ret $31,($26),1 This does not seem to have any noticable effect on X86 code. This fixes PR535. llvm-svn: 20536
* constant fold FP_ROUND_INREG, ZERO_EXTEND_INREG, and SIGN_EXTEND_INREGChris Lattner2005-03-091-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the alpha backend to compile: bool %test(uint %P) { %c = seteq uint %P, 0 ret bool %c } into: test: ldgp $29, 0($27) ZAP $16,240,$0 CMPEQ $0,0,$0 AND $0,1,$0 ret $31,($26),1 instead of: test: ldgp $29, 0($27) ZAP $16,240,$0 ldiq $1,0 ZAP $1,240,$1 CMPEQ $0,$1,$0 AND $0,1,$0 ret $31,($26),1 ... and fixes PR534. llvm-svn: 20534
* Lower llvm.isunordered(a, b) into a != a | b != b.Alkis Evlogimenos2005-03-011-3/+8
| | | | llvm-svn: 20382
* Lower prefetch to a noop, patch contributed by Justin Wick!Chris Lattner2005-02-281-0/+3
| | | | llvm-svn: 20375
* Fix a bug in the 'store fpimm, ptr' -> 'store intimm, ptr' handling code.Chris Lattner2005-02-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing 'op' here caused us to not enter the store into a map, causing reemission of the code!! In practice, a simple loop like this: no_exit: ; preds = %no_exit, %entry %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ] ; <uint> [#uses=3] %tmp.4 = getelementptr "complex long double"* %P, uint %indvar, uint 0 ; <double*> [#uses=1] store double 0.000000e+00, double* %tmp.4 %indvar.next = add uint %indvar, 1 ; <uint> [#uses=2] %exitcond = seteq uint %indvar.next, %N ; <bool> [#uses=1] br bool %exitcond, label %return, label %no_exit was being code gen'd to: .LBBtest_1: # no_exit movl %edx, %esi shll $4, %esi movl $0, 4(%eax,%esi) movl $0, (%eax,%esi) incl %edx movl $0, (%eax,%esi) movl $0, 4(%eax,%esi) cmpl %ecx, %edx jne .LBBtest_1 # no_exit Note that we are doing 4 32-bit stores instead of 2. Now we generate: .LBBtest_1: # no_exit movl %edx, %esi incl %esi shll $4, %edx movl $0, (%eax,%edx) movl $0, 4(%eax,%edx) cmpl %ecx, %esi movl %esi, %edx jne .LBBtest_1 # no_exit This is much happier, though it would be even better if the increment of ESI was scheduled after the compare :-/ llvm-svn: 20265
* Fix compilation errors with VS 2005, patch by Aaron Gray.Misha Brukman2005-02-171-0/+3
| | | | llvm-svn: 20231
* Don't rely on doubles comparing identical to each other, which doesn't workChris Lattner2005-02-171-4/+19
| | | | | | for 0.0 and -0.0. llvm-svn: 20230
* Don't sink argument loads into loops or other bad places. This disables ↵Chris Lattner2005-02-171-1/+8
| | | | | | folding of argument loads with instructions that are not in the entry block. llvm-svn: 20228
* Print GEP offsets as signed values instead of unsigned values. On X86, thisChris Lattner2005-02-141-3/+7
| | | | | | | | | | | | | | prints: getelementptr (int* %A, int -1) as: "(A) - 4" instead of "(A) + 18446744073709551612", which makes the assembler much happier. This fixes test/Regression/CodeGen/X86/2005-02-14-IllegalAssembler.ll, and Benchmarks/Prolangs-C/cdecl with LLC on X86. llvm-svn: 20183
* Fix a case where were incorrectly compiled cast from short to int on 64-bitChris Lattner2005-02-041-2/+4
| | | | | | targets. llvm-svn: 20030
* fix constant pointer outputing on 64 bit machinesAndrew Lenharth2005-02-041-0/+5
| | | | llvm-svn: 20026
OpenPOWER on IntegriCloud