1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 22:42:46 +02:00
Commit Graph

929 Commits

Author SHA1 Message Date
Chris Lattner
d62ecab2e3 Use getSectionForFunction
llvm-svn: 30739
2006-10-05 02:48:40 +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
Anton Korobeynikov
6e19f80688 Adding dllimport, dllexport and external weak linkage types.
DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.

llvm-svn: 30374
2006-09-14 18:23:27 +00:00
Evan Cheng
dd52a60189 Reflects MachineConstantPoolEntry changes.
llvm-svn: 30279
2006-09-12 21:04:05 +00:00
Jim Laskey
160a8aa339 1. Remove condition on delete.
2. Protect and outline createTargetAsmInfo.

3. Misc. kruft.

llvm-svn: 30169
2006-09-07 23:39:26 +00:00
Jim Laskey
9da25f6119 Make target asm info a property of the target machine.
llvm-svn: 30162
2006-09-07 22:06:40 +00:00
Jim Laskey
a64fe8ccf2 Break out target asm info into separate files.
llvm-svn: 30161
2006-09-07 22:05:02 +00:00
Jim Laskey
6b86ef852c Separate target specific asm properties from the asm printers.
llvm-svn: 30126
2006-09-06 18:34:40 +00:00
Chris Lattner
9cd4e3429e Completely eliminate def&use operands. Now a register operand is EITHER a
def operand or a use operand.

llvm-svn: 30109
2006-09-05 02:31:13 +00:00
Chris Lattner
33c9ddc91d Completely rearchitect the interface between targets and the pass manager.
This pass:

1. Splits TargetMachine into TargetMachine (generic targets, can be implemented
any way, like the CBE) and LLVMTargetMachine (subclass of TM that is used by
things using libcodegen and other support).
2. Instead of having each target fully populate the passmgr for file or JIT
   output, move all this to common code, and give targets hooks they can
   implement.
3. Commonalize the target population stuff between file emission and JIT
   emission.
4. All (native code) codegen stuff now happens in a FunctionPassManager, which
   paves the way for "fast -O0" stuff in the CFE later, and now LLC could
   lazily stream .bc files from disk to use less memory.
5. There are now many fewer #includes and the targets don't depend on the
   scalar xforms or libanalysis anymore (but codegen does).
6. Changing common code generator pass ordering stuff no longer requires
   touching all targets.
7. The JIT now has the option of "-fast" codegen or normal optimized codegen,
   which is now orthogonal to the fact that JIT'ing is being done.

llvm-svn: 30081
2006-09-04 04:14:57 +00:00
Chris Lattner
fb12884be6 Simplify target construction.
llvm-svn: 30070
2006-09-03 18:44:02 +00:00
Chris Lattner
fa87f12b85 Use a couple of multiclass patterns to factor some integer ops.
llvm-svn: 30039
2006-09-01 22:28:02 +00:00
Chris Lattner
04b7417f40 remove a bunch of comments
llvm-svn: 30038
2006-09-01 22:16:22 +00:00
Evan Cheng
1c3d571e4b SelectNodeTo now returns a SDNode*.
llvm-svn: 29901
2006-08-26 08:00:10 +00:00
Evan Cheng
2db7799507 Select() no longer require Result operand by reference.
llvm-svn: 29898
2006-08-26 05:34:46 +00:00
Evan Cheng
b246ad7b2f Match tblgen changes.
llvm-svn: 29895
2006-08-26 01:07:58 +00:00
Chris Lattner
db290f7479 Constify some methods. Patch provided by Anton Vayvod, thanks!
llvm-svn: 29756
2006-08-17 22:00:08 +00:00
Evan Cheng
7fb75bbc8d SelectNodeTo() may return a SDOperand that is different from the input.
llvm-svn: 29726
2006-08-16 07:30:09 +00:00
Evan Cheng
6053206580 Match tablegen changes.
llvm-svn: 29604
2006-08-11 09:08:15 +00:00
Evan Cheng
34a49551f5 CALLSEQ_* produces chain even if that's not needed.
llvm-svn: 29603
2006-08-11 09:03:33 +00:00
Chris Lattner
7b1362fa52 Start eliminating temporary vectors used to create DAG nodes. Instead, pass
in the start of an array and a count of operands where applicable.  In many
cases, the number of operands is known, so this static array can be allocated
on the stack, avoiding the heap.  In many other cases, a SmallVector can be
used, which has the same benefit in the common cases.

I updated a lot of code calling getNode that takes a vector, but ran out of
time.  The rest of the code should be updated, and these methods should be
removed.

We should also do the same thing to eliminate the methods that take a
vector of MVT::ValueTypes.

It would be extra nice to convert the dagiselemitter to avoid creating vectors
for operands when calling getTargetNode.

llvm-svn: 29566
2006-08-08 02:23:42 +00:00
Evan Cheng
d18be1d9c1 Match tablegen isel changes.
llvm-svn: 29549
2006-08-07 22:28:20 +00:00
Evan Cheng
3b5f1c6248 Remove InFlightSet hack. No longer needed.
llvm-svn: 29373
2006-07-28 00:47:19 +00:00
Chris Lattner
6a9ec7e80e Don't pass target name into TargetData anymore, it is never used or needed.
Remove explicit casts to std::string now that there is no overload resolution
issues in the TargetData ctors.

