Commit Graph

12618 Commits

Author SHA1 Message Date
Reid Spencer 006b386e6f Add a note about GCC 3.3.2 optimization bug that causes llc to spin.
llvm-svn: 14250
2004-06-19 18:24:05 +00:00
Chris Lattner 4027500e1c Fix a nasty bug, noticed by Reid
llvm-svn: 14249
2004-06-19 18:15:50 +00:00
Chris Lattner ec2d34cc19 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 4db0f8260a Change to use the StableBasicBlockNumbering class
llvm-svn: 14247
2004-06-19 08:42:40 +00:00
Chris Lattner d31410d824 Initial checkin of the StableBasicBlockNumbering, a little helper class for computing
(strangely enough) a stable (determinstic) numbering for basic blocks.

llvm-svn: 14246
2004-06-19 08:41:59 +00:00
Chris Lattner feda9d0583 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 a52ab6f57f 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 b2b151d297 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 b5f8eb8315 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
Chris Lattner 2ef024b2c2 Bug fixed
llvm-svn: 14241
2004-06-19 01:11:02 +00:00
Chris Lattner 649154cace Test for PR374
llvm-svn: 14240
2004-06-19 01:08:12 +00:00
Misha Brukman 0bca699edd Fix relative link to the CVS mirrors.
llvm-svn: 14239
2004-06-18 20:18:31 +00:00
Chris Lattner 8c470182bb Add link to the CVS mirror hosted by Reid
llvm-svn: 14238
2004-06-18 20:15:58 +00:00
Misha Brukman 5f056c78c1 Add link documenting shared/static library differences across platforms.
llvm-svn: 14237
2004-06-18 18:39:00 +00:00
Chris Lattner 3daf984f71 Bug fixed
llvm-svn: 14236
2004-06-18 17:57:29 +00:00
Misha Brukman 35d842e75f Capitalize Cygwin.
llvm-svn: 14235
2004-06-18 15:54:54 +00:00
Misha Brukman 4b58581545 * Fix file header and name
* Order #includes alphabetically

llvm-svn: 14234
2004-06-18 15:38:49 +00:00
Misha Brukman 42a24823a1 Use the machine-independent method of querying the page size.
llvm-svn: 14233
2004-06-18 15:34:07 +00:00
Misha Brukman 5d87550ba7 Add a target-independent way to query page size.
llvm-svn: 14232
2004-06-18 15:30:25 +00:00
Brian Gaeke 5b433a5de9 .zero doesn't work in the Solaris assembler.
llvm-svn: 14231
2004-06-18 08:59:16 +00:00
Brian Gaeke 4125c92009 Get rid of selects the easy way
llvm-svn: 14230
2004-06-18 08:46:15 +00:00
Brian Gaeke 694f7b78d9 Make visitAllocaInst() look more like its X86 counterpart.
llvm-svn: 14229
2004-06-18 08:45:52 +00:00
Brian Gaeke fcc30aca1b 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 b42345811e JMPL has a delay slot.
llvm-svn: 14227
2004-06-18 08:18:54 +00:00
Brian Gaeke 7d9af983de 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 75f3738969 Fix jmpl.
Add some FP moves.

llvm-svn: 14225
2004-06-18 06:28:10 +00:00
Brian Gaeke 12ee9a1e75 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 5ebab28a8a 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 b7c4bac617 Calls to __builtin_isunordered and friends no longer cause llvmgcc to ICE.
llvm-svn: 14222
2004-06-18 06:26:29 +00:00
Chris Lattner 023a483c76 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 d5829aac27 New test
llvm-svn: 14220
2004-06-18 06:07:17 +00:00
Chris Lattner 1e1abdd6ed 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
Chris Lattner b62fa74253 Test that C99 unordered comparison functions are not being turned into libc calls
llvm-svn: 14218
2004-06-18 05:42:50 +00:00
Brian Gaeke 51d3c7b05b Add load instructions for floating-point registers.
llvm-svn: 14217
2004-06-18 05:19:27 +00:00
Brian Gaeke 21305c6f0c 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 fdf197ff6e Fix printing of Argument objects, problem found by Patrick Meredith
llvm-svn: 14215
2004-06-18 04:07:20 +00:00
Chris Lattner 388f43ac3d New testcase for GCC unordered comparison builtins
llvm-svn: 14214
2004-06-18 03:39:56 +00:00
Chris Lattner aa27623b99 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 b30d12292a 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 c37af629b4 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 eca9546dc3 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 63c1d6eda8 Emit stores correctly; don't fail an assertion.
llvm-svn: 14209
2004-06-17 22:34:19 +00:00
Brian Gaeke c4ee938f55 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 a067fb3e6b Recognize more branches.
llvm-svn: 14207
2004-06-17 22:33:57 +00:00
Brian Gaeke 27b13253d9 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 4300ca9d32 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 7887da36de 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 f03f320b79 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 2f2b5f5b93 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 6b7275996c Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Chris Lattner 97bfcea262 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 395e219a1c Minor cleanup
llvm-svn: 14199
2004-06-17 17:56:54 +00:00
Misha Brukman b8561ebf21 Make header comment fit within 80 cols.
llvm-svn: 14198
2004-06-17 15:49:36 +00:00
Misha Brukman a1237d00d6 Since the Great LLVM Tool Renaming(tm), we no longer have collisions between our
assembler/linker and the system equivalents.

