Commit Graph

9878 Commits

Author SHA1 Message Date
Chris Lattner
7edc8c223e Implement the following xforms:
(X-Y)-X --> -Y
A + (B - A) --> B
(B - A) + A --> B


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21138 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-07 17:14:51 +00:00
Chris Lattner
08954a26e4 Implement InstCombine/add.ll:test28, transforming C1-(X+C2) --> (C1-C2)-X.
This occurs several dozen times in specint2k, particularly in crafty and gcc
apparently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21136 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-07 16:28:01 +00:00
Chris Lattner
43d84d6b71 Transform X-(X+Y) == -Y and X-(Y+X) == -Y
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21134 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-07 16:15:25 +00:00
Andrew Lenharth
273a1f956f It wasn't happy about this either
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21133 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-07 14:18:13 +00:00
Andrew Lenharth
706be918ca Yea, it wasn't happy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21132 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-07 13:55:53 +00:00
Duraid Madina
e6a0b6cbda teach asmprinter to print s8/s14 operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21131 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-07 12:34:36 +00:00
Duraid Madina
f55e403ef9 codegen immediate forms of add/sub/shift
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21130 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-07 12:33:38 +00:00
Duraid Madina
18c0c6bcc4 add immediate forms of add, sub, shift
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21129 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-07 12:32:24 +00:00
Chris Lattner
8e8bd656b3 Fix a really scary bug that Nate found where we weren't deleting the right
elements auto of the autoCSE maps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21128 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-07 00:30:13 +00:00
Nate Begeman
7ddecb4186 Pattern match bitfield insert, which helps shift long by immediate, among
other things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21127 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 23:51:40 +00:00
Nate Begeman
020ef42c19 Fix some shift bugs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21126 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 22:42:08 +00:00
Alkis Evlogimenos
aeca558788 Make these 64 bit constants so that this compiles on x86-32 as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21125 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 22:09:40 +00:00
Andrew Lenharth
a565c275b5 added sdiv by 2^k and works for neg divisors also
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21124 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 22:03:13 +00:00
Chris Lattner
6128690c62 Don't make this require loopsimplify. It works BETTER with loop simplify
but should not require it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21123 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 21:45:00 +00:00
Nate Begeman
f1fe32e337 Teach ExpandShift how to handle shifts by a constant. This allows targets
like PowerPC to codegen long shifts in many fewer instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21122 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 21:13:14 +00:00
Andrew Lenharth
f77f395043 fix copy/paste errors, and add imm support to SxADDQ and SxSUBQ
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21121 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 20:59:59 +00:00
Chris Lattner
6d027f2e6f Fix SingleSource/Regression/C/2005-05-06-LongLongSignedShift.c, we were not
properly sign extending the top of the result of a 64-bit shift right by
a constant > 32.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21120 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 20:59:35 +00:00
Andrew Lenharth
4b8ac1559a Added Nate's div by constant stuff, also scaled operations!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21116 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 20:25:34 +00:00
Chris Lattner
ce91ec9ae6 Fix a namespace issue, reported by Vladimir Merzliakov!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21115 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 19:45:39 +00:00
Duraid Madina
4826a0786d steal sampo's div-by-constant-power-of-2 stuff
thanks sampo!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21113 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 09:55:17 +00:00
Duraid Madina
b366a02ff2 add fms instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21112 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 09:54:09 +00:00
Nate Begeman
27b4c23b80 Fixed version of optimized integer divide is now fixed. Calculate the
quotient, not the remainder.  Also, make sure to remove the old div operand
from the ExprMap and let SelectExpr insert the new one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21111 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 06:44:57 +00:00
Duraid Madina
b70c2f3ef7 lie a bit and say that r1/r12 (GP/SP) _aren't_ callee-save, as we take
care of this ourselves


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21110 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 06:18:36 +00:00
Duraid Madina
4ee131ffa8 make sure 'special' registers don't get allocated
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21109 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 06:17:54 +00:00
Chris Lattner
8db0af1c8d Add (untested) support for MULHS and MULHU.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21107 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 04:21:07 +00:00
Chris Lattner
1e6a71524e add signed versions of the extra precision multiplies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21106 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 04:19:22 +00:00
Nate Begeman
8f52980f03 Turn off the div -> mul optimization until it works correctly 100% of the
time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21105 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 03:36:33 +00:00
Nate Begeman
815d6dac1e Add support for MULHS and MULHU nodes
Have LegalizeDAG handle SREM and UREM for us
Codegen SDIV and UDIV by constant as a multiply by magic constant instead
of integer divide, which is very slow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21104 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 00:25:27 +00:00
Nate Begeman
c105e19864 Expand SREM and UREM for targets that claim not to have them, like PowerPC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21103 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-06 00:23:54 +00:00
Nate Begeman
1867054643 Add MULHU and MULHS nodes for the high part of an (un)signed 32x32=64b
multiply.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21102 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-05 22:36:56 +00:00
Andrew Lenharth
2513ddc239 added lowerargs support for varargs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21101 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-05 20:51:46 +00:00
Nate Begeman
ad5f65c74b Behold, rlwinm with certain immediate arguments is printed as the much more
readable slwi or srwi (shift left/right word immediate).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21099 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-05 18:19:50 +00:00
Nate Begeman
a3829d5580 Fix cut & paste errors (32->64), and codegen float->int more optimally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21098 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-05 17:32:30 +00:00
Tanya Lattner
ac6e2dbf52 Updated to use dep analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21097 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-05 16:36:44 +00:00
Nate Begeman
d3e6b94020 Remove 64 bit simple ISel, it never worked correctly
Add initial (buggy) implementation of 64 bit pattern ISel


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21096 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-05 08:51:15 +00:00
Nate Begeman
c8c5c8f0fa Back out the previous change to SelectBranchCC, since there are cases it
could miscompile.  A correct solution will be found in the near future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21095 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-05 04:32:16 +00:00
Nate Begeman
439b444cad Rename canUseAsImmediateForOpcode to getImmediateForOpcode to better
indicate that it is not a boolean function.
Properly emit the pseudo instruction for conditional branch, so that we
  can fix up conditional branches whose displacements are too large.