llvm-svn: 28830
2006-06-16 18:22:52 +00:00
Evan Cheng
32feafd76c Type of extract_element index operand should be iPTR.
llvm-svn: 28797
2006-06-15 08:18:06 +00:00
Evan Cheng
de0f25081a Change RET node to include signness information of the return values. i.e.
RET chain, value1, sign1, value2, sign2, ...

llvm-svn: 28510
2006-05-26 23:10:12 +00:00
Chris Lattner
5e1d6724da Add support for the missing FP condition codes
llvm-svn: 28482
2006-05-25 22:26:02 +00:00
Evan Cheng
09942d3f8b Assert if InflightSet is not cleared after instruction selecting a BB.
llvm-svn: 28459
2006-05-25 00:24:28 +00:00
Evan Cheng
b040dd86af Clear HandleMap and ReplaceMap after instruction selection. Or it may cause
non-deterministic behavior.

llvm-svn: 28454
2006-05-24 20:46:25 +00:00
Chris Lattner
f604017e47 Patches to make the LLVM sources more -pedantic clean. Patch provided
by Anton Korobeynikov!  This is a step towards closing PR786.

llvm-svn: 28447
2006-05-24 17:04:05 +00:00
Owen Anderson
b2ac706286 Sparc is big-endian.
llvm-svn: 28415
2006-05-20 00:49:30 +00:00
Owen Anderson
c6947bf2ce Make all of the TargetMachine subclasses use the new string TargetData methods.
This is part of the on-going work on PR 761.

llvm-svn: 28414
2006-05-20 00:24:56 +00:00
Evan Cheng
667b133ab9 getCalleeSaveRegs and getCalleeSaveRegClasses are no long TableGen'd.
llvm-svn: 28378
2006-05-18 00:12:58 +00:00
Evan Cheng
ea24815aa3 Remove PointerType from class Target
llvm-svn: 28368
2006-05-17 21:20:27 +00:00
Chris Lattner
2c316c91e8 Remove dead variable.
llvm-svn: 28247
2006-05-12 17:31:21 +00:00
Owen Anderson
29e4d70aed Refactor a bunch of includes so that TargetMachine.h doesn't have to include
TargetData.h.  This should make recompiles a bit faster with my current
TargetData tinkering.

llvm-svn: 28238
2006-05-12 06:33:49 +00:00
Chris Lattner
f45b6d5c08 Split SwitchSection into SwitchTo{Text|Data}Section methods.
llvm-svn: 28184
2006-05-09 04:59:56 +00:00
Chris Lattner
71c68064f9 Some notes and thoughts to myself
llvm-svn: 28182
2006-05-09 04:58:46 +00:00
Chris Lattner
eb41c99161 Rename MO_VirtualRegister -> MO_Register. Clean up immediate handling.
llvm-svn: 28104
2006-05-04 18:05:43 +00:00
Chris Lattner
685568510a Move some methods out of MachineInstr into MachineOperand
llvm-svn: 28102
2006-05-04 17:52:23 +00:00
Chris Lattner
97f1af2f14 There shalt be only one "immediate" operand type!
llvm-svn: 28099
2006-05-04 17:21:20 +00:00
Chris Lattner
c779fca289 Remove a bunch more SparcV9 specific stuff
llvm-svn: 28093
2006-05-04 01:15:02 +00:00
Chris Lattner
0f89e6b11d Remove some more unused stuff from MachineInstr that was leftover from V9.
llvm-svn: 28091
2006-05-04 00:44:25 +00:00
Owen Anderson
71bc529dfa Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses. This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.
This fixes PR 759.

llvm-svn: 28074
2006-05-03 01:29:57 +00:00
Nate Begeman
05174045df Extend printBasicBlockLabel a bit so that it can be used to print all
basic block labels, consolidating the code to do so in one place for each
target.

llvm-svn: 28050
2006-05-02 05:37:32 +00:00
Nate Begeman
7ed816f900 JumpTable support! What this represents is working asm and jit support for
x86 and ppc for 100% dense switch statements when relocations are non-PIC.
This support will be extended and enhanced in the coming days to support
PIC, and less dense forms of jump tables.

llvm-svn: 27947
2006-04-22 18:53:45 +00:00
Reid Spencer
b08854af39 Add the README files to the distribution.
llvm-svn: 27651
2006-04-13 06:39:24 +00:00
Nate Begeman
6cdc599d05 Disable switch lowering for targets based on the selection dag isel,
letting the code generator handle them directly.

llvm-svn: 27539
2006-04-08 19:46:55 +00:00
Jim Laskey
b93bc75add Foundation for call frame information.
llvm-svn: 27491
2006-04-07 16:34:46 +00:00
Jim Laskey
eb38a3e83a Expose base register for DwarfWriter. Refactor code accordingly.
llvm-svn: 27225
2006-03-28 13:48:33 +00:00
Jim Laskey
8688957c53 Translate llvm target registers to dwarf register numbers properly.
llvm-svn: 27180
2006-03-27 20:18:45 +00:00
Nate Begeman
3d518334b9 SelectionDAGISel can now natively handle Switch instructions, in the same
manner that the LowerSwitch LLVM to LLVM pass does: emitting a binary
search tree of basic blocks.  The new approach has several advantages:
it is faster, it generates significantly smaller code in many cases, and
it paves the way for implementing dense switch tables as a jump table by
handling switches directly in the instruction selector.

