Commit Graph

18208 Commits

Author SHA1 Message Date
Duraid Madina b484f7c55e add immediate forms of add, sub, shift
llvm-svn: 21129
2005-04-07 12:32:24 +00:00
Chris Lattner 7d13eae254 Fix a really scary bug that Nate found where we weren't deleting the right
elements auto of the autoCSE maps.

llvm-svn: 21128
2005-04-07 00:30:13 +00:00
Nate Begeman d20628ff7d Pattern match bitfield insert, which helps shift long by immediate, among
other things.

llvm-svn: 21127
2005-04-06 23:51:40 +00:00
Nate Begeman 505f6b760d Fix some shift bugs
llvm-svn: 21126
2005-04-06 22:42:08 +00:00
Alkis Evlogimenos 7ca0947274 Make these 64 bit constants so that this compiles on x86-32 as well.
llvm-svn: 21125
2005-04-06 22:09:40 +00:00
Andrew Lenharth 3ea17c6cfe added sdiv by 2^k and works for neg divisors also
llvm-svn: 21124
2005-04-06 22:03:13 +00:00
Chris Lattner 747eee2707 Don't make this require loopsimplify. It works BETTER with loop simplify
but should not require it.

llvm-svn: 21123
2005-04-06 21:45:00 +00:00
Nate Begeman b067492535 Teach ExpandShift how to handle shifts by a constant. This allows targets
like PowerPC to codegen long shifts in many fewer instructions.

llvm-svn: 21122
2005-04-06 21:13:14 +00:00
Andrew Lenharth df3256aa7f fix copy/paste errors, and add imm support to SxADDQ and SxSUBQ
llvm-svn: 21121
2005-04-06 20:59:59 +00:00
Chris Lattner bd32728a98 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.

llvm-svn: 21120
2005-04-06 20:59:35 +00:00
Andrew Lenharth 249bf7bee4 simplified
llvm-svn: 21119
2005-04-06 20:59:03 +00:00
Andrew Lenharth 99edcfe3f8 added first alpha codegen regression test
llvm-svn: 21117
2005-04-06 20:39:17 +00:00
Andrew Lenharth 1d4747c302 Added Nate's div by constant stuff, also scaled operations!
llvm-svn: 21116
2005-04-06 20:25:34 +00:00
Chris Lattner 70b8b96d6c Fix a namespace issue, reported by Vladimir Merzliakov!
llvm-svn: 21115
2005-04-06 19:45:39 +00:00
Duraid Madina c36b6c3b1a steal sampo's div-by-constant-power-of-2 stuff
thanks sampo!!

llvm-svn: 21113
2005-04-06 09:55:17 +00:00
Duraid Madina 03c530786c add fms instruction
llvm-svn: 21112
2005-04-06 09:54:09 +00:00
Nate Begeman 39ef2f1d43 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.

llvm-svn: 21111
2005-04-06 06:44:57 +00:00
Duraid Madina c0e9adf3cc lie a bit and say that r1/r12 (GP/SP) _aren't_ callee-save, as we take
care of this ourselves

llvm-svn: 21110
2005-04-06 06:18:36 +00:00
Duraid Madina df0ecbd4cc make sure 'special' registers don't get allocated
llvm-svn: 21109
2005-04-06 06:17:54 +00:00
Chris Lattner 9953d17a44 document these nodes, as they are nonobvious
llvm-svn: 21108
2005-04-06 04:21:29 +00:00
Chris Lattner 4fbb4af5d1 Add (untested) support for MULHS and MULHU.
llvm-svn: 21107
2005-04-06 04:21:07 +00:00
Chris Lattner c21db6b15c add signed versions of the extra precision multiplies
llvm-svn: 21106
2005-04-06 04:19:22 +00:00
Nate Begeman dd397119b0 Turn off the div -> mul optimization until it works correctly 100% of the
time.

llvm-svn: 21105
2005-04-06 03:36:33 +00:00
Nate Begeman 4164c4baac 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.

llvm-svn: 21104
2005-04-06 00:25:27 +00:00
Nate Begeman 20b7d2a36f Expand SREM and UREM for targets that claim not to have them, like PowerPC
llvm-svn: 21103
2005-04-06 00:23:54 +00:00
Nate Begeman 55e8625c69 Add MULHU and MULHS nodes for the high part of an (un)signed 32x32=64b
multiply.