Reserve the right amount of opcode space for said pseudo instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21094 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-05 04:22:58 +00:00
Chris Lattner
bd135c7706 do not crash when using -debug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21092 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-05 01:12:03 +00:00
Nate Begeman
80196b1331 Implement SDIV by power of 2 as srawi/addze rather than load imm, divw
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21091 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-05 00:15:08 +00:00
Nate Begeman
93075ec0a5 Pattern match fp mul-add, mul-sub, neg-mul-add, and neg-mul-sub
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21090 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-04 23:40:36 +00:00
Nate Begeman
178bb34ee5 Add support for multiply-add, multiply-sub, and their negated versions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21089 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-04 23:01:51 +00:00
Chris Lattner
8a9763c3cd do not dereference an extra layer of pointers to determine if an external
call can modify a memory location.  This fixes
test/Regression/Analysis/Andersens/modreftest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21088 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-04 22:23:21 +00:00
Nate Begeman
d860aa62ac Make sure that arg regs used by the call instruction are marked as such, so
that regalloc doesn't cleverly reuse early arg regs loading later arg regs.
This fixes almost all outstanding failures in the pattern isel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21086 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-04 22:17:48 +00:00
Nate Begeman
04ec80173b Remove unnecessary register copy now that regalloc is fixed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21085 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-04 21:48:13 +00:00
Chris Lattner
886dd9136f Make sure to notice that explicit physregs are used in the function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21084 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-04 21:35:34 +00:00
Nate Begeman
c3e2db407e i1 loads should also be from the low byte of the argument word.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21077 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-04 09:09:00 +00:00
Nate Begeman
e584668f04 Fix i64 return, fix CopyFromReg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21076 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-04 06:52:38 +00:00
Duraid Madina
6e02e6842a fix SREM/UREM, which gave incorrect results for x%y if x was zero. This is
an ugly hack, but it seems to work. I should fix this properly and add a test
as well.