This functionality is currently only enabled on x86, but should be safe for
every target.  In anticipation of making it the default, the cfg is now
properly updated in the x86, ppc, and sparc select lowering code.

llvm-svn: 27156
2006-03-27 01:32:24 +00:00
Chris Lattner
e199d55073 #include Intrinsics.h into all dag isels
llvm-svn: 27109
2006-03-25 06:47:10 +00:00
Jim Laskey
37a8c245ce D'oh - should be even numbered.
llvm-svn: 27088
2006-03-24 22:48:02 +00:00
Jim Laskey
1716e53341 Add dwarf register numbering to register data.
llvm-svn: 27081
2006-03-24 21:15:58 +00:00
Jim Laskey
cec9c18c62 Add support to locate local variables in frames (early version.)
llvm-svn: 26994
2006-03-23 18:12:57 +00:00
Chris Lattner
89e0790edb Eliminate IntrinsicLowering from TargetMachine.
Make the CBE and V9 backends create their own, since they're the only ones that use it.

llvm-svn: 26974
2006-03-23 05:43:16 +00:00
Nate Begeman
42736d46b2 Remove BRTWOWAY*
Make the PPC backend not dependent on BRTWOWAY_CC and make the branch
selector smarter about the code it generates, fixing a case in the
readme.

llvm-svn: 26814
2006-03-17 01:40:33 +00:00
Chris Lattner
125881e75b Add support for 'special' llvm globals like debug info and static ctors/dtors.
llvm-svn: 26628
2006-03-09 06:14:35 +00:00
Chris Lattner
6b0947c277 Copysign needs to be expanded everywhere. Note that Alpha and IA64 should
implement copysign as a native op if they have it.

llvm-svn: 26541
2006-03-05 05:08:37 +00:00
Chris Lattner
da5029790a Don't print constant initializers, they may span lines now.
llvm-svn: 26403
2006-02-27 20:09:23 +00:00
Chris Lattner
dfdfc6b22d The HasNoV9 hack isn't needed here, now that tblgen knows that CustomDAGSchedInserter
instructions are expensive.

llvm-svn: 26298
2006-02-21 18:04:32 +00:00
Nate Begeman
9c0ab71f4a kill ADD_PARTS & SUB_PARTS and replace them with fancy new ADDC, ADDE, SUBC
and SUBE nodes that actually expose what's going on and allow for
significant simplifications in the targets.

llvm-svn: 26255
2006-02-17 05:43:56 +00:00
Nate Begeman
0bc71999b9 Rework the SelectionDAG-based implementations of SimplifyDemandedBits
and ComputeMaskedBits to match the new improved versions in instcombine.
Tested against all of multisource/benchmarks on ppc.

llvm-svn: 26238
2006-02-16 21:11:51 +00:00
Chris Lattner
e75debf037 Sparc actually *DOES* have a directive for emitting zeros. In fact, it requires
it, because this:

.bss
X:
.byte 0

results in the assembler warning: "initialization in bss segment".  Annoying.

llvm-svn: 26204
2006-02-15 07:07:14 +00:00
Chris Lattner
8e7f48c96d Fix SingleSource/Regression/C/2004-08-12-InlinerAndAllocas.c on Sparc.
The ABI specifies that there is a register save area at the bottom of the
stack, which means the actual used pointer needs to be an offset from
the subtracted value.

llvm-svn: 26202
2006-02-15 06:41:34 +00:00
Chris Lattner
599b432345 Switch targets over to using SelectionDAG::getCALLSEQ_START to create
CALLSEQ_START nodes.

llvm-svn: 26143
2006-02-13 09:00:43 +00:00
Chris Lattner
f8458d73bb Use the auto-generated call matcher. Remove a broken impl of the frameaddr/returnaddr
intrinsics.

Autogen frameindex matcher

llvm-svn: 26107
2006-02-10 07:35:42 +00:00
Chris Lattner
0dc11e140e Update to new-style flags usage, simplifying the .td file
llvm-svn: 26106
2006-02-10 06:58:25 +00:00
Chris Lattner
4e9d16a0ad Done
llvm-svn: 26091
2006-02-09 20:00:19 +00:00
Chris Lattner
5a10d24e67 Enable LSR by default for SPARC: it is a clear win.
llvm-svn: 26090
2006-02-09 19:59:55 +00:00
Evan Cheng
6bd0f9c4ba Match getTargetNode() changes (now return SDNode* instead of SDOperand).
llvm-svn: 26085
2006-02-09 07:17:49 +00:00
Chris Lattner
8eae5f68d5 add an option to turn on LSR.
llvm-svn: 26080
2006-02-09 05:06:36 +00:00
Chris Lattner
c81f375f21 Adjust to MachineConstantPool interface change: instead of keeping a
value/alignment pair for each constant, keep a value/offset pair.

llvm-svn: 26078
2006-02-09 04:46:04 +00:00
Evan Cheng
521e5a1bfe Change Select() from
SDOperand Select(SDOperand N);
to
void Select(SDOperand &Result, SDOperand N);