llvm-svn: 14197
2004-06-17 15:39:58 +00:00
Brian Gaeke 661963c63f Fix typo in DEBUG printout.
llvm-svn: 14196
2004-06-17 07:26:52 +00:00
Chris Lattner 6f4a596234 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 3b9474ecd7 Add int ferror(FILE *)
llvm-svn: 14194
2004-06-16 02:56:40 +00:00
Brian Gaeke f6920d6f34 I'm afraid this doesn't exist.
llvm-svn: 14193
2004-06-16 00:26:45 +00:00
Brian Gaeke 20e09e5c7b Um, did someone make a typo or something?
llvm-svn: 14192
2004-06-15 23:09:50 +00:00
Chris Lattner fbf4dc3bd0 isnan is dead
llvm-svn: 14191
2004-06-15 21:52:58 +00:00
Chris Lattner f64f794cad llvm.isnan is dead, long live llvm.isunordered!
llvm-svn: 14190
2004-06-15 21:50:46 +00:00
Chris Lattner 7011d35594 Remove support for llvm.isnan. Alkis wins :)
llvm-svn: 14189
2004-06-15 21:48:07 +00:00
Chris Lattner ee92bfca97 This testcase is a bit silly now, but oh well :)
llvm-svn: 14188
2004-06-15 21:46:16 +00:00
Chris Lattner de2f567a20 Remove isnan support, correct isunordered support
llvm-svn: 14187
2004-06-15 21:42:23 +00:00
Chris Lattner 5a542aadc8 Remove support for the isnan intrinsic
llvm-svn: 14186
2004-06-15 21:37:54 +00:00
Chris Lattner 70dfc06e02 Add basic support for the isunordered intrinsic. The isnan stuff still needs to go
llvm-svn: 14185
2004-06-15 21:36:44 +00:00
Chris Lattner 75bcc59f1c Right, stop being silly
llvm-svn: 14184
2004-06-15 21:29:40 +00:00
Chris Lattner ce4ac095f0 Add a nan, stop testing isnan
llvm-svn: 14183
2004-06-15 21:29:01 +00:00
Brian Gaeke 476c73b241 Fix thinko in visitor... ShiftInsts should currently be delegated
to visitBinaryOperator.

llvm-svn: 14182
2004-06-15 21:09:46 +00:00
Chris Lattner b1f0478f1d Do not dereference end iterators. It's really bad for the asmwriter's health.
This possibly fixes PR370

llvm-svn: 14181
2004-06-15 21:07:32 +00:00
Brian Gaeke 675c0e9701 I think we'll use the standard lowering passes for now.
llvm-svn: 14179
2004-06-15 20:37:12 +00:00
Brian Gaeke 0c8ee30d53 Fix bug generating code for void call instructions: don't call
getReg() on void value.

llvm-svn: 14178
2004-06-15 20:06:32 +00:00
Brian Gaeke 065a6cb93a Squash a warning from the Solaris assembler by aligning the stack
on a double-word boundary instead of a single-word boundary.

llvm-svn: 14177
2004-06-15 19:53:10 +00:00
Brian Gaeke ad98a9b526 Allow special-casing of operand printing based on opcode. Print
non-register, non-immed. arguments to SETHI and OR using %hi() and
%lo() respectively.

llvm-svn: 14176
2004-06-15 19:52:59 +00:00
Brian Gaeke 19fbd28a06 Support constant GEP expressions.
Support copying long constants to register pairs.
Support copying ConstantPointerNulls and ConstantPointerRefs to registers.