llvm-svn: 21102
2005-04-05 22:36:56 +00:00
Andrew Lenharth 43f78bc2da added lowerargs support for varargs
llvm-svn: 21101
2005-04-05 20:51:46 +00:00
Nate Begeman 524417357c Behold, rlwinm with certain immediate arguments is printed as the much more
readable slwi or srwi (shift left/right word immediate).

llvm-svn: 21099
2005-04-05 18:19:50 +00:00
Nate Begeman a188b698a2 Fix cut & paste errors (32->64), and codegen float->int more optimally.
llvm-svn: 21098
2005-04-05 17:32:30 +00:00
Tanya Lattner 8d64e9a90d Updated to use dep analyzer.
llvm-svn: 21097
2005-04-05 16:36:44 +00:00
Nate Begeman 9203e169a7 Remove 64 bit simple ISel, it never worked correctly
Add initial (buggy) implementation of 64 bit pattern ISel

llvm-svn: 21096
2005-04-05 08:51:15 +00:00
Nate Begeman 4bde071216 Back out the previous change to SelectBranchCC, since there are cases it
could miscompile.  A correct solution will be found in the near future.

llvm-svn: 21095
2005-04-05 04:32:16 +00:00
Nate Begeman 9049e4beec 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.

llvm-svn: 21094
2005-04-05 04:22:58 +00:00
Chris Lattner 7e0a534cba do not crash when using -debug
llvm-svn: 21092
2005-04-05 01:12:03 +00:00
Nate Begeman d6933f5078 Implement SDIV by power of 2 as srawi/addze rather than load imm, divw
llvm-svn: 21091
2005-04-05 00:15:08 +00:00
Nate Begeman 1d5d767a09 Pattern match fp mul-add, mul-sub, neg-mul-add, and neg-mul-sub
llvm-svn: 21090
2005-04-04 23:40:36 +00:00
Nate Begeman d96350095c Add support for multiply-add, multiply-sub, and their negated versions
llvm-svn: 21089
2005-04-04 23:01:51 +00:00
Chris Lattner b919b21777 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

llvm-svn: 21088
2005-04-04 22:23:21 +00:00
Chris Lattner 0933766e2b new testcase
llvm-svn: 21087
2005-04-04 22:22:30 +00:00
Nate Begeman 1194531057 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.

llvm-svn: 21086
2005-04-04 22:17:48 +00:00
Nate Begeman c7186025de Remove unnecessary register copy now that regalloc is fixed
llvm-svn: 21085
2005-04-04 21:48:13 +00:00
Chris Lattner 6a6056e93d Make sure to notice that explicit physregs are used in the function
llvm-svn: 21084
2005-04-04 21:35:34 +00:00
Nate Begeman d753765460 i1 loads should also be from the low byte of the argument word.
llvm-svn: 21077
2005-04-04 09:09:00 +00:00
Nate Begeman 1ce4839890 Fix i64 return, fix CopyFromReg
llvm-svn: 21076
2005-04-04 06:52:38 +00:00
Duraid Madina 9935f44fb8 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)

llvm-svn: 21075
2005-04-04 05:05:52 +00:00
Duraid Madina dbc810022b add implicit use op
llvm-svn: 21074
2005-04-04 04:50:57 +00:00
Nate Begeman cc00a7c42d Handle expanding arguments to ISD::TRUNCATE. This happens on PowerPC when
you have something like i16 = truncate i64.  This fixes Regression/C/casts

llvm-svn: 21073
2005-04-04 00:57:08 +00:00
Chris Lattner 4784489de2 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.

llvm-svn: 21072
2005-04-03 23:41:52 +00:00
Nate Begeman 629cdaea39 Full varargs support. All of UnitTests now passes
llvm-svn: 21070
2005-04-03 23:11:17 +00:00
Nate Begeman 7a3e929efc Pass the correct value for the chain to the store
llvm-svn: 21066
2005-04-03 22:22:56 +00:00
Nate Begeman f6dc43bd46 Fix SHL_PARTS
Start implementation of integer varargs