llvm-svn: 26067
2006-02-09 00:37:58 +00:00
Chris Lattner
c0012f8818 Fix the Sparc backend with Evan's recent tblgen changes
llvm-svn: 26009
2006-02-05 08:35:50 +00:00
Evan Cheng
973e4051d6 Use SelectRoot() as the entry to any tblgen based isel.
llvm-svn: 25998
2006-02-05 06:51:51 +00:00
Chris Lattner
1e16099e9f remove V8 reference
llvm-svn: 25991
2006-02-05 06:32:59 +00:00
Chris Lattner
834685ef3a Rename SPARC V8 target to be the LLVM SPARC target.
llvm-svn: 25985
2006-02-05 05:50:24 +00:00
Brian Gaeke
965df0b91b Great renaming: Sparc --> SparcV9
llvm-svn: 11826
2004-02-25 18:44:15 +00:00
Brian Gaeke
eae0364189 FunctionLiveVarInfo.h moved: include/llvm/CodeGen -> lib/Target/Sparc/LiveVar
llvm-svn: 11804
2004-02-24 19:46:00 +00:00
Alkis Evlogimenos
7f7d70a53c Move MOTy::UseType enum into MachineOperand. This eliminates the
switch statements in the constructors and simplifies the
implementation of the getUseType() member function. You will have to
specify defs using MachineOperand::Def instead of MOTy::Def though
(similarly for Use and UseAndDef).

llvm-svn: 11715
2004-02-22 19:23:26 +00:00
Chris Lattner
28131460da Adjustments to support the new ConstantAggregateZero class
llvm-svn: 11474
2004-02-15 05:55:15 +00:00
Alkis Evlogimenos
a31a767307 Use newly added next() and prior() utility functions.
llvm-svn: 11430
2004-02-14 01:18:34 +00:00
Alkis Evlogimenos
6d6ab846af Remove getAllocatedRegNum(). Use getReg() instead.
llvm-svn: 11393
2004-02-13 21:01:20 +00:00
Chris Lattner
da61b0ab20 Squish warning
llvm-svn: 11375
2004-02-13 16:14:50 +00:00
Brian Gaeke
7d1652ca5c Remove this MachineOpCodeFlags assertion - its test can never be false.
llvm-svn: 11342
2004-02-12 04:01:07 +00:00
Alkis Evlogimenos
b755d35fd2 Change MachineBasicBlock's vector of MachineInstr pointers into an
ilist of MachineInstr objects. This allows constant time removal and
insertion of MachineInstr instances from anywhere in each
MachineBasicBlock. It also allows for constant time splicing of
MachineInstrs into or out of MachineBasicBlocks.

llvm-svn: 11340
2004-02-12 02:27:10 +00:00
Brian Gaeke
116a667130 MachineInstr::getOpCode() --> getOpcode() in SPARC back-end.
llvm-svn: 11335
2004-02-11 20:47:34 +00:00
Alkis Evlogimenos
fb5edb0b49 Increase constness.
llvm-svn: 11322
2004-02-11 17:55:09 +00:00
Alkis Evlogimenos
4b4342e865 Remove assert as the only integer registers on the sparc are physical.
llvm-svn: 11317
2004-02-11 06:04:51 +00:00
Alkis Evlogimenos
30c37082ae Fix previous broken commit. A MachineOperand may have opType ==
MO_VirtualRegister but if the register number is one of a physical
register is it considered as a physical register.

llvm-svn: 11315
2004-02-11 05:55:00 +00:00
Alkis Evlogimenos
d2edafbc32 Remove assert as it is meaningless. MachineOperands can be tagged as
MO_VirtualRegister but actually be representing a physical register.

llvm-svn: 11310
2004-02-11 04:52:30 +00:00
Chris Lattner
d64519766e Stop using this method
llvm-svn: 11282
2004-02-10 21:12:06 +00:00
Chris Lattner
0d6d4075e3 Remvoe use of MO.isVirtualRegister(), turn an assertion into an assert()
llvm-svn: 11280
2004-02-10 20:47:24 +00:00
Chris Lattner
6fb75586ba Remove use of isPhysicalRegister
llvm-svn: 11277
2004-02-10 20:35:42 +00:00
Chris Lattner
a62e6a4952 Fix PR228: [sparc] Boolean constants are emitted as true and false
I will observe that the concept of using WriteAsOperand is completely broken,
but then we all knew that, didn't we?

llvm-svn: 11255
2004-02-10 05:16:44 +00:00
Misha Brukman
ac167832e7 Doxygenify comments.
llvm-svn: 11252
2004-02-09 23:18:42 +00:00
John Criswell
c1fa74809a Fix PR#226: When emitting padding, always emit it as bytes. Bytes can be
placed into any alignment situation.

llvm-svn: 11247
2004-02-09 22:15:33 +00:00
Brian Gaeke
923ff046c0 Add a new (static inline) std::ostream& << AllocInfo& method. Use it.
llvm-svn: 11002
2004-01-28 19:05:43 +00:00
Misha Brukman
bbc01f7b77 Use the LLVM standard name mangling infrastructure instead of reinventing the
wheel.