llvm-svn: 14175
2004-06-15 19:16:07 +00:00
Misha Brukman 342693e35b The correct prototype is `int atoi(CONST char*)'. Unbroke AIX build.
llvm-svn: 14173
2004-06-14 16:30:05 +00:00
Misha Brukman bba0f0e492 Add file comment.
llvm-svn: 14172
2004-06-14 15:13:59 +00:00
Brian Gaeke 21370771ba Quick hack to get this file compiling again on Mac OS X. The right thing to do
is write an autoconf macro that checks whether __isnan or isnan actually works
**using the C++ compiler after #include <cmath>**, instead of doing it the easy
way with AC_CHECK_FUNCS().

llvm-svn: 14171
2004-06-14 06:33:19 +00:00
Brian Gaeke 99c6539bce Make -print-machineinstrs even stronger. You get to see the final code after
peepholing, and make it work the same way in the JIT as in LLC.

llvm-svn: 14170
2004-06-14 05:05:45 +00:00
Reid Spencer d5a21b0575 Get rid of "might be uninitialized" warnings when compiling with GCC 3.3.2
llvm-svn: 14169
2004-06-13 19:17:49 +00:00
Alkis Evlogimenos e395468ae5 Add constant folding capabilities to the isunordered intrinsic.
llvm-svn: 14168
2004-06-13 01:23:56 +00:00
Alkis Evlogimenos 0fa392310a Really add the docs this time :-)
llvm-svn: 14167
2004-06-13 01:16:15 +00:00
Alkis Evlogimenos cf9f8f1762 Make assertions more consistent with the rest of the intrinsic
function verification and make it a requirement that both arguments to
llvm.isunordered are of the same type.

llvm-svn: 14165
2004-06-13 00:55:26 +00:00
Alkis Evlogimenos 9d740629a0 Add the isunordered intrinsic.
llvm-svn: 14159
2004-06-12 19:19:14 +00:00
Reid Spencer 0a70ceb55f Reduce the number of columns in the alpha index to 4 so that it fits
on a 1280x1024 screen!

llvm-svn: 14158
2004-06-12 14:46:02 +00:00
Chris Lattner 27f44fe1f8 It is no longer 2001
llvm-svn: 14157
2004-06-11 21:12:22 +00:00
Brian Gaeke 787ed2f377 Don't trim @PrevDays (causing an error) if it isn't long enough.
llvm-svn: 14156
2004-06-11 19:55:30 +00:00
Misha Brukman fb35b09738 Fix grammar: 's is for possessive only.
llvm-svn: 14155
2004-06-11 16:50:21 +00:00
Reid Spencer c0999e134e Implement tracking of bytecode instruction size and the number of long
instructions generated.

llvm-svn: 14154
2004-06-11 15:10:38 +00:00
Reid Spencer 80ae844ea8 Add two options to the program:
-release causes ENABLE_OPTIMIZED=1 to be added to the make line so that
         the test runs against optimized code.
-pedantic causes the CompileOptimizeOpts variable to be overridden to
          add several additional warnings not picked up by -Wall. This
	  should help catch additional programming faux pas. See the diff
	  for the specific details.

llvm-svn: 14153
2004-06-11 07:06:22 +00:00
Chris Lattner 5888b5d4b1 Fix fallout from getOffsetOfLocalArea() being negated. Debugging dumps were being
printed incorrectly, and we were reserving 8 extra bytes of stack space for functions
on X86.

llvm-svn: 14152
2004-06-11 06:37:11 +00:00
Chris Lattner 66f313725c llvm.isnan doesn't access memory
llvm-svn: 14151
2004-06-11 06:17:13 +00:00
Chris Lattner ec941f7abb Constant fold the isnan intrinsic
llvm-svn: 14150
2004-06-11 06:16:23 +00:00
Chris Lattner b82f707e30 Add tests for isnan
llvm-svn: 14149
2004-06-11 06:16:13 +00:00
Chris Lattner 1c2be0e5a9 By far, one of the most common uses of isnan is to make 'isunordered'
comparisons.  In an 'isunordered' predicate, which looks like this at
the LLVM level:

        %a = call bool %llvm.isnan(double %X)
        %b = call bool %llvm.isnan(double %Y)
        %COM = or bool %a, %b

We used to generate this code:

        fxch %ST(1)
        fucomip %ST(0), %ST(0)
        setp %AL
        fucomip %ST(0), %ST(0)
        setp %AH
        or %AL, %AH

With this patch, we generate this code:

        fucomip %ST(0), %ST(1)
        fstp %ST(0)
        setp %AL

Which should make alkis happy.  Tested as X86/compare_folding.llx:test1

llvm-svn: 14148
2004-06-11 05:33:49 +00:00
Chris Lattner 858cb55a5c Test that the X86 backend is only emitting one fucom instruction
for each 'COM =' line.

llvm-svn: 14147
2004-06-11 05:30:34 +00:00
Chris Lattner 71186e2fb6 Fix bug in previous checkin
llvm-svn: 14146
2004-06-11 05:22:44 +00:00
Chris Lattner 5ed9113e14 No really, these are dead now
llvm-svn: 14145
2004-06-11 04:50:14 +00:00
Chris Lattner b35f47627d Now that compare instructions aren't lumped in with the other twoargfp instructions,
we can get rid of the FpUCOM/FpUCOMi pseudo instructions, which makes stuff simpler
and faster.

llvm-svn: 14144
2004-06-11 04:49:02 +00:00
Chris Lattner 0876edf122 Introduce a new FP instruction type to separate the compare cases from the
twoarg cases.

llvm-svn: 14143
2004-06-11 04:41:24 +00:00
Chris Lattner 4e71aa84d5 Bug fixed, new feature
llvm-svn: 14142
2004-06-11 04:35:21 +00:00
Chris Lattner 26a964f88e Add direct support for the isnan intrinsic, implementing test/Regression/CodeGen/X86/isnan.llx
testcase

llvm-svn: 14141
2004-06-11 04:31:10 +00:00
Chris Lattner a0cfedef3a Add support for the setp instructions
llvm-svn: 14140
2004-06-11 04:30:06 +00:00
Chris Lattner 94ff2c3210 Split compare instruction handling OUT of handleTwoArgFP into handleCompareFP.
This makes the code much simpler, and the two cases really do belong apart.
Once we do it, it's pretty obvious how flawed the logic was for A != A case,
so I fixed it (fixing PR369).

This also uses freeStackSlotAfter instead of inserting an fxchg then
popStackAfter'ing in the case where there is a dead result (unlikely, but
possible), producing better code.

llvm-svn: 14139
2004-06-11 04:25:06 +00:00
Reid Spencer 95290c7d33 Change tags rule to pipe output from find through etags command so that it
doesn't break on machines with limited command line lengths.

llvm-svn: 14138
2004-06-11 03:10:27 +00:00
Reid Spencer c22be9f9d5 Revert an unneeded interface change to Instruction.h
llvm-svn: 14137
2004-06-11 03:06:43 +00:00
Chris Lattner a5ddab2779 Testcase for PR369
llvm-svn: 14136
2004-06-11 02:59:47 +00:00
Chris Lattner 434cc49bca Check to make sure that isnan doesn't require calling a function
llvm-svn: 14135
2004-06-11 02:54:54 +00:00
Chris Lattner 0c6db524d6 Fix lowering to work correctly
llvm-svn: 14134
2004-06-11 02:54:02 +00:00
Chris Lattner 8f40e35934 I misled Alkis: LLVM should have isnan, not isunordered.
isunordered(X, Y) === isnan(X) | isnan(Y)

Remove isunordered, add isnan.

Modernize testcase

llvm-svn: 14133
2004-06-11 02:29:57 +00:00
Chris Lattner 8f69c9e439 I misled Alkis: LLVM should have isnan, not isunordered.
isunordered(X, Y) === isnan(X) | isnan(Y)

Remove isunordered, add isnan.

llvm-svn: 14132
2004-06-11 02:29:43 +00:00
Chris Lattner 3b4f437526 Document the llvm.isnan intrinsic
llvm-svn: 14131
2004-06-11 02:28:03 +00:00
Brian Gaeke 522235efbf Bug fixed.
llvm-svn: 14130
2004-06-11 02:15:39 +00:00
Brian Gaeke 5caed4e7dd Test case for PR368
llvm-svn: 14129
2004-06-11 02:11:43 +00:00
Brian Gaeke 2655aab200 Turn loads of ConstantPointerNulls into loads of zero... don't spill
them into the constant pool.

llvm-svn: 14128
2004-06-11 02:03:48 +00:00
Alkis Evlogimenos d0b5d0c7cc Add the isunordered intrinsic.
llvm-svn: 14127
2004-06-11 01:08:18 +00:00
Alkis Evlogimenos 2baa85e8be Add feature test for llvm intrinsics. It currently contains only the "isunordered" intrinsic
llvm-svn: 14126
2004-06-11 01:06:40 +00:00
Reid Spencer c4bbb8f70b Updated the BytecodeAnalysis data structure to contain additional fields
needed for analysis of individual functions.

llvm-svn: 14125
2004-06-10 22:28:11 +00:00
Reid Spencer 7e5d80033d Added an isPhiNode(unsigned) static method to determine if an opcode is
a PhiNode or not. Needed by Bytecode Analyzer.

llvm-svn: 14124
2004-06-10 22:27:10 +00:00
Reid Spencer 8395e67fb1 Remove tabs.
llvm-svn: 14123
2004-06-10 22:03:00 +00:00
Reid Spencer 7670bbdfb9 Implement detailed function level data collection and reporting.
llvm-svn: 14122
2004-06-10 22:00:54 +00:00
Reid Spencer 90f0032664 Adjust prototypes to new Handler interface.
llvm-svn: 14121
2004-06-10 22:00:29 +00:00
Reid Spencer 2491b0959e Make the parser deal with functions instead of just function types.
llvm-svn: 14120
2004-06-10 21:59:20 +00:00
Reid Spencer b3a4e0b9bd Clean up documentation and naming of variables.
llvm-svn: 14119
2004-06-10 18:38:44 +00:00
Misha Brukman ffdffe1d76 Remove extra space.
llvm-svn: 14117
2004-06-10 12:51:35 +00:00
Reid Spencer ff35cf92c5 Doxygenize a comment.
llvm-svn: 14115
2004-06-10 08:27:00 +00:00
Reid Spencer 1080b373a2 Made detailed output the default and changed -details option to -nodetails.
llvm-svn: 14114
2004-06-10 08:24:42 +00:00
Reid Spencer 8e5de9cd75 Implemented the bulk of the functionality. Cleaned up the code.
llvm-svn: 14113
2004-06-10 08:09:13 +00:00
Brian Gaeke 966938cff2 Allow dates with slashes in them in $DateRE.
Don't match on $Filename (which will be unset) if we hit 'UNMATCHABLE:'.

llvm-svn: 14112
2004-06-10 07:44:28 +00:00
Chris Lattner 175532bb1e Fix the prolog epilog code inserter to match the documentation and support
targets whose stack grows up.

Patch contributed by Vladimir Prus

llvm-svn: 14111
2004-06-10 06:23:35 +00:00
Chris Lattner 6d6b3b3ce9 Fix the fixed stack offset, patch contributed by Vladimir Prus
llvm-svn: 14110
2004-06-10 06:19:25 +00:00
Chris Lattner ee59d4bf04 Fix a bug in my checkin from last night that caused miscompilations of
186.crafty, fhourstones and 132.ijpeg.

Bugpoint makes really nasty miscompilations embarassingly easy to find.  It
narrowed it down to the instcombiner and this testcase (from fhourstones):

bool %l7153_l4706_htstat_loopentry_2E_4_no_exit_2E_4(int* %i, [32 x int]* %works, int* %tmp.98.out) {
newFuncRoot:
        %tmp.96 = load int* %i          ; <int> [#uses=1]
        %tmp.97 = getelementptr [32 x int]* %works, long 0, int %tmp.96         ; <int*> [#uses=1]
        %tmp.98 = load int* %tmp.97             ; <int> [#uses=2]
        %tmp.99 = load int* %i          ; <int> [#uses=1]
        %tmp.100 = and int %tmp.99, 7           ; <int> [#uses=1]
        %tmp.101 = seteq int %tmp.100, 7                ; <bool> [#uses=2]
        %tmp.102 = cast bool %tmp.101 to int            ; <int> [#uses=0]
        br bool %tmp.101, label %codeRepl4.exitStub, label %codeRepl3.exitStub

codeRepl4.exitStub:             ; preds = %newFuncRoot
        store int %tmp.98, int* %tmp.98.out
        ret bool true

codeRepl3.exitStub:             ; preds = %newFuncRoot
        store int %tmp.98, int* %tmp.98.out
        ret bool false
}

... which only has one combination performed on it:

$ llvm-as < t.ll | opt -instcombine -debug | llvm-dis
IC: Old =       %tmp.101 = seteq int %tmp.100, 7                ; <bool> [#uses=1]
    New =       setne int %tmp.100, 0           ; <bool>:<badref> [#uses=0]
IC: MOD =       br bool %tmp.101, label %codeRepl3.exitStub, label %codeRepl4.exitStub
IC: MOD =       %tmp.97 = getelementptr [32 x int]* %works, uint 0, int %tmp.96         ; <int*> [#uses=1]

It doesn't get much better than this.  :)

llvm-svn: 14109
2004-06-10 02:33:20 +00:00
Chris Lattner c8e7e298c1 More minor cleanups
llvm-svn: 14108
2004-06-10 02:12:35 +00:00
Chris Lattner df20a4d589 Eliminate many occurrances of Instruction::
llvm-svn: 14107
2004-06-10 02:07:29 +00:00
Chris Lattner 88ba175c1e Share some code
llvm-svn: 14106
2004-06-10 01:57:38 +00:00
Chris Lattner 867653ad6a Add new BinaryOperator::createAdd/Sub/... methods to avoid having to type
llvm::Instruction:: all of the time.

llvm-svn: 14105
2004-06-10 01:43:29 +00:00
Chris Lattner 68a038e6a1 Tolerate more errors
llvm-svn: 14104
2004-06-09 22:22:10 +00:00
Brian Gaeke 5b03a0628f Encode %fsr correctly; don't fail an assertion.
llvm-svn: 14103
2004-06-09 21:54:59 +00:00
Brian Gaeke 87d8878f6d Fix encoding of ST*FSR instructions.
llvm-svn: 14102
2004-06-09 21:54:58 +00:00
Brian Gaeke 87c75632ee Fix assertion failure message to have the right method name.
llvm-svn: 14101
2004-06-09 20:44:42 +00:00
Chris Lattner 757ee0b533 Make the asmwriter much more tolerant of errors (which are common when working
on new front-ends and stuff).  Also get rid of some tabs that snuck in.

llvm-svn: 14100
2004-06-09 19:41:19 +00:00
Reid Spencer f8d610ca73 Columnized the compilation statistics for easier reading.
llvm-svn: 14099
2004-06-09 18:29:15 +00:00
Chris Lattner 4408630c67 Fix the really bizarre stuff that happened last night in the tester
due to non-numeric diff failures that caused fpcmp to go into infinite loops

llvm-svn: 14098
2004-06-09 18:28:53 +00:00
Reid Spencer 8beac69819 Made it possible for the printInfoComment method to invoke getSlot in
such a way that if the Value being printed is standalone that we don't
assert and abort but just print ":??" for the slot number instead.

llvm-svn: 14097
2004-06-09 15:26:53 +00:00
John Criswell 9095c64147 Fix for PR#366. We use getClassB() so that we can handle cast instructions
that cast to bool.

llvm-svn: 14096
2004-06-09 15:18:51 +00:00
Chris Lattner 35167c3087 Implement InstCombine/select.ll:test15*
llvm-svn: 14095
2004-06-09 07:59:58 +00:00
Chris Lattner ce527c8e6d More instcombine testcases
llvm-svn: 14094
2004-06-09 07:59:40 +00:00
Reid Spencer 2acee7e4d6 Cleanup alignment of output.
llvm-svn: 14093
2004-06-09 06:22:00 +00:00
Reid Spencer 1e47e066ad Add some new fields for bytecode analysis.
llvm-svn: 14092
2004-06-09 06:18:53 +00:00
Reid Spencer cc4e35a404 Implement analysis output. Don't dump function details unless requested.
llvm-svn: 14091
2004-06-09 06:17:58 +00:00
Reid Spencer 839fa681f6 Implement some rudimentary analysis.
llvm-svn: 14090
2004-06-09 06:16:43 +00:00
Reid Spencer f1598b0efa Clean up indentation of file body output.
Don't dump functions unless "detailedResults" is requested.

llvm-svn: 14089
2004-06-09 06:16:19 +00:00
Reid Spencer fc6f5508aa Move parsing details to Parser.cpp.
llvm-svn: 14088
2004-06-09 06:15:21 +00:00
Reid Spencer 670c26d3af Bring some things out of header files that belong only in this file.
llvm-svn: 14087
2004-06-09 06:14:52 +00:00
Chris Lattner 396dbfe327 Be more careful about the order we put stuff onto the worklist. This allow us to
collapse this:
bool %le(int %A, int %B) {
        %c1 = setgt int %A, %B
        %tmp = select bool %c1, int 1, int 0
        %c2 = setlt int %A, %B
        %result = select bool %c2, int -1, int %tmp
        %c3 = setle int %result, 0
        ret bool %c3
}

into:

bool %le(int %A, int %B) {
        %c3 = setle int %A, %B          ; <bool> [#uses=1]
        ret bool %c3
}

which is handy, because the Java FE makes these sequences all over the place.

This is tested as: test/Regression/Transforms/InstCombine/JavaCompare.ll

llvm-svn: 14086
2004-06-09 05:08:07 +00:00
Chris Lattner 7ed7d82512 New testcase that is important for the Java FE
llvm-svn: 14085
2004-06-09 05:07:01 +00:00
Reid Spencer e73febc64a Cleaned up a dead header file to prevent duplicate definition warnings
in doxygen.

llvm-svn: 14084
2004-06-09 04:38:34 +00:00
Chris Lattner 2dd017402b Implement select.ll:test14*
llvm-svn: 14083
2004-06-09 04:24:29 +00:00
Chris Lattner 52d7430fc5 New testcase for the instruction combiner that happen often in the Java FE
llvm-svn: 14082
2004-06-09 04:23:57 +00:00
Chris Lattner 0c09852909 Minor tweaks
llvm-svn: 14081
2004-06-09 03:59:05 +00:00
Reid Spencer 4d598edc59 Regularize title of Regression Test section. Clean up some blank space.
llvm-svn: 14080
2004-06-09 02:07:25 +00:00
Chris Lattner 4769612be1 Bug fixed
llvm-svn: 14079
2004-06-09 01:09:16 +00:00
Chris Lattner 74248512eb Workaround or a VS miscompilation bug
llvm-svn: 14078
2004-06-08 23:21:39 +00:00
Chris Lattner 8b52a68356 I checked and no clients expect this to return null for unconditional branches
Simplify code and make it more uniform.

llvm-svn: 14077
2004-06-08 22:03:05 +00:00
Chris Lattner 4c7a24af44 Don't grab the condition of unconditional branches!
This fixes PR363

llvm-svn: 14076
2004-06-08 21:50:30 +00:00
Brian Gaeke c365e7cc99 Fix a minor bug in the map - since this pass adds a global symbol, it must be
accounted for in the map (at least, in its current format).

llvm-svn: 14075
2004-06-08 20:08:30 +00:00
Brian Gaeke 78d03b523f Add a forwarding method pop_front() that allows you to delete instructions
from the beginning of a MBB.

llvm-svn: 14074
2004-06-08 18:52:47 +00:00
Brian Gaeke 76b6426a8c Add a TmpInstruction ctor that doesn't take a MCFI.
llvm-svn: 14073
2004-06-08 18:52:46 +00:00
Brian Gaeke 223b345279 Explicitly specify libtool tag "CXX" so that if you setenv CXX to something
libtool can't parse, e.g., "/path/to/g++ -some-funny-options",
then it will still be able to compile and link.

llvm-svn: 14072
2004-06-08 18:52:45 +00:00
Chris Lattner a20f4aab7f Fix a link error using VS8.0
llvm-svn: 14071
2004-06-08 17:53:24 +00:00
Chris Lattner 4409487746 Apparently a particular vendor compiler uses the struct/class tag to MANGLE
symbols with.  Therefore, if you do not use struct/class consistently, you can
get LINK ERRORS.  grr.

This fixes the link errors for libsupport and vmcore.

-Chris

llvm-svn: 14070
2004-06-08 17:44:21 +00:00
Misha Brukman 23c2f67fda Fix case of doxygen directive `\p': it's lowercase.
llvm-svn: 14068
2004-06-08 13:49:17 +00:00
Reid Spencer 7d4b814e86 * Fix indentation of Regression Test Results by making sure the
GetQMTestResults function closes all its open tags.
* Cause XFAIL results to not be reported at all except in the stats.