llvm-svn: 21065
2005-04-03 22:13:27 +00:00
Andrew Lenharth 79e727e8a7 is this simpler? I think it is simpler.
llvm-svn: 21064
2005-04-03 20:35:21 +00:00
Andrew Lenharth 7ce5740de9 fix 101 regressions
llvm-svn: 21063
2005-04-03 18:24:50 +00:00
Duraid Madina 2f472ecb11 a wise man once said:
"!!!!!!!! IF YOU CHANGE SPACES TO TABS, YOU WILL BE KILLED!!!!!!"

llvm-svn: 21062
2005-04-03 14:57:35 +00:00
Duraid Madina 6c9afaead4 .bss is no problem here.
llvm-svn: 21061
2005-04-03 14:52:01 +00:00
Nate Begeman 34cc5b329f Keeping up with the Joneses.
Implement not, nor, nand, and eqv

llvm-svn: 21060
2005-04-03 11:20:20 +00:00
Andrew Lenharth 46897ab49e Select optimization
llvm-svn: 21051
2005-04-02 22:32:39 +00:00
Andrew Lenharth f029d795f0 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
llvm-svn: 21046
2005-04-02 21:06:51 +00:00
Chris Lattner d2df8ca403 fix some VC compilation problems, thanks to Jeff C for pointing this out!
llvm-svn: 21044
2005-04-02 20:17:09 +00:00
Chris Lattner a7913e66e1 EquivClassGraphs is now in DataStructure.h
llvm-svn: 21042
2005-04-02 20:08:17 +00:00
Chris Lattner 745c960672 merge EquivClassGraphs.h into DataStructure.h with the other DSA pass definitions.
llvm-svn: 21041
2005-04-02 20:08:06 +00:00
Chris Lattner 526cc17b55 use a callee_iterator typedef.
llvm-svn: 21038
2005-04-02 20:02:41 +00:00
Chris Lattner 63e3a262d8 add and use a callee_iterator typedef
llvm-svn: 21037
2005-04-02 20:02:32 +00:00
Chris Lattner 990ed1d201 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.

llvm-svn: 21031
2005-04-02 19:17:18 +00:00
Chris Lattner 637e42022f Change the ActualCallees callgraph from hash_multimap<Instruction,Function>
to std::set<std::pair<Inst,Func>> to avoid duplicate entries.

llvm-svn: 21030
2005-04-02 19:15:15 +00:00
Andrew Lenharth e7ae400bc8 FNEG/FABS/UNDEF
llvm-svn: 21029
2005-04-02 19:11:07 +00:00
Andrew Lenharth 7ad3697e1e FNEG/FABS
llvm-svn: 21028
2005-04-02 19:04:58 +00:00
Chris Lattner 04e0515937 this has now been fixed
llvm-svn: 21026
2005-04-02 16:17:57 +00:00
Duraid Madina 50b339b7fa 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.

llvm-svn: 21025
2005-04-02 12:30:47 +00:00
Duraid Madina 73a316d712 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(" / ")")

llvm-svn: 21024
2005-04-02 12:21:51 +00:00
Duraid Madina c935c833d1 support IDEF, fnegabs (thanks sampo)
llvm-svn: 21023
2005-04-02 10:33:53 +00:00
Duraid Madina 0ccac38ed3 add fnegabs op
llvm-svn: 21022
2005-04-02 10:06:27 +00:00
Nate Begeman 165cf4844e 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

llvm-svn: 21018
2005-04-02 05:59:34 +00:00
Chris Lattner 1d7052fad5 don't forget to use the right code generator :)
llvm-svn: 21017
2005-04-02 05:40:03 +00:00
Chris Lattner b4e122c59f new testcase
llvm-svn: 21016
2005-04-02 05:35:00 +00:00
Chris Lattner 0e0b599d29 add support for FABS and FNEG
llvm-svn: 21015
2005-04-02 05:30:17 +00:00
Chris Lattner 0c14000760 transform fabs/fabsf calls into FABS nodes.
llvm-svn: 21014
2005-04-02 05:26:53 +00:00
Chris Lattner a0c72cf289 Expand fabs into fneg
llvm-svn: 21013
2005-04-02 05:26:37 +00:00
Duraid Madina 0720dc14ed add support FNEG and FABS
llvm-svn: 21012
2005-04-02 05:18:38 +00:00
Chris Lattner f68fd0b533 Turn -0.0 - X -> fneg
llvm-svn: 21011
2005-04-02 05:04:50 +00:00
Chris Lattner 0b7e4cd107 This target doesn't support fabs/fneg yet.
llvm-svn: 21010
2005-04-02 05:03:24 +00:00
Chris Lattner 13fe99c807 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.