llvm-svn: 10891
2004-01-15 22:44:19 +00:00
Brian Gaeke
1459ac52af Include TargetRegInfo.h and declare SparcTargetMachine forward, to make this
header more easily includable.

llvm-svn: 10880
2004-01-15 18:17:07 +00:00
Chris Lattner
691524bfbd Eliminate the isStringCompatible function, using ConstantArray::isString.
It's not clear why the code was looking for signed chars < 0, but it can't
matter to the assembler anyway, so the check goes away.  This also fixes
compatibility with arrays of [us]byte that have constantexprs in them.

Also slightly restructure some code to be cleaner.

llvm-svn: 10854
2004-01-14 17:15:17 +00:00
Chris Lattner
215483f9bc Finegrainify namespacification
Using the SlotCalculator is total overkill for this file, a simple map
will suffice.  Why doesn't this use the NameMangler interface?

llvm-svn: 10823
2004-01-13 21:27:59 +00:00
Brian Gaeke
725e6a9b77 Remove dump-input option.
Make addPassesToEmitAssembly() look slightly more like addPassesToJITCompile().

llvm-svn: 10818
2004-01-13 19:26:21 +00:00
Chris Lattner
41ac9c82f9 Eliminate use of ConstantHandling itf
llvm-svn: 10782
2004-01-12 18:08:18 +00:00
Chris Lattner
aa91fab38d Move sparc-specific livevar code into lib/Target/Sparc
llvm-svn: 10733
2004-01-09 18:15:24 +00:00
Chris Lattner
5bbe234eab Fix more incestuous #includage.
llvm-svn: 10732
2004-01-09 16:17:09 +00:00
Chris Lattner
3a7b85a77b Move InstrSelection into lib/Target/Sparc, as it's sparc specific. This
makes the incestuous #include'ing of sparc internal headers much less
disturbing.  :)

llvm-svn: 10729
2004-01-09 06:22:34 +00:00
Chris Lattner
9bd7a783b9 Move lib/Codegen/RegAlloc into lib/Target/Sparc, as it is sparc specific
llvm-svn: 10728
2004-01-09 06:17:12 +00:00
Chris Lattner
c37577eb9f Clean up a lot of the code I added yesterday by exposing the IntrinsicLowering
implementation from the TargetMachine directly.

llvm-svn: 10636
2003-12-28 21:23:38 +00:00
Chris Lattner
58cbeaed27 Eliminate some code that is not needed now that we have the intrinsic lowering pass
llvm-svn: 10628
2003-12-28 09:46:33 +00:00
Misha Brukman
2653aa076a Really release memory used by functions. Patch by Chris.
llvm-svn: 10572
2003-12-22 03:47:58 +00:00
Chris Lattner
5099050009 Hoist some sparc specific code into the sparc target
llvm-svn: 10554
2003-12-20 09:17:40 +00:00
Chris Lattner
1cb1efedb3 Rip JIT specific stuff out of TargetMachine, as per PR176
llvm-svn: 10542
2003-12-20 01:22:19 +00:00
Misha Brukman
adac37e69b * Converted C-style comments to C++
* Doxygenified comments
* Reordered #includes

llvm-svn: 10503
2003-12-17 22:08:20 +00:00
Misha Brukman
61860852dc Reordered #includes.
llvm-svn: 10502
2003-12-17 22:06:28 +00:00
Misha Brukman
9f2f87bb6b Doxygenified some comments, reduced extraneous space.
llvm-svn: 10501
2003-12-17 22:06:08 +00:00
Misha Brukman
fe533cc4e6 Reorganized the Sparc backend to be more modular -- each different
implementation of a Target{RegInfo, InstrInfo, Machine, etc} now has a separate
header and a separate implementation file.

This means that instead of a massive SparcInternals.h that forces a
recompilation of the whole target whenever a minor detail is changed, you should
only recompile a few files.

Note that SparcInternals.h is still around; its contents should be minimized.

llvm-svn: 10500
2003-12-17 22:04:00 +00:00
Alkis Evlogimenos
29127b8825 Change interface of MachineOperand as follows:
a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse()
    b) add isUse(), isDef()
    c) rename opHiBits32() to isHiBits32(),
              opLoBits32() to isLoBits32(),
              opHiBits64() to isHiBits64(),
              opLoBits64() to isLoBits64().

This results to much more readable code, for example compare
"op.opIsDef() || op.opIsDefAndUse()" to "op.isDef()" a pattern used
very often in the code.

llvm-svn: 10461
2003-12-14 13:24:17 +00:00
Misha Brukman
1d9ac83d82 * Add code to flush the ICache, which any self-respecting SMC must do
* Restore registers *after* everything else to avoid any possible side effects

This fixes McCat-imp.

llvm-svn: 10147
2003-11-21 23:48:54 +00:00
Misha Brukman
1c95e95551 Include the file before we close the llvm namespace.
llvm-svn: 9954
2003-11-13 00:23:05 +00:00
Misha Brukman
58f9d30da4 Substantially re-organized this file:
* There is now only one pass to print out assembly instead of two
* It is a FunctionPass
* The Module-level printing of globals is now in doFinalization() method of the
  FunctionPass