llvm-svn: 14067
2004-06-08 08:01:33 +00:00
Reid Spencer b14a0a69fc Put in a place holder for describing the differences in bytecode format
between LLVM versions. This is just a reminder so I don't forget to
document it.

llvm-svn: 14066
2004-06-08 07:41:41 +00:00
Reid Spencer 850f85f81f Add a note about llvm-abcd, the Analysis of ByteCode Dumper
llvm-svn: 14065
2004-06-08 07:30:31 +00:00
Chris Lattner bd948cfe38 Ooh, that fixed the annoying warning!!
llvm-svn: 14064
2004-06-08 07:19:29 +00:00
Chris Lattner 25b3a03e17 Bug fixed
llvm-svn: 14063
2004-06-08 07:15:52 +00:00
Chris Lattner 79dd360555 New testcase for PR355
llvm-svn: 14062
2004-06-08 07:11:14 +00:00
Chris Lattner 12eb60f213 Testcase for PR355
llvm-svn: 14061
2004-06-08 07:10:11 +00:00
Chris Lattner 522ef67fb2 Add documentation to the TargetFrameInfo class, contributed by Vladimir Prus
llvm-svn: 14060
2004-06-08 06:23:17 +00:00
Reid Spencer ddc6fb125e Clean up the documentation.
Simplify the file handling. It now only writes to std::cout.