llvm-svn: 21009
2005-04-02 05:00:07 +00:00
Chris Lattner c4a2046a88 print fneg/fabs
llvm-svn: 21008
2005-04-02 04:58:41 +00:00
Chris Lattner b3183de8c6 Add two happy new nodes for FABS and FNEG
llvm-svn: 21007
2005-04-02 04:58:28 +00:00
Chris Lattner 2d451658a6 add an fabs instr
llvm-svn: 21006
2005-04-02 04:31:56 +00:00
Chris Lattner a31d4c7548 Add support for 64-bit shifts.
llvm-svn: 21005
2005-04-02 04:01:14 +00:00
Chris Lattner 4157c417a1 fix some bugs in the implementation of SHL_PARTS and friends.
llvm-svn: 21004
2005-04-02 04:00:59 +00:00
Chris Lattner 6f28fd388a fix a comment
llvm-svn: 21003
2005-04-02 03:59:45 +00:00
Chris Lattner 2e5872c671 Turn expanded shift operations into (e.g.) SHL_PARTS if the target supports it.
llvm-svn: 21002
2005-04-02 03:38:53 +00:00
Chris Lattner 5b7bb56ef8 Print some new nodes
llvm-svn: 21001
2005-04-02 03:30:42 +00:00
Chris Lattner dbd130cf46 add some new nodes.
llvm-svn: 21000
2005-04-02 03:30:33 +00:00
Chris Lattner 07f97d5f55 Fix a bug when inserting a libcall into a function with no other calls.
llvm-svn: 20999
2005-04-02 03:22:40 +00:00
Chris Lattner 07e3f7e1ff new generic testcsae
llvm-svn: 20996
2005-04-02 02:41:55 +00:00
Nate Begeman cfc452d088 Fix i64 returns
Generate PowerPC 'subfic' instruction when appropriate

llvm-svn: 20995
2005-04-02 00:42:16 +00:00
Nate Begeman 69d39433c4 Fix a warning about an unhandled switch case
llvm-svn: 20994
2005-04-02 00:41:14 +00:00
John Criswell 9f680da784 For Sparc, this xfails. I don't think sparc has the C99 complex data
type support.

llvm-svn: 20993
2005-04-01 23:16:23 +00:00
Chris Lattner f4b985d1f6 Add support for ISD::UNDEF to the X86 be
llvm-svn: 20990
2005-04-01 22:46:45 +00:00
Nate Begeman cda9aa7fa9 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.

llvm-svn: 20988
2005-04-01 22:34:39 +00:00
Chris Lattner 5053ea85fc Fix another PATypeHolder error, contributed by Bill Wendling!
llvm-svn: 20983
2005-04-01 15:41:30 +00:00
Duraid Madina 617af97040 repair mindless SELECT waste.
llvm-svn: 20982
2005-04-01 10:35:00 +00:00
Nate Begeman 1c3aea6019 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.

llvm-svn: 20981
2005-04-01 08:57:43 +00:00
Nate Begeman c9e50238c5 Also apply Chris's fix to FP select and SETCC
llvm-svn: 20979
2005-04-01 07:21:30 +00:00
Chris Lattner 9122b4c9c0 new testcase
llvm-svn: 20978
2005-04-01 07:19:06 +00:00
Chris Lattner ffc7f243fe 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.

llvm-svn: 20977
2005-04-01 07:10:02 +00:00
Chris Lattner 329c14a8bc print the machine CFG in the -print-machineinstrs dump
llvm-svn: 20976
2005-04-01 06:48:38 +00:00
Nate Begeman 2095f3b06b Fix stores to global addresses
Fix calls with no arguments