fixes multisource/obsequi (maybe others)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21075 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-04 05:05:52 +00:00
Duraid Madina
09c61b9c19 add implicit use op
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21074 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-04 04:50:57 +00:00
Nate Begeman
79e46acd35 Handle expanding arguments to ISD::TRUNCATE. This happens on PowerPC when
you have something like i16 = truncate i64.  This fixes Regression/C/casts


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21073 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-04 00:57:08 +00:00
Chris Lattner
06098e0e9b Fix sign_extend and zero_extend of promoted value types to expanded value
types.  This occurs when casting short to long on PPC for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21072 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-03 23:41:52 +00:00
Nate Begeman
6644d4c933 Full varargs support. All of UnitTests now passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21070 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-03 23:11:17 +00:00
Nate Begeman
4ec0cbdf15 Pass the correct value for the chain to the store
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21066 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-03 22:22:56 +00:00
Nate Begeman
fa55470e39 Fix SHL_PARTS
Start implementation of integer varargs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21065 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-03 22:13:27 +00:00
Andrew Lenharth
63b720ac7c is this simpler? I think it is simpler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21064 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-03 20:35:21 +00:00
Andrew Lenharth
500d025bd9 fix 101 regressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21063 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-03 18:24:50 +00:00
Duraid Madina
162a837f63 .bss is no problem here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21061 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-03 14:52:01 +00:00
Nate Begeman
aa73a9f16f Keeping up with the Joneses.
Implement not, nor, nand, and eqv


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21060 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-03 11:20:20 +00:00
Andrew Lenharth
10c085b525 Select optimization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21051 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 22:32:39 +00:00
Andrew Lenharth
0eaf6ce2ef Try several things. 1) drop /i from FP ops 2) factor out FP to Int moves and provide 21264 support for those 3) match not 4) match ornot andnot xornot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21046 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 21:06:51 +00:00
Chris Lattner
1231aa3fa6 fix some VC compilation problems, thanks to Jeff C for pointing this out!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21044 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 20:17:09 +00:00
Chris Lattner
0700123431 EquivClassGraphs is now in DataStructure.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21042 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 20:08:17 +00:00
Chris Lattner
2ccc5f1081 use a callee_iterator typedef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21038 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 20:02:41 +00:00
Chris Lattner
021decc82d Change the ActualCallees callgraph from hash_multimap<Instruction,Function>
to std::set<std::pair<Inst,Func>> to avoid duplicate entries.

This speeds up the CompleteBU pass from 1.99s to .15s on povray and the
eqgraph passes from 1.5s to .16s on the same.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21031 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 19:17:18 +00:00
Andrew Lenharth
7332f3e05d FNEG/FABS/UNDEF
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21029 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 19:11:07 +00:00
Andrew Lenharth
30b46d41bc FNEG/FABS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21028 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 19:04:58 +00:00
Duraid Madina
32c46f33b7 ia64 asmprinter fixes:
- turn off assembler's autoalignment
  - set FunctionAddrPrefix/Suffix so that .data8 entries pointing to
    functions have their value wrapped in @fptr(), so that a function
    descriptor will be materialized for that function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21025 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 12:30:47 +00:00
