Commit Graph

358 Commits

Author SHA1 Message Date
Evan Cheng
270d0f986f Enhance EmitInstrWithCustomInserter() so target can specify CFG changes that sdisel will use to properly complete phi nodes.
Not functionality change yet.

llvm-svn: 82273
2009-09-18 21:02:19 +00:00
Sandeep Patel
68c5f477fa Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.
llvm-svn: 80773
2009-09-02 08:44:58 +00:00
Chris Lattner
317dbbcfb1 eliminate uses of cerr()
llvm-svn: 79834
2009-08-23 07:05:07 +00:00
Anton Korobeynikov
47398930e4 Expand few nodes until someone will be crazy enough to implement them natively :)
llvm-svn: 79659
2009-08-21 18:52:42 +00:00
Anton Korobeynikov
a39f96c6ed Handle 'r' inline asm constraint
llvm-svn: 79648
2009-08-21 18:15:41 +00:00
Owen Anderson
9f94459d24 Split EVT into MVT and EVT, the former representing _just_ a primitive type, while
the latter is capable of representing either a primitive or an extended type.

llvm-svn: 78713
2009-08-11 20:47:22 +00:00
Owen Anderson
53aa7a960c Rename MVT to EVT, in preparation for splitting SimpleValueType out into its own struct type.
llvm-svn: 78610
2009-08-10 22:56:29 +00:00
Dan Gohman
f9bbcd1afd Major calling convention code refactoring.
Instead of awkwardly encoding calling-convention information with ISD::CALL,
ISD::FORMAL_ARGUMENTS, ISD::RET, and ISD::ARG_FLAGS nodes, TargetLowering
provides three virtual functions for targets to override:
LowerFormalArguments, LowerCall, and LowerRet, which replace the custom
lowering done on the special nodes. They provide the same information, but
in a more immediately usable format.

This also reworks much of the target-independent tail call logic. The
decision of whether or not to perform a tail call is now cleanly split
between target-independent portions, and the target dependent portion
in IsEligibleForTailCallOptimization.

This also synchronizes all in-tree targets, to help enable future
refactoring and feature work.

llvm-svn: 78142
2009-08-05 01:29:28 +00:00
Chris Lattner
5e693ed07b Rip all of the global variable lowering logic out of TargetAsmInfo. Since
it is highly specific to the object file that will be generated in the end,
this introduces a new TargetLoweringObjectFile interface that is implemented
for each of ELF/MachO/COFF/Alpha/PIC16 and XCore.

Though still is still a brutal and ugly refactoring, this is a major step
towards goodness.

This patch also:
1. fixes a bunch of dangling pointer problems in the PIC16 backend.
2. disables the TargetLowering copy ctor which PIC16 was accidentally using.
3. gets us closer to xcore having its own crazy target section flags and
   pic16 not having to shadow sections with its own objects.
4. fixes wierdness where ELF targets would set CStringSection but not
   CStringSection_.  Factor the code better.
5. fixes some bugs in string lowering on ELF targets.