llvm-svn: 20975
2005-04-01 05:57:17 +00:00
Nate Begeman 839b34c367 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.

llvm-svn: 20973
2005-04-01 04:45:11 +00:00
Nate Begeman f4d91610ff Implement FP_TO_SINT and FP_TO_UINT
llvm-svn: 20972
2005-04-01 02:59:27 +00:00
Nate Begeman 508aac2ca8 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.

llvm-svn: 20970
2005-04-01 01:08:07 +00:00
Nate Begeman 4f3a9860d3 Factor out common code, support FP comparison in folded SetCC
llvm-svn: 20969
2005-04-01 00:32:34 +00:00
Nate Begeman 6215b35918 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

llvm-svn: 20968
2005-03-31 23:55:40 +00:00
Andrew Lenharth 3bf6f80588 make fp div trick dependend on flag
llvm-svn: 20967
2005-03-31 22:02:25 +00:00
Misha Brukman 9337e4c5ab Fix spelling of `corresponds'
llvm-svn: 20966
2005-03-31 21:30:35 +00:00
Andrew Lenharth dec53920b4 PCMarker support for DAG and Alpha
llvm-svn: 20965
2005-03-31 21:24:06 +00:00
Duraid Madina 21ce5f7a66 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. :)

llvm-svn: 20960
2005-03-31 12:31:11 +00:00
Duraid Madina ffb9d14bb3 * declare local common symbols as such (.lcomm, not merely .common)
* begin great adventure into correct function descriptor materialization

llvm-svn: 20956
2005-03-31 07:40:24 +00:00
Duraid Madina 8106f12d33 daintyness
llvm-svn: 20955
2005-03-31 07:36:43 +00:00
Duraid Madina 73c2777a0e 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)

llvm-svn: 20954
2005-03-31 07:32:32 +00:00
Nate Begeman eddfff338a 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!

llvm-svn: 20946
2005-03-31 02:05:53 +00:00
Nate Begeman 9de7ddf7d5 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.

llvm-svn: 20945
2005-03-31 00:15:26 +00:00
Nate Begeman 4c0780cf42 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

llvm-svn: 20944
2005-03-30 19:38:35 +00:00
Misha Brukman 9615809383 * Put command-line switches and function names in <tt>
* Add links to mailing lists and publications

llvm-svn: 20943
2005-03-30 19:14:24 +00:00
Andrew Lenharth e3d9f8c4f9 yea, fine Duraid
llvm-svn: 20942
2005-03-30 18:22:52 +00:00
Duraid Madina 722d514025 Add section for Itanium
llvm-svn: 20941
2005-03-30 05:33:54 +00:00
Nate Begeman a8114a0f48 Fix frame index code to generate legal PowerPC instructions. About half of
Shootout now works.

llvm-svn: 20940
2005-03-30 02:23:08 +00:00
Nate Begeman 5851a66128 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!

llvm-svn: 20939
2005-03-30 01:45:43 +00:00
Misha Brukman 650d1742f7 * Add section for Alpha
* Remove extraneous subsections

llvm-svn: 20938
2005-03-30 01:14:38 +00:00
Chris Lattner 5ca31d9831 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.

llvm-svn: 20937
2005-03-30 01:10:47 +00:00
Chris Lattner 472a265ef6 don't depend on the cfg being set up yet
llvm-svn: 20936
2005-03-30 01:10:00 +00:00
Nate Begeman 9c40e9c61f Fix BranchCC (it's still dumb), and implement FP select (also dumb)
llvm-svn: 20935
2005-03-29 22:48:55 +00:00
Nate Begeman 28145edd30 Implement integer select and i1 sign extend
llvm-svn: 20934
2005-03-29 22:24:51 +00:00
Nate Begeman 28c5ac9ff4 Implement SetCC, fix ZERO_EXTEND_INREG
llvm-svn: 20933
2005-03-29 21:54:38 +00:00
Chris Lattner af4d93cd39 import all of the rest of the stubs that dsa uses for direct comparison
llvm-svn: 20932
2005-03-29 20:36:05 +00:00
Tanya Lattner 91964490e2 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.
llvm-svn: 20931
2005-03-29 20:35:10 +00:00
Tanya Lattner 6e19b21e30 Dependence analyzer that just determines dependences within a loop for loads and stores using alias analysis.
llvm-svn: 20930
2005-03-29 20:33:42 +00:00
Chris Lattner 4dba2ee974 learn about some more functions.
llvm-svn: 20929
2005-03-29 20:04:24 +00:00
Andrew Lenharth 93d008990e Fix up some types and constants
llvm-svn: 20928
2005-03-29 19:24:04 +00:00
Chris Lattner 2e1971c19d Fix a problem where we not marking incoming arguments to functions with
external linkage as incomplete.

llvm-svn: 20927
2005-03-29 19:16:59 +00:00
Chris Lattner db45f7d763 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.

llvm-svn: 20926
2005-03-29 19:09:56 +00:00
Chris Lattner 8de8b7bf40 there is no point comparing against null pointer.
llvm-svn: 20925
2005-03-29 17:44:52 +00:00
Chris Lattner ca85130b0a 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)

llvm-svn: 20922
2005-03-29 17:21:53 +00:00
Chris Lattner 1ce9aacf2e fix a warning in the optimized build
llvm-svn: 20920
2005-03-29 15:13:27 +00:00
Chris Lattner dd94b2d01e add some more functions, ignore setcc for constraints!
llvm-svn: 20917
2005-03-29 06:52:20 +00:00
Chris Lattner ecfa9b5810 disable this transformation in the one obscure case that really pessimizes
pointer analysis.

llvm-svn: 20916
2005-03-29 06:37:47 +00:00
Chris Lattner 2c95fac918 there is no reason to run -instcombine -instcombine!
llvm-svn: 20915
2005-03-29 06:25:11 +00:00
Chris Lattner 7617e886c1 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

llvm-svn: 20914
2005-03-29 06:09:07 +00:00
Nate Begeman 60956dd52f Implement div, rem, and frameindex
llvm-svn: 20907
2005-03-29 00:03:27 +00:00
Nate Begeman 731bed10c7 Pattern ISel: fix argument loading for i64s (thanks chris)
Simple  ISel: fix i64 subtract

llvm-svn: 20903
2005-03-28 23:08:54 +00:00
Nate Begeman 66acad746f Remove fake instruction 'subc' (mnemonic for subfc).
More pattern isel updates

llvm-svn: 20902
2005-03-28 22:28:37 +00:00
Chris Lattner 32e08b7c06 implement legalization of build_pair for nate
llvm-svn: 20901
2005-03-28 22:03:13 +00:00
Andrew Lenharth b442791124 First step in adding pcmarker intrinsic. Second step (soon) is adding backend support.
llvm-svn: 20900
2005-03-28 20:05:49 +00:00
Nate Begeman 5bdfc63516 Implement proper loads and zero-extends of all types
llvm-svn: 20897
2005-03-28 19:36:43 +00:00
Duraid Madina bdbf8ba2d0 Emit .global @function and .global @object entries so the Intel ias
assembler may be used; identify LLVM output as such.

llvm-svn: 20892
2005-03-28 15:21:43 +00:00
Chris Lattner 81b6d86a3a Teach andersens that non-escaping memory cannot be mod/ref'd by external fn calls.
llvm-svn: 20891
2005-03-28 06:21:17 +00:00
Misha Brukman 009585d2ac Fix grammar
llvm-svn: 20890
2005-03-28 04:32:12 +00:00
Chris Lattner a8ad8b2826 Make anders-aa much more precise by not being completely pessimistic about
external functions.  Teach it about a few important ones.

llvm-svn: 20889
2005-03-28 04:03:52 +00:00
Jeff Cohen 03332ecf17 Fix VC++ build breakage
llvm-svn: 20888
2005-03-28 02:52:28 +00:00
Alkis Evlogimenos 9ead0d7b4c Rename createPromoteMemoryToRegister() to
createPromoteMemoryToRegisterPass() to be consistent with other pass
creation functions.

llvm-svn: 20885
2005-03-28 02:01:12 +00:00
Chris Lattner 147f8b789c wrap some long lines
llvm-svn: 20884
2005-03-27 22:03:46 +00:00
Chris Lattner 2db10ba297 remove ...
llvm-svn: 20883
2005-03-27 21:57:09 +00:00
Chris Lattner f290da862d speed up steens by using spliceFrom, improve its precision by realizing that
an incomplete node cannot alias a complete node.

llvm-svn: 20882
2005-03-27 21:56:55 +00:00
Chris Lattner ea69f1f9e8 teach andersens about undef
llvm-svn: 20881
2005-03-27 18:58:23 +00:00
Chris Lattner 82166467c3 Don't give up completely, maybe other AA can say something about this.
llvm-svn: 20873
2005-03-27 00:02:33 +00:00
Chris Lattner 3f08e7899f 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)

llvm-svn: 20872
2005-03-26 23:56:33 +00:00
Chris Lattner 2ba37389c9 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

llvm-svn: 20871
2005-03-26 23:29:03 +00:00
Chris Lattner 139f43b340 Remove more long dead code: dsa doesn't provide must alias info
llvm-svn: 20870
2005-03-26 22:54:46 +00:00
Chris Lattner 1a02d15dab remove some unsafe code that has long been dead
llvm-svn: 20869
2005-03-26 22:48:42 +00:00
Chris Lattner 9cc932d3b3 slightly improve mod/ref for DSAA by checking the globals graph for fallback
llvm-svn: 20868
2005-03-26 22:47:03 +00:00
Chris Lattner b3baff1830 Teach steens-aa two things about mod/ref information:
1. If memory never escapes the program, it cannot be mod/ref'd by external
     functions.
  2. If memory is global never mod/ref'd in the program, it cannot be mod/ref'd
     by any call.

llvm-svn: 20867
2005-03-26 22:43:20 +00:00
Chris Lattner 68ee8f572c Interchange this loop so that we test all pointers against one call site
before moving on to the next call site.  This will be a more efficient way
to compute the mod/ref set for AA implementations like DSA.

llvm-svn: 20866
2005-03-26 22:16:44 +00:00
Nate Begeman 518a994b7d Fix that pesky floats in integer regs problem by assigning the f32 type to
the correct register class.  Also remove the loading of float data into int
regs part of varargs; it will need to be implemented differently later.

llvm-svn: 20857
2005-03-26 08:25:22 +00:00
Nate Begeman dcad53e7bd Get closer to having varargs working. There's still something strange
going on with copies between floating point and integer register files
being generated.  Once that is solved, varargs will be done.

llvm-svn: 20856
2005-03-26 07:46:36 +00:00
Nate Begeman c95bf7b226 Make 64bit args and float args work correct with calls. Thanks to Chris
for explaining EXTRACT_ELEMENT to me.

llvm-svn: 20847
2005-03-26 02:17:46 +00:00
Nate Begeman 0bea1090dd Change LowerCallTo to take a boolean isVarArg argument. This is needed
by the PowerPC backend, and probably others in the future.

llvm-svn: 20843
2005-03-26 01:30:30 +00:00
Nate Begeman f656525cb6 Change interface to LowerCallTo to take a boolean isVarArg argument.
llvm-svn: 20842
2005-03-26 01:29:23 +00:00
Nate Begeman e70b5c79f8 Next round of pattern isel changes, mostly dealing with calls.
llvm-svn: 20841
2005-03-26 01:28:53 +00:00
Nate Begeman 5d7610de65 Correct a documention link
llvm-svn: 20840
2005-03-26 01:28:05 +00:00
Chris Lattner d21e220035 no really, don't double count these nodes either!
llvm-svn: 20837
2005-03-25 20:54:45 +00:00
Chris Lattner b7ffd50537 Don't count all of the nodes in the SCC once for each function in the SCC.
llvm-svn: 20836
2005-03-25 20:37:32 +00:00
Chris Lattner 5ecec08ab5 Grow the EQ classes for globals at the end of the BU pass. This shrinks
memory usage in the TD pass for 254.gap from 31.3MB to 3.9MB.

llvm-svn: 20834
2005-03-25 16:45:43 +00:00
Chris Lattner d6e6b38918 fix the RUN line on this testcase so it passes.
llvm-svn: 20833
2005-03-25 15:36:19 +00:00
Nate Begeman 0ad33afe22 Support global addresses and fix call returns. Varargs still aren't
handled correctly for floating point arguments, or more than 8 arguemnts.
This does however, allow hello world to run.

llvm-svn: 20832
2005-03-25 08:34:25 +00:00
Chris Lattner 514e843e89 Enhance loopsimplify to preserve alias analysis instead of clobbering it.
This prevents crashes on some programs when using -ds-aa -licm.

llvm-svn: 20831
2005-03-25 06:37:22 +00:00
Chris Lattner 8d9f3735cd Treat free operations as volatile, since they cannot be moved. This fixes
Transforms/LICM/2005-03-24-LICM-Aggregate-Crash.ll

llvm-svn: 20830
2005-03-25 05:49:37 +00:00
Chris Lattner b99c93c93b New testcase that crashes licm.
llvm-svn: 20829
2005-03-25 05:49:13 +00:00
Chris Lattner faf7791fea Fix a bug where LICM was not updating AA information properly when sinking
a pointer value out of a loop causing it to be duplicated.

llvm-svn: 20828
2005-03-25 00:22:36 +00:00
Chris Lattner 3322e28f75 remove a debugging timer.
llvm-svn: 20827
2005-03-25 00:06:09 +00:00
Chris Lattner 278bac843c Two changes here:
1. Instead of copying Local graphs to the BU graphs to start with, use
     spliceFrom to do the job (which is constant time in this case).  On
     176.gcc, this chops off .17s from the bu pass.
  2. When building SCC graphs, simplify the logic and use spliceFrom to
     do the heavy lifting, instead of cloneInto/delete.  This slices
     another .14s off 176.gcc.

llvm-svn: 20826
2005-03-25 00:05:04 +00:00
Chris Lattner a396eb8ae9 Make the spliceFrom case where one graph is completely empty be constant time.
llvm-svn: 20825
2005-03-25 00:02:41 +00:00
Chris Lattner 127dd12427 add a new DSGraph::spliceFrom method, which violently takes the content of
one graph and plops it into another, without breaking a sweat.

llvm-svn: 20824
2005-03-24 23:46:04 +00:00
Chris Lattner 56787258e7 add new spliceFrom methods.
llvm-svn: 20823
2005-03-24 23:45:20 +00:00
Nate Begeman ad5151d785 Implement next round of Pattern ISel fixes
1. void returns
2. multiplies
3. calls

llvm-svn: 20822
2005-03-24 23:35:30 +00:00
Nate Begeman 3a9a2f9ec7 Fix an incorrect argument being passed to BuildMI for indirect calls.
llvm-svn: 20821
2005-03-24 23:34:38 +00:00
Chris Lattner 301764e28c This replaces the correct but slow code with a more aggressive scc-finder
based approach to find globals and call sites that need to be copied.  This
speeds up the BU pass on 176.gcc from 22s back up to 2.3s.  Not as good
as 1.5s, but at least it's correct :)

llvm-svn: 20820
2005-03-24 23:06:02 +00:00
Chris Lattner 1b5b559011 only look at successors of globals. This gets us down to "only" 22s in the
bu pass for 176.gcc

llvm-svn: 20818
2005-03-24 21:17:27 +00:00
Chris Lattner 189d7bb9ee Unfortunately, a previous patch was not safe. Revert it, reimplement
something correct. Unfortunately this takes 176.gcc's BU phase back
up to 29s from 1.5.  This fixes DSGraph/2005-03-24-Global-Arg-Alias.ll

llvm-svn: 20817
2005-03-24 21:07:47 +00:00
Nate Begeman d73c87a424 Commit Gabor Greif's patch to use iterators in lowering intrinsics.
llvm-svn: 20816
2005-03-24 20:07:16 +00:00
Chris Lattner 923d925953 don't bother |'ing in 0's
llvm-svn: 20815
2005-03-24 18:42:51 +00:00
Chris Lattner ba6006d84b be more aggressive about incompleteness marking
llvm-svn: 20814
2005-03-24 18:42:28 +00:00
Chris Lattner 299be4b42f new testcase that DS-AA is causing to be miscompiled.
llvm-svn: 20813
2005-03-24 17:57:43 +00:00