Chris Lattner
39a31b56ac
Now that dominator tree children are built in determinstic order, this horrible code
...
can go away
llvm-svn: 14254
2004-06-19 20:23:35 +00:00
Chris Lattner
a1d29e1b15
compute dominator tree children in a deterministic order that does not depend
...
on the address of BasicBlock objects in memory. This eliminates stuff like this:
Inorder Dominator Tree:
[1] %entry
[2] %loopentry
- [3] %loopexit
[3] %no_exit
- [4] %endif
[4] %then
+ [4] %endif
+ [3] %loopexit
[3] %return
llvm-svn: 14253
2004-06-19 20:13:48 +00:00
Chris Lattner
ba131c993e
Print out immediate dominators in program order, not in random order based on the address
...
of BasicBlock objects
llvm-svn: 14252
2004-06-19 20:04:47 +00:00
Chris Lattner
ef8a52f263
This will hopefully fix a heisenbug that Vladimir Merzliakov is running
...
into valiantly trying to compile stuff on freebsd.
llvm-svn: 14251
2004-06-19 19:01:26 +00:00
Chris Lattner
3d68124555
Fix a nasty bug, noticed by Reid
...
llvm-svn: 14249
2004-06-19 18:15:50 +00:00
Chris Lattner
185f2b060b
Fix one source of nondeterminism in the -licm pass: the hoist pass
...
was processing blocks in whatever order they happened to end up in the
dominator tree data structure. Force an ordering.
llvm-svn: 14248
2004-06-19 08:56:43 +00:00
Chris Lattner
d2720878ec
Change to use the StableBasicBlockNumbering class
...
llvm-svn: 14247
2004-06-19 08:42:40 +00:00
Chris Lattner
9b19f34fe2
Fix a tiny bug in the -no-aa pass, in which it did not ever get a target data.
...
This is a regression from 1.2, though noone uses -no-aa anyway
llvm-svn: 14245
2004-06-19 08:05:58 +00:00
Chris Lattner
3aed3a8bf2
Do not let the numbering of PHI nodes placed in the function depend on
...
non-deterministic things like the ordering of blocks in the dominance
frontier of a BB. Unfortunately, I don't know of a better way to solve
this problem than to explicitly sort the BB's in function-order before
processing them. This is guaranteed to slow the pass down a bit, but
is absolutely necessary to get usable diffs between two different tools
executing the mem2reg or scalarrepl pass.
Before this, bazillions of spurious diff failures occurred all over the
place due to the different order of processing PHIs:
- %tmp.111 = getelementptr %struct.Connector_struct* %upcon.0.0, uint 0, uint 0
+ %tmp.111 = getelementptr %struct.Connector_struct* %upcon.0.1, uint 0, uint 0
Now, the diffs match.
llvm-svn: 14244
2004-06-19 07:40:14 +00:00
Chris Lattner
6e7b76ce94
Do not sort by the address of LLVM ConstantInt* objects. This produces
...
nondeterministic results that depend on where these objects land in memory.
Instead, sort by the value of the constant, which is stable.
Before this patch, the -simplifycfg pass run from two different compilers
could cause different code to be generated, though it was semantically the
same:
@@ -12258,8 +12258,8 @@
%s_addr.1 = phi sbyte* [ %s, %entry ], [ %inc.0, %no_exit ] ; <sbyte*> [#uses=5]
%tmp.1 = load sbyte* %s_addr.1 ; <sbyte> [#uses=1]
switch sbyte %tmp.1, label %no_exit [
- sbyte 0, label %loopexit
sbyte 46, label %loopexit
+ sbyte 0, label %loopexit
]
We need to stomp all of this stuff out.
llvm-svn: 14243
2004-06-19 07:02:14 +00:00
Chris Lattner
5b4da6dd16
Do not loop over uses as we delete them. This causes iterators to be
...
invalidated out from under us. This bug goes back to revision 1.1: scary.
llvm-svn: 14242
2004-06-19 02:02:22 +00:00
Misha Brukman
14bac9f37e
* Fix file header and name
...
* Order #includes alphabetically
llvm-svn: 14234
2004-06-18 15:38:49 +00:00
Misha Brukman
86cea2f60a
Use the machine-independent method of querying the page size.
...
llvm-svn: 14233
2004-06-18 15:34:07 +00:00
Brian Gaeke
26336244f5
.zero doesn't work in the Solaris assembler.
...
llvm-svn: 14231
2004-06-18 08:59:16 +00:00
Brian Gaeke
6a8de685b3
Get rid of selects the easy way
...
llvm-svn: 14230
2004-06-18 08:46:15 +00:00
Brian Gaeke
a9daa0a519
Make visitAllocaInst() look more like its X86 counterpart.
...
llvm-svn: 14229
2004-06-18 08:45:52 +00:00
Brian Gaeke
ab4687b176
Mess around with allocation order. In particular, I think we ought to be
...
using the local & in regs first because they are not clobbered by calls.
llvm-svn: 14228
2004-06-18 08:19:08 +00:00
Brian Gaeke
f5697cf56c
JMPL has a delay slot.
...
llvm-svn: 14227
2004-06-18 08:18:54 +00:00
Brian Gaeke
2a5dec63a6
Clean up the commented-out F3_3 stuff.
...
Replace it with a working class for FP instrs.
llvm-svn: 14226
2004-06-18 06:28:21 +00:00
Brian Gaeke
01309de73d
Fix jmpl.
...
Add some FP moves.
llvm-svn: 14225
2004-06-18 06:28:10 +00:00
Brian Gaeke
c045f38dcb
Support printing base+offset pairs where the offset is a register.
...
Use this for printing the jmpl indirect-call instruction.
llvm-svn: 14224
2004-06-18 06:27:59 +00:00
Brian Gaeke
92a3e14ac4
Support intrinsic calls (although no particular intrinsics are supported yet).
...
Support indirect calls.
Support returning a float value.
llvm-svn: 14223
2004-06-18 06:27:48 +00:00
Chris Lattner
91b27e01b3
Implement Transforms/InstCombine/and.ll:test17, a common case that
...
occurs due to unordered comparison macros in math.h
llvm-svn: 14221
2004-06-18 06:07:51 +00:00
Chris Lattner
8f9fb1d2ea
Do not function resolve intrinsics. This prevents warnings and possible bad
...
things from happening due to
declare bool %llvm.isunordered(double, double)
declare bool %llvm.isunordered(float, float)
llvm-svn: 14219
2004-06-18 05:50:48 +00:00
Brian Gaeke
c5f1146e62
Add load instructions for floating-point registers.
...
llvm-svn: 14217
2004-06-18 05:19:27 +00:00
Brian Gaeke
7a618842f1
Support alloca instructions.
...
Support copying floating-point constants to registers.
Add assertion to visitCallInst to abort if we hit a NULL calledFunction, for now.
llvm-svn: 14216
2004-06-18 05:19:16 +00:00
Chris Lattner
3c61b2dd70
Fix printing of Argument objects, problem found by Patrick Meredith
...
llvm-svn: 14215
2004-06-18 04:07:20 +00:00
Chris Lattner
9e1bbe86ba
Codegen sub C, X a little bit better for register pressure. Instead of
...
mov REG, C
sub REG, X
generate:
neg X
add X, C
which uses one less reg
llvm-svn: 14213
2004-06-18 00:50:37 +00:00
Chris Lattner
a5750b975a
Fold setcc instructions into select and branches that are not in the same BB as
...
the setcc.
llvm-svn: 14212
2004-06-18 00:29:22 +00:00
Brian Gaeke
b824469b44
Make storeRegToStackSlot slightly shorter.
...
Make copyRegToReg return 1 instead of -1.
Edit a comment in emitPrologue().
llvm-svn: 14211
2004-06-17 22:34:48 +00:00
Brian Gaeke
9a0dc64af6
Set the isBranch and isTerminator flags on branch instructions correctly.
...
Add a FIXME about the (currently unused) JMPL instructions.
llvm-svn: 14210
2004-06-17 22:34:29 +00:00
Brian Gaeke
c82f209e72
Emit stores correctly; don't fail an assertion.
...
llvm-svn: 14209
2004-06-17 22:34:19 +00:00
Brian Gaeke
d084a534a2
Support generating machine instructions for Phi nodes (based on x86, but with
...
modifications for 1 LLVM BB --> many MBBs).
Fix store operand order: make it always be Base, Offset, SrcReg (think
"[ Base + Offset ] = SrcReg").
Rewrite visitBranchInst() to be even dumber (but working) -- give up on
the branch fallthrough trick, for the time being.
Make visitSetCondInst() work.
llvm-svn: 14208
2004-06-17 22:34:08 +00:00
Brian Gaeke
af2408a4ee
Recognize more branches.
...
llvm-svn: 14207
2004-06-17 22:33:57 +00:00
Brian Gaeke
4a904bfdcc
I love the smell of a freshly broken PowerPC build in the morning.
...
llvm-svn: 14206
2004-06-17 22:27:04 +00:00
Brian Gaeke
6f6eb93de3
Make debugging dumps w/ multiple MachineBBs for a given LLVM BB readable.
...
llvm-svn: 14205
2004-06-17 22:26:53 +00:00
Chris Lattner
f815117481
Do not fold loads into instructions if it is used more than once. In particular
...
we do not want to fold the load in cases like this:
X = load
= add A, X
= add B, X
llvm-svn: 14204
2004-06-17 22:15:25 +00:00
Chris Lattner
13cea4ef6f
Fix compilation problem on freebsd. Problem noted by Vladimir Merzliakov in
...
PR371
llvm-svn: 14203
2004-06-17 21:20:52 +00:00
Brian Gaeke
7d711d517b
Use addGlobalAddress and addMBB for call & branch targets instead of addPCDisp.
...
Abort if we see a PCRelativeDisp MachineOperand, to be safe. This matches
the X86 backend.
llvm-svn: 14202
2004-06-17 19:39:23 +00:00
Chris Lattner
0cd29ae2cd
Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
...
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Chris Lattner
00b0a866dd
Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
...
Delete two functions that are now methods on the Type class
llvm-svn: 14200
2004-06-17 18:16:02 +00:00
Chris Lattner
18f8ae4e3e
Minor cleanup
...
llvm-svn: 14199
2004-06-17 17:56:54 +00:00
Brian Gaeke
a46100448f
Fix typo in DEBUG printout.
...
llvm-svn: 14196
2004-06-17 07:26:52 +00:00
Chris Lattner
1b8f37597d
Fix a recent regression in Applications/sgefa that Alkis pointed out to me.
...
The vector may actually be empty if the register that we are marking as
recently used is not actually allocatable. This happens for physical registers
that are not allocatable, like the ST(x) registers on X86.
llvm-svn: 14195
2004-06-16 06:57:29 +00:00
Brian Gaeke
19d2a396da
Add int ferror(FILE *)
...
llvm-svn: 14194
2004-06-16 02:56:40 +00:00
Brian Gaeke
cf3cb8944a
Um, did someone make a typo or something?
...
llvm-svn: 14192
2004-06-15 23:09:50 +00:00
Chris Lattner
7c3600a50e
isnan is dead
...
llvm-svn: 14191
2004-06-15 21:52:58 +00:00
Chris Lattner
9bb0083d16
Remove support for llvm.isnan. Alkis wins :)
...
llvm-svn: 14189
2004-06-15 21:48:07 +00:00
Chris Lattner
c9a6116586
Remove isnan support, correct isunordered support
...
llvm-svn: 14187
2004-06-15 21:42:23 +00:00
Chris Lattner
1adcf0441d
Remove support for the isnan intrinsic
...
llvm-svn: 14186
2004-06-15 21:37:54 +00:00