llvm-svn: 77294
2009-07-28 03:13:23 +00:00
Owen Anderson
47db941fd3 Get rid of the Pass+Context magic.
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Eli Friedman
1f74b1fdfd Missed a piece of the commit to remove the shift flavor.
llvm-svn: 76635
2009-07-21 20:15:24 +00:00
Anton Korobeynikov
8486df0ed2 Expand frem
llvm-svn: 76315
2009-07-18 13:44:25 +00:00
Anton Korobeynikov
de5e015bfd Turn abort() into unreachable
llvm-svn: 76314
2009-07-18 13:34:59 +00:00
Anton Korobeynikov
30b1c2f636 Turn few asserts into errors / unreachable's
llvm-svn: 76313
2009-07-18 13:33:17 +00:00
Anton Korobeynikov
39f2a22401 Provide expansion for ct* intrinsics
llvm-svn: 76311
2009-07-18 12:26:13 +00:00
Anton Korobeynikov
c3b10f0677 Expand sext_inreg for i1
llvm-svn: 76310
2009-07-18 12:20:36 +00:00
Anton Korobeynikov
02fc607d54 Unbreak
llvm-svn: 76064
2009-07-16 14:36:52 +00:00
Anton Korobeynikov
4121039bef Expand 32-bit bitconverts via memory
llvm-svn: 76050
2009-07-16 14:30:29 +00:00
Anton Korobeynikov
a293caf2ed i32 values are passed extended also on stack. Handle this in generic way
llvm-svn: 76047
2009-07-16 14:29:05 +00:00
Anton Korobeynikov
1fa01d307c We definitely have 1-0 bools
llvm-svn: 76046
2009-07-16 14:28:46 +00:00
Anton Korobeynikov
6fb6e09781 Out GR128 regclass is not a 'real' i128 one.
llvm-svn: 76044
2009-07-16 14:27:53 +00:00
Anton Korobeynikov
6c01db428f Handle bitconverts
llvm-svn: 76042
2009-07-16 14:27:01 +00:00
Anton Korobeynikov
573fab1879 Expand fp_to_uint too
llvm-svn: 76040
2009-07-16 14:26:06 +00:00
Anton Korobeynikov
d57f8cee1d We don't have FP truncstores
llvm-svn: 76039
2009-07-16 14:25:46 +00:00
Anton Korobeynikov
3f254d536a Expand uint_to_fp
llvm-svn: 76038
2009-07-16 14:25:30 +00:00
Anton Korobeynikov
8c18d8972c Make FP zero to be legal FP immediate via LOAD ZERO
llvm-svn: 76034
2009-07-16 14:24:16 +00:00
Anton Korobeynikov
871784ba88 Proper FP extloads
llvm-svn: 76028
2009-07-16 14:22:46 +00:00
Anton Korobeynikov
12400008a7 Add proper PWS impdef's
llvm-svn: 76027
2009-07-16 14:22:30 +00:00
Anton Korobeynikov
3c44a39156 Propagate FP select_cc to dag inserters
llvm-svn: 76026
2009-07-16 14:22:15 +00:00
Anton Korobeynikov
d7416e7c0b We don't have native sine / cosine instructions
llvm-svn: 76021
2009-07-16 14:20:56 +00:00
Anton Korobeynikov
45a56de726 We don't have any FP extloads
llvm-svn: 76018
2009-07-16 14:20:08 +00:00
Anton Korobeynikov
ead9b9fb31 Implement all comparisons
llvm-svn: 76017
2009-07-16 14:19:54 +00:00
Anton Korobeynikov
7cb00653c1 Add constpool lowering / printing
llvm-svn: 76016
2009-07-16 14:19:35 +00:00
Anton Korobeynikov
c806cea4cb Allow FP arguments pass / return
llvm-svn: 76015
2009-07-16 14:19:16 +00:00
Anton Korobeynikov
923b47e89d Register FP regclasses
llvm-svn: 76014
2009-07-16 14:19:02 +00:00
Anton Korobeynikov
091872cb37 Implement 'large' PIC model
llvm-svn: 76006
2009-07-16 14:16:05 +00:00
Anton Korobeynikov
569a94c4d0 Implement shifts properly (hopefilly - finally!)
llvm-svn: 76005
2009-07-16 14:15:24 +00:00
Anton Korobeynikov
fe8df8ff61 Properly handle divides. As a bonus - implement memory versions of them.
llvm-svn: 76003
2009-07-16 14:14:33 +00:00
Anton Korobeynikov
43d33bd6d2 Emit proper lowering of load from arg stack slot
llvm-svn: 75986
2009-07-16 14:08:42 +00:00
Anton Korobeynikov
a8197bb651 Implement dynamic allocas
llvm-svn: 75985
2009-07-16 14:08:15 +00:00
Anton Korobeynikov
7193e2670e Add jump tables
llvm-svn: 75984
2009-07-16 14:07:50 +00:00
Anton Korobeynikov
5dfac244a0 Exapnd br_jt into indirect branch. Provide pattern for indirect branches.
llvm-svn: 75983
2009-07-16 14:07:24 +00:00
Anton Korobeynikov
d568f6dce2 Proper lower 'small' results
llvm-svn: 75962
2009-07-16 13:58:24 +00:00
Anton Korobeynikov
15d6e8785b Lower addresses of globals
llvm-svn: 75960
2009-07-16 13:57:27 +00:00
Anton Korobeynikov
f0d7d6ce65 Provide "wide" muls and divs/rems
llvm-svn: 75958
2009-07-16 13:56:42 +00:00
Anton Korobeynikov
071178ea15 Preliminary mul lowering
llvm-svn: 75951
2009-07-16 13:53:55 +00:00
Anton Korobeynikov
23e3c6657c More extloads
llvm-svn: 75950
2009-07-16 13:53:35 +00:00
Anton Korobeynikov
0f59e1e874 SELECT_CC lowering
llvm-svn: 75948
2009-07-16 13:52:51 +00:00
Anton Korobeynikov
ac4fb7f977 Conditional branches and comparisons
llvm-svn: 75947
2009-07-16 13:52:31 +00:00
Anton Korobeynikov
11665a64b0 Emit correct offset for PseudoSourceValue
llvm-svn: 75946
2009-07-16 13:52:10 +00:00
Anton Korobeynikov
29329a0695 Provide proper stack offsets for outgoing arguments
llvm-svn: 75945
2009-07-16 13:51:53 +00:00
Anton Korobeynikov
d694b9ff8b Some preliminary call lowering
llvm-svn: 75941
2009-07-16 13:50:21 +00:00
Anton Korobeynikov
df99232d27 Add mem-imm stores
llvm-svn: 75933
2009-07-16 13:47:14 +00:00
Anton Korobeynikov
04be818918 Add shifts and reg-imm address matching
llvm-svn: 75927
2009-07-16 13:43:18 +00:00
Anton Korobeynikov
cf7ea6a94f Add bunch of 32-bit patterns... Uffff :)
llvm-svn: 75926
2009-07-16 13:42:31 +00:00
Anton Korobeynikov
293324104b Add 32 bit subregs
llvm-svn: 75923
2009-07-16 13:35:30 +00:00
Anton Korobeynikov
cf4ba97dba Minimal lowering for formal_arguments / ret
llvm-svn: 75911
2009-07-16 13:28:59 +00:00
Anton Korobeynikov
c334c28b3b Let's start another backend :)
llvm-svn: 75909
2009-07-16 13:27:25 +00:00