* The code has been reformatted to follow LLVM coding standards
* Some comments, not all, were doxygenified
* Last but not least, the function to create an instance of this pass is also no
  longer a method in the UltraSparc class.

llvm-svn: 9953
2003-11-13 00:22:19 +00:00
Misha Brukman
5c858a33cb The function to create an instance of this pass is no longer a method of
the UltraSparc class.

llvm-svn: 9952
2003-11-13 00:19:02 +00:00
Misha Brukman
e3afd442f1 The functions to create new instances of passes are no longer methods in the
UltraSparc class. Comments are also doxygen-compatible now.

llvm-svn: 9951
2003-11-13 00:17:20 +00:00
Misha Brukman
aa553825b1 * Put command-line switches in their own namespace
* Pass creation functions are no longer in the UltraSparc class

llvm-svn: 9950
2003-11-13 00:16:28 +00:00
Misha Brukman
310200f573 Force a dependency on the .inc file, which must be generated!
llvm-svn: 9949
2003-11-13 00:05:09 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Brian Gaeke
d542ca6af1 Fix PR103
llvm-svn: 9830
2003-11-09 07:08:34 +00:00
Brian Gaeke
5159888ea4 Fix two typos I found in comments.
llvm-svn: 9806
2003-11-08 18:12:24 +00:00
Misha Brukman
feb806084d For some reason, LICM and GCSE like to crash the FunctionPassManager when they
are being added as FunctionPasses... Sigh.

llvm-svn: 9798
2003-11-08 00:01:39 +00:00
Misha Brukman
9ddec59660 Implement branching to a PC-relative constant (not a BasicBlock).
llvm-svn: 9793
2003-11-07 21:07:30 +00:00
Misha Brukman
fbd3f16961 PreSelection is not optional, it performs a necessary and vital transformation
for the Sparc backend: breaking up constant expressions. Thus, we cannot have it
guarded by a conditional, it should never be disabled.

Also, it's now available for the JIT since it is a FunctionPass.

llvm-svn: 9791
2003-11-07 20:33:25 +00:00
Misha Brukman
d04d2ef54d Switch to emitting MachineConstantPool the way it was meant to be done.
llvm-svn: 9777
2003-11-07 18:06:26 +00:00
Misha Brukman
8fe318a705 Switch to using the standard representation of the constant pool -- namely, the
MachineConstantPool. This involved refactoring the two classes involved in
printing out Sparc assembly. In fact, they should share all this code anyway.

llvm-svn: 9776
2003-11-07 17:45:28 +00:00
Misha Brukman
3f43ed6586 We accept TargetMachine as a const reference.
llvm-svn: 9775
2003-11-07 17:44:18 +00:00
Misha Brukman
c866cfb251 PreSelection and PeepholeOpts are now FunctionPasses.
llvm-svn: 9774
2003-11-07 17:43:43 +00:00
Misha Brukman
1c726348d1 * Stop making a global for each constant that cannot live in an instruction;
it will be converted to a MachineConstantPool index during instruction
  selection
* This is now eligible to become a FunctionPass since it does not have any side
  effects outside of the function it is processing.

llvm-svn: 9773
2003-11-07 17:31:22 +00:00
Misha Brukman
575a02e8db * Use the MachineConstantPool for storing constants instead of a hash_set;
* Do not create new globals for constants!

Also, order #includes as per coding style guide

llvm-svn: 9772
2003-11-07 17:29:48 +00:00
Misha Brukman
ccdf8e85e0 Use basename $< to get just the filename, not full path, for ease of reading.
llvm-svn: 9770
2003-11-07 17:26:27 +00:00
Chris Lattner
8f8109ebdb Hopefully this will fix PR98
llvm-svn: 9762
2003-11-07 00:38:09 +00:00
Misha Brukman
de3f241f5f * Make the comment header 80 columns long
* Alphabetize #includes

llvm-svn: 9751
2003-11-06 18:06:13 +00:00
Brian Gaeke
0d26a4c53d Tweak sed commands so that they filter out more # stuff and also
work on Mac OS X. Also turn ${...} into $(...); we do not speak BSD
Make.

llvm-svn: 9589
2003-10-29 20:07:35 +00:00
Misha Brukman
6a1c1640f5 Make code layout more consistent.
llvm-svn: 9418
2003-10-23 16:48:30 +00:00
Misha Brukman
55695cc963 Add comments to describe what these functions actually do.
llvm-svn: 9370
2003-10-22 05:50:40 +00:00
Misha Brukman
f79e50487f * Use <cmath> instead of <math.h>
* Order #includes according to LLVM coding standards

llvm-svn: 9369
2003-10-22 05:09:56 +00:00
Misha Brukman
7456b8a58d Removed completely duplicated function comment (an identical one appears later).
llvm-svn: 9368
2003-10-22 04:55:09 +00:00
Misha Brukman
ed0f9660bc No, really, order the #includes correctly.
llvm-svn: 9367
2003-10-22 04:51:36 +00:00
Misha Brukman
c40b8306f6 * Fix order of #includes to follow style guide
* It's no longer a BasicBlock pass: update comment on run() method
* Fix placement of braces to be consistent
* Delete extraneous whitespace