Duraid Madina
855a519741 add support for prefix/suffix strings to go around GlobalValue(s)
(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(" / ")")


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21024 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 12:21:51 +00:00
Duraid Madina
75c9fcbdcc support IDEF, fnegabs (thanks sampo)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21023 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 10:33:53 +00:00
Duraid Madina
5c156b7473 add fnegabs op
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21022 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 10:06:27 +00:00
Nate Begeman
27eeb00a1a Set shift amount to Extend
Implement ISD::FABS and ISD::FNEG nodes
Implement SHL_PARTS, SRL_PARTS, and SRA_PARTS
Generate PowerPC 'fneg', 'fabs', and 'fnabs' instructions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21018 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 05:59:34 +00:00
Chris Lattner
b7edaa1d08 add support for FABS and FNEG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21015 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 05:30:17 +00:00
Chris Lattner
c0f18152d9 transform fabs/fabsf calls into FABS nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21014 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 05:26:53 +00:00
Chris Lattner
4af6e0d783 Expand fabs into fneg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21013 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 05:26:37 +00:00
Duraid Madina
a7ee8b8f04 add support FNEG and FABS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21012 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 05:18:38 +00:00
Chris Lattner
b9fccc4193 Turn -0.0 - X -> fneg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21011 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 05:04:50 +00:00
Chris Lattner
43fdea070c This target doesn't support fabs/fneg yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21010 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 05:03:24 +00:00
Chris Lattner
2c8086f4b9 Several changes mixed up here. First when legalizing a DAG with pcmarker,
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21009 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 05:00:07 +00:00
Chris Lattner
ff9fd0a99c print fneg/fabs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21008 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 04:58:41 +00:00
Chris Lattner
b1f26fb921 add an fabs instr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21006 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 04:31:56 +00:00
Chris Lattner
b38a7495da Add support for 64-bit shifts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21005 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 04:01:14 +00:00
Chris Lattner
5b359c6c4f fix some bugs in the implementation of SHL_PARTS and friends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21004 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 04:00:59 +00:00
Chris Lattner
4759982a2d Turn expanded shift operations into (e.g.) SHL_PARTS if the target supports it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21002 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 03:38:53 +00:00
Chris Lattner
41be951a47 Print some new nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21001 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 03:30:42 +00:00
Chris Lattner
f4b457987f Fix a bug when inserting a libcall into a function with no other calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20999 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 03:22:40 +00:00
Nate Begeman
27523a1c92 Fix i64 returns
Generate PowerPC 'subfic' instruction when appropriate


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20995 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 00:42:16 +00:00
Nate Begeman
ea19cd51aa Fix a warning about an unhandled switch case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20994 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-02 00:41:14 +00:00
Chris Lattner
7ce7eff54c Add support for ISD::UNDEF to the X86 be
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20990 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 22:46:45 +00:00
Nate Begeman
fc1b1dad88 Add ISD::UNDEF node
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20988 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 22:34:39 +00:00
Chris Lattner
e6fea166c3 Fix another PATypeHolder error, contributed by Bill Wendling!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20983 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 15:41:30 +00:00
Duraid Madina
69c8e20aa1 repair mindless SELECT waste.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20982 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 10:35:00 +00:00
Nate Begeman
6cb2e1b124 Fix Olden/bh, CR0 was being set in the wrong order
LowerCallTo and ISD::CALL are going to need to be modified, regs are being
set in the wrong order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20981 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 08:57:43 +00:00
Nate Begeman
31318e4b6c Also apply Chris's fix to FP select and SETCC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20979 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 07:21:30 +00:00
Chris Lattner
3071019026 Move the selection of the arms of the select operation up to the conditional
part to make sure we get the side effects and to avoid confusing the CFG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20977 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 07:10:02 +00:00
Chris Lattner
380ae49599 print the machine CFG in the -print-machineinstrs dump
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20976 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 06:48:38 +00:00
Nate Begeman
a7e11a4bb5 Fix stores to global addresses
Fix calls with no arguments


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20975 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 05:57:17 +00:00
Nate Begeman
04730361b5 Support indexed loads and stores. This drops Shootout/matrix time from
18.8 to 14.8 seconds.  The Pattern ISel is now often faster than the
Simple ISel, esp. on memory intensive code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20973 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 04:45:11 +00:00
Nate Begeman
6b55997df5 Implement FP_TO_SINT and FP_TO_UINT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20972 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 02:59:27 +00:00
Nate Begeman
6d369ccae0 Add support for adding 0.0 and -0.0 to the constant pool, since we lie and
say that we support them, for the purposes of generating fsel instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20970 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 01:08:07 +00:00
Nate Begeman
dffcfccc13 Factor out common code, support FP comparison in folded SetCC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20969 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-01 00:32:34 +00:00
Nate Begeman
3e89716ad7 fsel generation for f32 and f64 select
generate compare immediate for integer compare with constant
fold setcc into branch
fold setcc into select

Code generation quality for Shootout is now on par with the Simple ISel


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20968 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-31 23:55:40 +00:00
Andrew Lenharth
5e99dd9c2b make fp div trick dependend on flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20967 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-31 22:02:25 +00:00
Andrew Lenharth
95762124a1 PCMarker support for DAG and Alpha
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20965 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-31 21:24:06 +00:00
Duraid Madina
beeaab28a5 Assorted fixes:
* Stop being pessimistic about output register allocation
  * Start to handle function descriptors: compute target GPs and so on
  when doing indirect calls etc. Not there yet, though. For the moment,
  we try to use _indirect_ branches wherever possible, to stress test
  function descriptors.
  * FP divide-by-zero should work now
  * add varargs (it doesn't work, though)

At this point, all of SingleSource passes (modulo C++ tests that are due
to issues with the CFE, see note in the README.) Much of MultiSource also
passes although there's still a ton of bugs around. Something for me to
work on tomorrow, then. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20960 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-31 12:31:11 +00:00
Duraid Madina
1f867b103d * declare local common symbols as such (.lcomm, not merely .common)
* begin great adventure into correct function descriptor materialization


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20956 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-31 07:40:24 +00:00
Duraid Madina
290f64c1cb daintyness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20955 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-31 07:36:43 +00:00
Duraid Madina
291e1266c1 add what we need to fudge a 'floating point conditional move', this is
used to get FP div-by-zero working properly (shunt the right answer
depending on how frcpa sets its predicate output)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20954 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-31 07:32:32 +00:00
Nate Begeman
96fc681d7e Pass the correct values to the chain argument for node construction during
LowerCallTo.
Handle ISD::ADD in SelectAddr, allowing us to have nonzero immediates for
loads and stores, amazing!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20946 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-31 02:05:53 +00:00
Nate Begeman
74d734574e Rewrite LowerCallTo and Select(ISD::CALL) to properly handle float varargs
Tell the SelectionDAG ISel to expand SEXTLOAD of i1 and i8, rather than
  complicate the code in ISD::SEXTLOAD to do it by hand
Combine the FP and Int ISD::LOAD codegen
Generate better code for constant pool loads

As a result, all of Shootout, and likely many other programs are now
working.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20945 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-31 00:15:26 +00:00
Nate Begeman
fdcf3418e0 Fix calls whose arguments fit entirely in registers to not break the Chain.
Implement SINT_TO_FP and UINT_TO_FP
Remove some dead code from the simple ISel


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20944 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-30 19:38:35 +00:00
Andrew Lenharth
ba05ad605e yea, fine Duraid
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20942 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-30 18:22:52 +00:00
Nate Begeman
58f718cd97 Fix frame index code to generate legal PowerPC instructions. About half of
Shootout now works.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20940 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-30 02:23:08 +00:00
Nate Begeman
01d05266f9 Fix external symbol printing in the AsmPrinter. Tell the ISel that we
don't support things like memcpy directly.  This allows a handful of the
Shootout programs to work, yay!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20939 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-30 01:45:43 +00:00
Chris Lattner
a33ef4816d Instead of setting up the CFG edges at selectiondag construction time, set
them up after the code has been emitted.  This allows targets to select one
mbb as multiple mbb's as needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20937 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-30 01:10:47 +00:00
Chris Lattner
71df3f8cab don't depend on the cfg being set up yet
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20936 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-30 01:10:00 +00:00
Nate Begeman
23afcfb063 Fix BranchCC (it's still dumb), and implement FP select (also dumb)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20935 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 22:48:55 +00:00
Nate Begeman
74747861b9 Implement integer select and i1 sign extend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20934 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 22:24:51 +00:00
Nate Begeman
3316252034 Implement SetCC, fix ZERO_EXTEND_INREG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20933 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 21:54:38 +00:00
Chris Lattner
175b9635cc import all of the rest of the stubs that dsa uses for direct comparison
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20932 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 20:36:05 +00:00
Tanya Lattner
5e9f352346 Compare dependence analysis with llvm instructions versus machine instrutions. the problem with using machine instructions and alias analysis is that aa does not handle tmp instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20931 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 20:35:10 +00:00
Tanya Lattner
5ec3a63f6d Dependence analyzer that just determines dependences within a loop for loads and stores using alias analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20930 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 20:33:42 +00:00
Chris Lattner
77b505670c learn about some more functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20929 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 20:04:24 +00:00
Andrew Lenharth
c05138387a Fix up some types and constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20928 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 19:24:04 +00:00
Chris Lattner
9342a939eb Fix a problem where we not marking incoming arguments to functions with
external linkage as incomplete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20927 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 19:16:59 +00:00
Chris Lattner
f51d3bd676 Fix a bug that andrew noticed where we do not correctly sign/zero extend
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20926 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 19:09:56 +00:00
Chris Lattner
cfba7981eb there is no point comparing against null pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20925 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 17:44:52 +00:00
Chris Lattner
76bc5ce5c4 Fix a major problem with global variable initializers. This could cause
us to have stuff pointing to the null pointer, which makes no sense
(the null ptr is an ssa value, not the null object)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20922 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 17:21:53 +00:00
Chris Lattner
848132d671 fix a warning in the optimized build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20920 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 15:13:27 +00:00
Chris Lattner
4de57fd9e9 add some more functions, ignore setcc for constraints!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20917 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 06:52:20 +00:00
Chris Lattner
b1515fe522 disable this transformation in the one obscure case that really pessimizes
pointer analysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20916 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 06:37:47 +00:00
Chris Lattner
8a44643d61 Handle "known" external calls context sensitively, add support for realloc
and a couple of other functions that are important.

Handle aggregate undef values for gv initializers


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20914 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 06:09:07 +00:00
Nate Begeman
f3d08f31b3 Implement div, rem, and frameindex
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20907 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-29 00:03:27 +00:00
Nate Begeman
f70b576ccc Pattern ISel: fix argument loading for i64s (thanks chris)
Simple  ISel: fix i64 subtract


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20903 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 23:08:54 +00:00
Nate Begeman
ca12a2bd91 Remove fake instruction 'subc' (mnemonic for subfc).
More pattern isel updates


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20902 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 22:28:37 +00:00
Chris Lattner
d4e50bb2e2 implement legalization of build_pair for nate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20901 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 22:03:13 +00:00
Andrew Lenharth
7f4ec3b2e3 First step in adding pcmarker intrinsic. Second step (soon) is adding backend support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20900 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 20:05:49 +00:00
Nate Begeman
9db505ca9d Implement proper loads and zero-extends of all types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20897 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 19:36:43 +00:00
Duraid Madina
ae8bd73634 Emit .global @function and .global @object entries so the Intel ias
assembler may be used; identify LLVM output as such.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20892 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 15:21:43 +00:00
Chris Lattner
f392c64ec6 Teach andersens that non-escaping memory cannot be mod/ref'd by external fn calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20891 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 06:21:17 +00:00
Misha Brukman
be5e2f4f9b Fix grammar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20890 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 04:32:12 +00:00
Chris Lattner
c3c9fd0dd6 Make anders-aa much more precise by not being completely pessimistic about
external functions.  Teach it about a few important ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20889 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 04:03:52 +00:00
Alkis Evlogimenos
ab7ada3ed6 Rename createPromoteMemoryToRegister() to
createPromoteMemoryToRegisterPass() to be consistent with other pass
creation functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20885 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-28 02:01:12 +00:00
Chris Lattner
493f6366cb wrap some long lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20884 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-27 22:03:46 +00:00
Chris Lattner
93ab219244 remove ...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20883 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-27 21:57:09 +00:00
Chris Lattner
40ee8ce28b speed up steens by using spliceFrom, improve its precision by realizing that
an incomplete node cannot alias a complete node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20882 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-27 21:56:55 +00:00
Chris Lattner
267a1b02a2 teach andersens about undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20881 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-27 18:58:23 +00:00
Chris Lattner
5f4c0a88ee Don't give up completely, maybe other AA can say something about this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20873 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-27 00:02:33 +00:00
Chris Lattner
e70492d0e2 Factor out percentage printing into its own function. Make two changes to
the function: print more precision XX.X% instead of XX%, and cast to ULL
before scaling by 100/1000 to avoid wrap around for large numbers of queries
(such as occur for 253.perlbmk and 176.gcc)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20872 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 23:56:33 +00:00
Chris Lattner
1b9a2aac98 Cache mapping information for a call site after computing it for a mod/ref
query.  If the next mod/ref query happens to be for the same call site
(which is extremely likely), use the cache instead of recomputing the
callee/caller mapping.  This makes -aa-eval ***MUCH*** faster with
ds-aa


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20871 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 23:29:03 +00:00
Chris Lattner
a7337dc2b9 Remove more long dead code: dsa doesn't provide must alias info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20870 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-26 22:54:46 +00:00