llvm-svn: 14059
2004-06-08 05:56:58 +00:00
Reid Spencer 2eb0f1d44c Clean up documentation and make it possible for the BytecodeAnalyzer to
store the output of the bytecode dumper.

llvm-svn: 14058
2004-06-08 05:55:53 +00:00
Reid Spencer 42427f0ccb Fix the bug that was preventing the parser from working on all bytecode
files. It was reading non-initialized global vars when the flag said it was
initialized and vice versa. Causes mis-alignment since initialized and
non-initialized constants have different bytecode lengths.

llvm-svn: 14057
2004-06-08 05:54:47 +00:00
Reid Spencer 2c5613d1c3 Make it #include Parser.h instead of AnalyzerInternals.h since it only
needs the BytecodeHandler interface which is now in Parser.h

llvm-svn: 14056
2004-06-08 05:53:14 +00:00
Reid Spencer 621a4ad111 Adjust what's included to compensate for changes in Parser.h
llvm-svn: 14055
2004-06-08 05:52:29 +00:00
Reid Spencer fbe659d435 Merged BytecodeHandler.h into Parser.h since the parser and the handler
must always coexist. Cleaned up the documentation on these interfaces
significantly. This is in preparation for moving Parser.h to the include
directories to make it a public interface.

llvm-svn: 14054
2004-06-08 05:51:18 +00:00
Chris Lattner 71dbebf411 Fix PR361.
Dominance properties don't hold in unreachable code

