Commit Graph

6778 Commits

Author SHA1 Message Date
Misha Brukman
911afde4ae * Wrap long lines
* Replace silent fall-through FIXME comments with an error to cerr and an abort
* No need to set size of statically initialized arrays


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14404 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 14:50:41 +00:00
Misha Brukman
179d97cfa3 Excise X86-specific comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14403 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 14:13:26 +00:00
Chris Lattner
9dc1b2ae9b New constant expression lowering pass to simplify your instruction selection needs.
Contributed by Vladimir Prus!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14399 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 07:48:09 +00:00
Chris Lattner
d28b0d73da Fix header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14394 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 04:24:22 +00:00
Chris Lattner
d61622857f Fix more warnings building with VC++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14391 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 00:35:55 +00:00
Tanya Lattner
b140762a45 Made a fix so that you can print out MachineInstrs that belong to a MachineBasicBlock that is not yet attached to a MachineFunction. This change includes changing the third operand (TargetMachine) to a pointer for the MachineInstr::print function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14389 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 00:13:11 +00:00
Chris Lattner
32b588039e fix warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14388 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 00:11:25 +00:00
Misha Brukman
75afe1f904 Add option to print out machine code before register allocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14387 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 23:55:01 +00:00
Misha Brukman
f3e50bea06 Use DEBUG() guard for printing out debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14386 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 23:54:05 +00:00
Misha Brukman
e327e49913 Add a `break' in the switch/case statement between the int/fp sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14385 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 23:53:24 +00:00
Misha Brukman
7f484a5fff * Lowercase the register names
* Parenthesize assert() expressions correctly
* Fix spacing around for() and if() statements


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14384 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 23:51:00 +00:00
Misha Brukman
f54ef97abc * LowercaseString moved to StringExtras.h
* Wrap long line to 80 cols


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14382 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 23:38:20 +00:00
Misha Brukman
ca428df792 * Tabs to spaces
* Send an error message to std::cerr before abort()ing


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14381 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 23:19:36 +00:00
Misha Brukman
46fd00aec6 * Tabs to spaces
* Remove unnecessary parens, braces, clean up code layout


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14379 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 23:04:11 +00:00
Misha Brukman
fadb82f920 Unindent some more code to be consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14377 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 22:00:15 +00:00
Misha Brukman
1916bf9427 Unindent some code, it only needs 2 spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14376 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 21:56:15 +00:00
Misha Brukman
98649d1796 In emitting code for a GEP instr, iterate over GEPTypes because there is one
more operand in GEPOps than there are types in GEPTypes: the pointer that is the
first operand of the GEP instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14375 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 21:54:47 +00:00
Misha Brukman
5b636315a9 * Capitalize `Java'
* Sprinkle hypens liberally
* Fix some grammar in comments


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14374 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 21:47:35 +00:00
Misha Brukman
09ba906cf5 Convert tabs to spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14373 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 21:31:16 +00:00
Brian Gaeke
57ff2e3ee7 Add FSTOD and FDTOS conversion instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14372 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 21:22:09 +00:00
Brian Gaeke
495a0974f4 Support cast float to float, cast double to float, and cast float to double.
(It's not yet clear how to copy doubles from register to register.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14371 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 21:22:08 +00:00
Vikram S. Adve
e0e12ac377 This file is unused, and duplicates functionality in TraceValues.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14369 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 20:16:22 +00:00
Misha Brukman
05794498d9 * Order #includes
* Use the DEBUG() guard for debug printouts


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14367 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 17:31:42 +00:00
Brian Gaeke
60c73e4f23 Make the double-fp pseudo registers be "NamedRegs".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14366 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 09:23:21 +00:00
Brian Gaeke
13dc433df3 Fix a dyn_cast in copyConstantToRegister which should have been a cast.
Compactify the code that emits copies of constant ints into registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14365 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 09:17:47 +00:00
Brian Gaeke
be81e82afc The long integer pseudo-regs are history. So long, we hardly knew ye.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14364 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 08:55:21 +00:00
Brian Gaeke
c7fd0f4675 Use correct add*Imm form in more BuildMI calls.
Fix bug in emitGEPOperation where we weren't passing MBB, IP to getReg.
(hey, wouldn't a constant expression lowering pass be cool? huh huhuhuh)
Fix bug in emitGEPOperation where we might try to OR a constant into a
register which was too big to fit in the immediate field.
Support and, or, xor of longs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14363 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 08:55:09 +00:00
Brian Gaeke
af0492ea52 Rename the load and store opcodes. The non-fp ones only have one
variant worth worrying about; the fp ones have two.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14362 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 07:37:12 +00:00
Brian Gaeke
e7f9e0b539 Rename the load and store opcodes. The non-fp ones only have one
variant worth worrying about; the fp ones have two.
Add fp stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14361 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 07:36:59 +00:00
Brian Gaeke
4473303453 Rename the load and store opcodes. The non-fp ones only have one
variant worth worrying about; the fp ones have two.
Stub out the case analysis of int-to-fp casts (no code yet).
I think the number of operands passed to BuildMI for loads was wrong.
Support load and store of float and double.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14360 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 07:36:48 +00:00
Chris Lattner
5aa20212cc Remove distasteful method which is really part of the indvars pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14359 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 06:52:20 +00:00
Chris Lattner
a25502acd7 Two fixes. First, stop using the ugly shouldSubstituteIndVar method.
Second, disable substitution of quadratic addrec expressions to avoid putting
multiplies in loops!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14358 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 06:49:18 +00:00
Brian Gaeke
7548a540f7 Strange as it may sound, we'll not use LDD/STD to store longs. For reasons of
representational consistency, we want to address the halves of each 64-bit value
separately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14356 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 06:44:57 +00:00
Brian Gaeke
00e514ea6a Support constant cast expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14355 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-24 06:33:00 +00:00
Brian Gaeke
a846b729e4 Make the most commonly preselected instructions add to the names of the
instructions they augment, instead of replacing them.  It's good for debugging,
and it's OK for the sparcv9 backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14353 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-23 21:41:32 +00:00
Misha Brukman
008248f2c0 Linker.h moved to include/llvm/Support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14351 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-23 17:33:09 +00:00
Misha Brukman
c837dd93cd Linker.h moved to include/llvm/Support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14349 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-23 17:24:31 +00:00
Misha Brukman
909db65e67 Moved to lib/VMCore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14348 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-23 17:21:17 +00:00
Chris Lattner
37ec591c74 Fix merging of nodes whose incoming offset is not zero. This unbreaks DSA on
several mallocbench programs, including perl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14342 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-23 06:29:59 +00:00
Brian Gaeke
1f2b892b4b Use new IsNAN() wrapper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14340 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-23 00:25:35 +00:00
Brian Gaeke
30135b2c81 Wrapper for c99 isnan()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14338 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-22 23:54:38 +00:00
Brian Gaeke
f54d912e32 Add pseudo-registers and register class for 64-bit integer values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14332 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-22 20:14:41 +00:00
Misha Brukman
f05ff33d21 File requires IPA, moved to lib/Analysis/IPA
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14330 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-22 19:04:53 +00:00
Misha Brukman
952e38cf24 File depends on MemoryDepAnalysis (DSA); moved to lib/Analysis/DataStructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14327 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-22 18:28:37 +00:00
Misha Brukman
bab75268f0 Files depend on DSA, moved to lib/Analysis/DataStructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14326 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-22 18:13:24 +00:00
Misha Brukman
e5d6dab09e File depends on DSA, moved to lib/Analysis/DataStructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14325 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-22 18:11:38 +00:00
Misha Brukman
cc6543cb51 Making an archive version of the CodeGen library is unnecessary if we just
move InstructionLowering itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14324 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-22 17:52:30 +00:00
Misha Brukman
68fd0cae52 Provide archive version of CodeGen library (for those tools that only need
IntrinsicLowering, for instance).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14323 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-22 17:28:43 +00:00
Chris Lattner
8e667cdc94 If an edge points to a field of another memory object, actually reflect this
in the DOT visualization of the DSGraphs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14316 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-22 07:13:10 +00:00
Misha Brukman
0280aa9795 Order #includes as per style guide.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14305 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 21:54:40 +00:00
Misha Brukman
0313e0b44d Use a reference instead of a pointer for the ostream. The pointer was only
there to assist in the development of llvm-tv, and it no longer has a need to
modify the AsmWriter output stream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14304 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 21:53:56 +00:00
Misha Brukman
f90e402af8 Direct declaration of namespace-ified globals does not work, must enclose
them with a namespace declaration.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14303 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 21:44:12 +00:00
Misha Brukman
53594deff4 Specify variables' namespace directly instead of using an enclosing namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14302 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 21:21:49 +00:00
Misha Brukman
e67d5fb6fd Move implemented interface header up to the top.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14301 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 21:20:23 +00:00
Misha Brukman
3d357441bf Spell out `NoFramePointerElim'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14300 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 21:18:48 +00:00
Misha Brukman
66d6ee4247 Spell out `NoFramePointerElim' for readability.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14299 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 21:17:44 +00:00
Misha Brukman
83eaa0b567 Use the common `NoFPElim' setting instead of our own.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14298 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 21:10:24 +00:00
Misha Brukman
0fb5a66760 Implement `NoFPElim' in a target-agnostic fashion so it can be shared.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14297 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 21:08:45 +00:00
Misha Brukman
2fec9905aa * Make indentation consistent at 2 chars
* Doxygenify function comments
* Wrap code at 80 cols


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14295 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 20:22:03 +00:00
Misha Brukman
1e32f79d20 This file is no longer applicable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14294 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 20:17:41 +00:00
Misha Brukman
8c9f520b33 llvm/IntrinsicLowering.h => llvm/CodeGen/IntrinsicLowering.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14292 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 18:30:31 +00:00
Misha Brukman
a2916ce49a Intrinsic::isnan has gone away, support for it commented out.
Intrinsic::isunordered has arrived, and we just use the standard lowering
pass for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14290 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 17:58:36 +00:00
Misha Brukman
422791fa0b Convert tabs to spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14289 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 17:41:12 +00:00
Misha Brukman
358829f151 Type::getPrimitiveID() -> getTypeID()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14288 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 17:25:55 +00:00
Misha Brukman
d71bd56caa Type::getPrimitiveID() -> getTypeID()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14287 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 17:19:08 +00:00
Misha Brukman
5dfe3a9c3b Initial revision
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14283 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 16:55:25 +00:00
Chris Lattner
418da55c89 Rename Interval class to LiveInterval to avoid conflicting with the already
existing llvm::Interval class.

Patch contributed by Vladimir Prus!
http://mail.cs.uiuc.edu/pipermail/llvmbugs/2004-June/000710.html


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14281 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 13:10:56 +00:00
Chris Lattner
c2dfb8bb90 Make ConstantBool act like a 1 bit ConstantInt, in order to simplify client
code.  Patch contributed by Vladimir Prus.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14280 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 12:12:12 +00:00
Chris Lattner
2636c1be17 *FINALLY* Fix a really nasty nondeterministic bug that has been haunting us
since May 1st.  In this code, the pred iterator was being invalidated sometimes
causing the wrong entries to be added to PHI nodes.

The fix for this is to defererence and safe the *PI value before we hack on
branch instructions, which changes use/def chains, which SOMETIMES invalidates
the iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14278 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 07:19:01 +00:00
Chris Lattner
30c02f7eff Comment out the isnan stuff until we get a proper autoconf test for it
breaking the build on sparc is not acceptable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14277 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 06:17:21 +00:00
Chris Lattner
beabf45a69 Make order of argument addition deterministic. In particular, the layout
of ConstantInt objects in memory used to determine which order arguments
were added in in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14276 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 00:07:58 +00:00
Chris Lattner
541ad5e19e REALLY fix PR378: crash in scalar evolution analysis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14275 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-20 20:32:16 +00:00
Chris Lattner
2d58452f39 Fix a bug in my change last night that caused a few test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14270 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-20 17:01:44 +00:00
Chris Lattner
697692a009 IntrinsicLowering.cpp now lives in lib/CodeGen/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14269 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-20 07:59:27 +00:00
Chris Lattner
3048373748 Move the IntrinsicLowering header into the CodeGen directory, as per PR346
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14266 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-20 07:49:54 +00:00
Chris Lattner
8f7f71b48a Move the IntrinsicLowering header into the CodeGen directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14265 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-20 07:46:18 +00:00
Chris Lattner
8d741b8bef Do not sort SCEV objects by address: instead sort by complexity and group
by address.  This prevents the resultant SCEV objects from depending on
where in memory other scev objects happen to live.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14263 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-20 06:23:15 +00:00
Chris Lattner
c5c5e6afe5 Make use of BinaryOperator::create* methods to shrinkify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14262 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-20 05:04:01 +00:00
Chris Lattner
cf5933a716 Fix the inliner to be deterministic, not letting its output depend on the
relative location of Function objects in memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14260 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-20 04:11:48 +00:00
Chris Lattner
218a8223e6 Add some DEBUG output to the simplifycfg routines
Fix another non-deterministic behavior, this one should actually speed up the
code though as it was doing silly things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14258 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-20 01:13:18 +00:00
Chris Lattner
56b7ee20da Now that dominator tree children are built in determinstic order, this horrible code
can go away


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14254 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 20:23:35 +00:00
Chris Lattner
fab8596459 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14253 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 20:13:48 +00:00
Chris Lattner
f6437a3023 Print out immediate dominators in program order, not in random order based on the address
of BasicBlock objects


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14252 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 20:04:47 +00:00
Chris Lattner
aee7940d53 This will hopefully fix a heisenbug that Vladimir Merzliakov is running
into valiantly trying to compile stuff on freebsd.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14251 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 19:01:26 +00:00
Chris Lattner
2b994c7206 Fix a nasty bug, noticed by Reid
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14249 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 18:15:50 +00:00
Chris Lattner
edb8433c91 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14248 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 08:56:43 +00:00
Chris Lattner
abc35bcad3 Change to use the StableBasicBlockNumbering class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14247 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 08:42:40 +00:00
Chris Lattner
689835a2d9 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14245 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 08:05:58 +00:00
Chris Lattner
63168d2244 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14244 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 07:40:14 +00:00
Chris Lattner
1654cff8e8 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14243 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 07:02:14 +00:00
Chris Lattner
8430a4545c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14242 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-19 02:02:22 +00:00
Misha Brukman
ebb0faabd3 * Fix file header and name
* Order #includes alphabetically


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14234 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 15:38:49 +00:00
Misha Brukman
b487303725 Use the machine-independent method of querying the page size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14233 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 15:34:07 +00:00
Brian Gaeke
9d2427c074 .zero doesn't work in the Solaris assembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14231 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 08:59:16 +00:00
Brian Gaeke
a3c57624c0 Get rid of selects the easy way
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14230 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 08:46:15 +00:00
Brian Gaeke
cfaf22445c Make visitAllocaInst() look more like its X86 counterpart.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14229 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 08:45:52 +00:00
Brian Gaeke
4f217fdd10 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14228 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 08:19:08 +00:00
Brian Gaeke
fbaae01269 JMPL has a delay slot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14227 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 08:18:54 +00:00
Brian Gaeke
0735920173 Clean up the commented-out F3_3 stuff.
Replace it with a working class for FP instrs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14226 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 06:28:21 +00:00
Brian Gaeke
f89cc655ab Fix jmpl.
Add some FP moves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14225 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 06:28:10 +00:00
Brian Gaeke
ceb224148e Support printing base+offset pairs where the offset is a register.
Use this for printing the jmpl indirect-call instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14224 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 06:27:59 +00:00
Brian Gaeke
9d67ea0b61 Support intrinsic calls (although no particular intrinsics are supported yet).
Support indirect calls.
Support returning a float value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14223 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 06:27:48 +00:00
Chris Lattner
5b62aa743d Implement Transforms/InstCombine/and.ll:test17, a common case that
occurs due to unordered comparison macros in math.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14221 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 06:07:51 +00:00
Chris Lattner
e5ad50b2e8 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14219 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 05:50:48 +00:00
Brian Gaeke
562d5b0f6d Add load instructions for floating-point registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14217 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 05:19:27 +00:00
Brian Gaeke
c93a75223d Support alloca instructions.
Support copying floating-point constants to registers.
Add assertion to visitCallInst to abort if we hit a NULL calledFunction, for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14216 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 05:19:16 +00:00
Chris Lattner
a8abee2136 Fix printing of Argument objects, problem found by Patrick Meredith
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14215 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 04:07:20 +00:00
Chris Lattner
667ea024b5 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14213 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 00:50:37 +00:00
Chris Lattner
a6f9fe6dbc Fold setcc instructions into select and branches that are not in the same BB as
the setcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14212 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 00:29:22 +00:00
Brian Gaeke
6713d988a4 Make storeRegToStackSlot slightly shorter.
Make copyRegToReg return 1 instead of -1.
Edit a comment in emitPrologue().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14211 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 22:34:48 +00:00
Brian Gaeke
070bb4a8da Set the isBranch and isTerminator flags on branch instructions correctly.
Add a FIXME about the (currently unused) JMPL instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14210 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 22:34:29 +00:00
Brian Gaeke
8308d04dbc Emit stores correctly; don't fail an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14209 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 22:34:19 +00:00
Brian Gaeke
6c868a4c17 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14208 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 22:34:08 +00:00
Brian Gaeke
fc7fa31211 Recognize more branches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14207 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 22:33:57 +00:00
Brian Gaeke
afe16e1742 I love the smell of a freshly broken PowerPC build in the morning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14206 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 22:27:04 +00:00
Brian Gaeke
988b7ba5ba Make debugging dumps w/ multiple MachineBBs for a given LLVM BB readable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14205 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 22:26:53 +00:00
Chris Lattner
ccd9796a46 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14204 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 22:15:25 +00:00
Chris Lattner
5253f05709 Fix compilation problem on freebsd. Problem noted by Vladimir Merzliakov in
PR371


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14203 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 21:20:52 +00:00
Brian Gaeke
09c1309814 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14202 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 19:39:23 +00:00
Chris Lattner
f70c22b019 Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14201 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 18:19:28 +00:00
Chris Lattner
5dd04027c7 Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
Delete two functions that are now methods on the Type class


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14200 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 18:16:02 +00:00
Chris Lattner
c2616625a3 Minor cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14199 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 17:56:54 +00:00
Brian Gaeke
802daf8b7d Fix typo in DEBUG printout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14196 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 07:26:52 +00:00
Chris Lattner
aebcce8404 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14195 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-16 06:57:29 +00:00
Brian Gaeke
59108d3d40 Add int ferror(FILE *)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14194 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-16 02:56:40 +00:00
Brian Gaeke
83a7049270 Um, did someone make a typo or something?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14192 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 23:09:50 +00:00
Chris Lattner
4ee623de0b isnan is dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14191 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 21:52:58 +00:00
Chris Lattner
4adf066f99 Remove support for llvm.isnan. Alkis wins :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14189 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 21:48:07 +00:00
Chris Lattner
be78ac4422 Remove isnan support, correct isunordered support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14187 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 21:42:23 +00:00
Chris Lattner
c45ef6d395 Remove support for the isnan intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14186 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 21:37:54 +00:00
Chris Lattner
dc5724478e Add basic support for the isunordered intrinsic. The isnan stuff still needs to go
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14185 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 21:36:44 +00:00
Brian Gaeke
d6a1053745 Fix thinko in visitor... ShiftInsts should currently be delegated
to visitBinaryOperator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14182 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 21:09:46 +00:00
Chris Lattner
d1cd328560 Do not dereference end iterators. It's really bad for the asmwriter's health.
This possibly fixes PR370


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14181 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 21:07:32 +00:00
Brian Gaeke
f405280acb I think we'll use the standard lowering passes for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14179 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 20:37:12 +00:00
Brian Gaeke
e14e338724 Fix bug generating code for void call instructions: don't call
getReg() on void value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14178 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 20:06:32 +00:00
Brian Gaeke
5eb64744d0 Squash a warning from the Solaris assembler by aligning the stack
on a double-word boundary instead of a single-word boundary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14177 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 19:53:10 +00:00
Brian Gaeke
446ae11d7c Allow special-casing of operand printing based on opcode. Print
non-register, non-immed. arguments to SETHI and OR using %hi() and
%lo() respectively.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14176 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 19:52:59 +00:00
Brian Gaeke
9df92825e1 Support constant GEP expressions.
Support copying long constants to register pairs.
Support copying ConstantPointerNulls and ConstantPointerRefs to registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14175 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-15 19:16:07 +00:00
Misha Brukman
5478c7a18a Add file comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14172 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-14 15:13:59 +00:00
Brian Gaeke
fda2cce3bf 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().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14171 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-14 06:33:19 +00:00
Brian Gaeke
f3210d2c53 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14170 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-14 05:05:45 +00:00
Alkis Evlogimenos
df497317f1 Add constant folding capabilities to the isunordered intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14168 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-13 01:23:56 +00:00
Alkis Evlogimenos
ac700ca926 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14165 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-13 00:55:26 +00:00
Alkis Evlogimenos
9685372062 Add the isunordered intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14159 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-12 19:19:14 +00:00
Reid Spencer
1cf5024de1 Implement tracking of bytecode instruction size and the number of long
instructions generated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14154 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-11 15:10:38 +00:00
Chris Lattner
7f7bbc2fdb 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14152 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-11 06:37:11 +00:00
Chris Lattner
9f35196fc2 llvm.isnan doesn't access memory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14151 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-11 06:17:13 +00:00
Chris Lattner
cf11035a6f Constant fold the isnan intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14150 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-11 06:16:23 +00:00
Chris Lattner
01cdb1b367 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14148 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-11 05:33:49 +00:00
Chris Lattner
57790422ca Fix bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14146 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-11 05:22:44 +00:00