llvm-svn: 9361
2003-10-22 03:27:45 +00:00
Chris Lattner
7a75f6b7d4 Hrm, unbreak stuph :(
llvm-svn: 9334
2003-10-21 17:22:23 +00:00
Chris Lattner
19f471f002 Fix preselection/lowerswitches bug
llvm-svn: 9333
2003-10-21 16:29:23 +00:00
Chris Lattner
2c063c848d Pull the PHI special case into it's own visit* method
llvm-svn: 9332
2003-10-21 16:09:23 +00:00
Chris Lattner
4b8ce1c80d The lastOp operand is never used
llvm-svn: 9331
2003-10-21 16:06:07 +00:00
John Criswell
4746befea3 Added LLVM copyright notice.
llvm-svn: 9324
2003-10-21 15:29:18 +00:00
John Criswell
de34542f41 Added LLVM copyright header.
llvm-svn: 9321
2003-10-21 15:17:13 +00:00
Chris Lattner
bec3b4ede1 Preselection is _not_ a basicblock pass, because it adds global variables to
the module.  This change converts it from being a basic block pass to being
a simple pass.  This allows elimination of the annotation and simplification
of the logic for moving constants into global variables.

llvm-svn: 9320
2003-10-21 14:49:19 +00:00
Vikram S. Adve
b289dff9a8 When opcodes like ADD were split into reg. and immed. versions (ADDi and ADDr),
this code wasn't fixed correctly so it missed copy operations that used ADDi.

llvm-svn: 9318
2003-10-21 12:29:45 +00:00
Vikram S. Adve
abf40e897c Why does g++ not even generate a warning when you miss a break statement?
llvm-svn: 9317
2003-10-21 12:28:27 +00:00
Vikram S. Adve
062fda7446 Implement the new varargs instructions and intrinsics.
llvm-svn: 9316
2003-10-21 11:25:09 +00:00
John Criswell
71d2894956 Added LLVM copyright notice to Makefiles.
llvm-svn: 9312
2003-10-20 22:26:57 +00:00
Brian Gaeke
f9b97fda86 Goodbye, AddRegNumToValues
llvm-svn: 9309
2003-10-20 20:44:03 +00:00
John Criswell
b402729b30 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Brian Gaeke
9501118e3b Minor leftover fixups from replaceMachineCodeForFunction () change.
llvm-svn: 9295
2003-10-20 17:59:09 +00:00
Brian Gaeke
b4ceb43a43 Make replaceMachineCodeForFunction() return void.
llvm-svn: 9289
2003-10-20 15:17:12 +00:00
Brian Gaeke
afbe8787cc Make replaceMachineCodeForFunction return void.
llvm-svn: 9288
2003-10-20 15:15:17 +00:00
Chris Lattner
332429f023 Apparently the dependencies are wrong for this file, so it didn't rebuild it
when changing Instruction.def.  :(

llvm-svn: 9286
2003-10-20 14:12:52 +00:00
Chris Lattner
87843f87b8 Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.
llvm-svn: 9269
2003-10-19 21:34:28 +00:00
Chris Lattner
080765e65d Update the sparc backend to at least compile correctly with the new varargs stuff even if it's not all implemented yet.
llvm-svn: 9223
2003-10-18 05:55:58 +00:00
Brian Gaeke
e966765990 Refactor jump insertion code from CompilationCallback() into insertJumpAtAddr().
Make insertFarJumpAtAddr() return void, because nothing uses its return value.
Remove some commented-out code.
Implement replaceMachineCodeForFunction() for SPARC.

llvm-svn: 9203
2003-10-17 18:27:37 +00:00
Brian Gaeke
4380148f33 Add prototype for replaceMachineCodeForFunction().
llvm-svn: 9202
2003-10-17 18:27:25 +00:00
Brian Gaeke
7157eed00f Remove extra blank line.
llvm-svn: 9196
2003-10-17 18:09:10 +00:00
Alkis Evlogimenos
5a1f705c88 Eliminate some extraneous code in SlotCalculator::insertVal().
Rename SlotCalculator::getValSlot() to SlotCalculator::getSlot(),
       SlotCalculator::insertValue() to SlotCalculator::getOrCreateSlot(),
       SlotCalculator::insertVal() to SlotCalculator::insertValue(), and
       SlotCalculator::doInsertVal() to SlotCalculator::doInsertValue().

llvm-svn: 9190
2003-10-17 02:02:40 +00:00
Brian Gaeke
add2fc5294 Remove WordsEmitted statistic; there's already a non-backend-specific
jello statistic for this (just divide #-bytes-of-code-emitted by 4).

Rewrite head-of-file comment.

llvm-svn: 9098
2003-10-13 19:51:20 +00:00
Chris Lattner
b6c8569f05 Regularize header file comments
llvm-svn: 9071
2003-10-13 03:32:08 +00:00
Brian Gaeke
acbc37a19e Don't include "Config/stdlib.h".
llvm-svn: 9037
2003-10-10 19:12:22 +00:00
Brian Gaeke
e5249bf429 Include <cstdio> instead of <stdio.h>.
llvm-svn: 9032
2003-10-10 18:46:52 +00:00
Misha Brukman
868eac95dd Fix spelling.
llvm-svn: 9027
2003-10-10 17:57:28 +00:00
Brian Gaeke
f9a4341b54 Add # of printed instructions statistic to both the SPARC and X86 LLC backends.
llvm-svn: 8892
2003-10-06 15:41:21 +00:00
Chris Lattner
e0ae24753d Add support for the Invoke instruction by using the LowerInvoke pass
llvm-svn: 8872
2003-10-05 19:16:09 +00:00
Misha Brukman
15fd4fd90c The comment seems irrelevant as the pass has become a BasicBlock pass.
llvm-svn: 8803
2003-10-01 05:24:50 +00:00
Chris Lattner
bdca1b438d Make sure to get the definition of getRegisterAllocator
llvm-svn: 8801
2003-09-30 22:24:00 +00:00
Chris Lattner
5509b86d74 RegisterAllocation.h is going away
llvm-svn: 8795
2003-09-30 20:15:04 +00:00
Brian Gaeke
ed1c780821 Add statistic for # of emitWord() calls.
llvm-svn: 8772
2003-09-30 17:49:41 +00:00
Misha Brukman
6d1b1553c1 Fixed spelling.
llvm-svn: 8687
2003-09-23 17:28:11 +00:00
Misha Brukman
c52311be4f Fix spelling.
llvm-svn: 8686
2003-09-23 17:27:28 +00:00
Vikram S. Adve
be3b73177f Fix assertion so it doesn't not trip incorrectly.
llvm-svn: 8650
2003-09-21 07:55:27 +00:00
Brian Gaeke
180144d19e Fix a typo in Sparc.cpp.
Update names of some pass creator fns in addPassesToEmitAssembly().
FunctionInfo is gone.

llvm-svn: 8599
2003-09-18 17:37:46 +00:00
Brian Gaeke
425a189248 Rename the pass creator fn to mimic the other creator fn names.
llvm-svn: 8598
2003-09-18 17:37:35 +00:00
Brian Gaeke
b22c819f96 Fix (and properly doxygenify) some comments. Incorporate
functionality of FunctionInfo pass as doFinalization method.
Rename pass to match names of other passes like it.
Rename the pass creator fn to mimic the other creator fn names.
Include StringExtras for utostr().
Make symbol prologue/epilogue stuff redundant with
 EmitBytecodeToAssembly, in preparation for refactoring.

llvm-svn: 8597
2003-09-18 17:37:25 +00:00
Brian Gaeke
bbbb03f96a Make the symbol prologue/epilogue stuff redundant with MappingInfo, in
preparation for refactoring.
Rename the pass creator fn to mimic the other creator fn names.

llvm-svn: 8596
2003-09-18 17:37:14 +00:00
Vikram S. Adve
e92c22c656 Fix longjmp case so that, along with the call to abort(), we also
generate the appropriate CallArgsDescriptor and tmp. virtual regs.

llvm-svn: 8554
2003-09-16 05:56:22 +00:00
John Criswell
29a0f79c05 Don't explicitly use $SourceDir to find the tblgen files. This causes make
some confusion when trying to generate files (it probably couldn't tell that
./file and $(SourceDir)/file may be the same file).
Now, just let VPATH find everything, and list the primary tblgen file first in
the list of dependencies so that we can just use $< to reference it in the make
rule.

This should hopefully fix the nightly tester.

llvm-svn: 8433
2003-09-10 14:10:44 +00:00
John Criswell
e783801878 Updated to find source files using VPATH. This makes writing build rules
much cleaner and easier.
Labeled .td as a suffix for tblgen files in Makefile.rules.
Modified build rules so that source files generated during the build are placed
in the build directory and not the source directory (and not in a Debug
directory).  This makes the system cleaner and allows us to have a read-only
source tree.

llvm-svn: 8424
2003-09-09 20:57:03 +00:00
John Criswell
bd1d21a0b4 Checkin of autoconf-style object root.
Adjusted Makefile to work with new autoconf-style object root.
Specifically, use the new -I option of tblgen to find include files.

llvm-svn: 8379
2003-09-06 14:50:22 +00:00
Misha Brukman
a17b761043 Added some optimizations:
* Generate a single BA instead of 6-instruction JUMP if possible
  (this occurs both in the creation and overwriting of the stub code)
* If possible, rewrite the ORIGINAL call to call the generated function
  directly, thus bypassing the stub entirely

Also added some statistics on how often calls are overwritten and how often the
CompilationCallback is invoked.

llvm-svn: 8376
2003-09-05 22:59:31 +00:00
Chris Lattner
6d92264f5a No longer provide an optinfo, noone uses it
llvm-svn: 8311
2003-09-01 20:40:59 +00:00
Chris Lattner
2eb5de925f Inline simple comparison which is sparc specific anyway
llvm-svn: 8309
2003-09-01 20:38:03 +00:00
Chris Lattner
3d6b7d1b44 Move private interfaces into private .h file
llvm-svn: 8306
2003-09-01 20:33:07 +00:00
Chris Lattner
cd2980ec8c Simplify code a bit
llvm-svn: 8301
2003-09-01 20:24:06 +00:00
Chris Lattner
049f0b8b37 LiveRange.h is now in lib/CodeGen/RegAlloc
llvm-svn: 8299
2003-09-01 20:17:13 +00:00