llvm-svn: 14053
2004-06-07 23:07:33 +00:00
Chris Lattner 3b2e067386 New testcase for PR361
llvm-svn: 14052
2004-06-07 23:07:09 +00:00
Chris Lattner 07ab2d1d2d Make all of this functionality work directly on win32. Properly conditionalize
system specific stuff on HAVE_MKSTEMP

llvm-svn: 14051
2004-06-07 19:37:24 +00:00
Chris Lattner 6068345cc5 Implement getTimeRecord natively in Win32, properly conditionalize the
getrusage implementation on HAVE_GETRUSAGE

llvm-svn: 14050
2004-06-07 19:34:51 +00:00
Chris Lattner bbc373bf8b Eliminate more traces of the -c option
llvm-svn: 14049
2004-06-07 18:10:01 +00:00
Reid Spencer db5c86d0b1 Commit For New Tool: llvm-abcd (Analysis of ByteCode Dumper). This tool
will (eventually) provide statistical analysis of bytecode files as well
as the ability to dump them in a low level format (slot numbers not
resolved). The purpose of this is to aid in the Type!=Value change of
bug 122. With this initial release, llvm-abcd merely dumps out the
bytecode. However, the infrastructure for separating bytecode parsing from
handling the parsing events is in place. The style chosen is similar to
SAX XML parsing where a handler object is called to handlign the parsing
events. This probably isn't useful to anyone but me right now as there is
no analysis yet, and the dumper doesn't work on every bytecode file. It
will probably be useful by the end of this week. Note that there is some
duplication of code from the bytecode reader.  This was done to eliminate
errors from being introduced in the reader and to minimize the impact to
other LLVM developers. At some point, the Analyzer and the Reader will be
integrated to use the same infrastructure. Also, sorry for the minor change
to Instruction.h but I just couldn't bring myself to write code that
depends on Instruction internals.

llvm-svn: 14048
2004-06-07 17:53:43 +00:00
John Criswell b0a352c94f Added checks for mkstemp and getrusage.
llvm-svn: 14047
2004-06-07 14:26:24 +00:00
Chris Lattner 2738b7ea61 Add some notes so I can throw away one of my many todo lists.
llvm-svn: 14046
2004-06-05 20:12:36 +00:00
Chris Lattner 307e1df0d1 Fix GCC warning
llvm-svn: 14045
2004-06-05 17:44:48 +00:00
Chris Lattner 08d1b9db1e Fix GCC warnings
llvm-svn: 14044
2004-06-05 17:43:52 +00:00
Reid Spencer 1253fb9d83 Fix a few typos, spellos, grammaros.
llvm-svn: 14043
2004-06-05 14:39:24 +00:00
Reid Spencer 242ddb92bc Add "work in progress" warning.
llvm-svn: 14042
2004-06-05 14:18:02 +00:00
Alkis Evlogimenos 2c0735446b Include cerrno.
llvm-svn: 14041
2004-06-05 08:59:43 +00:00
Chris Lattner 0d63958706 Remove an unused variable.
Work around for bogus errors: no those static functions don't need to
be executed to be initialized!

llvm-svn: 14040
2004-06-05 01:05:19 +00:00