Commit Graph

8063 Commits

Author SHA1 Message Date
Misha Brukman
bd7780bc60 DForm_1, particularly used by store instructions, needs the immediate operand to
be listed second as that is how the instructions are usually created (and is the
correct asm syntax) so that it's assembled correctly from its constituents


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17183 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-23 06:08:38 +00:00
Misha Brukman
da8d96d1a1 Fix the SPR field for MTLR, MFLR, MTCTR, and MFCTR instructions.
The decimal value given in the manual (8 or 9) really needs to be multiplied by
a factor of 32 because of the group of 5 zero bits after the register code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17182 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-23 06:05:49 +00:00
Misha Brukman
15f74b3f4f The value of the XO field for MFLR and MFCTR is 339, not 399
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17181 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-23 05:38:55 +00:00
Misha Brukman
bb48249414 Remove extraneous blank line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17180 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-23 04:59:22 +00:00
Misha Brukman
3a060e5279 Align function arguments in function headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17178 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-23 04:58:32 +00:00
Chris Lattner
5fd2ab3518 Fix a bug that Brian brought to my attention. This corrects:
Assembler/2004-10-22-BCWriterUndefBug.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17177 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-23 03:10:23 +00:00
Nate Begeman
31dfc52b81 Kill casts from integer types to unsigned byte, when the cast was only used
as the shift amount operand to a shift instruction.  This was causing us to
emit unnecessary clear operations for code such as:
int foo(int x) { return 1 << x; }


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17175 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-23 00:50:23 +00:00
Misha Brukman
ec8430270a Use cleaner quoting and eliminate blank space
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17174 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-22 23:35:57 +00:00
Reid Spencer
b8d5570e95 Clean up the output from this makefile so its not verbose.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17173 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-22 23:24:39 +00:00
Misha Brukman
6b9ae58c52 Adjust rules for building .inc files due to Reid's changes of Makefile.rules
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17169 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-22 22:16:24 +00:00
Reid Spencer
8c2c3152d6 Adjust to changes in Makefile.rules
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17167 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-22 21:02:08 +00:00
Reid Spencer
4e073a871b Eliminate compilation warning on uninitialized variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17163 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-22 16:10:39 +00:00
Chris Lattner
e9ece2a746 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17161 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-22 06:43:28 +00:00
Chris Lattner
9b9918246c Fix a bug Nate noticed, where we miscompiled a simple testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17157 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-22 04:53:16 +00:00
Reid Spencer
cac731ecbe We won't use automake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17155 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-22 03:35:04 +00:00
Misha Brukman
9691a898c7 Remove debug code emitter from the JIT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17151 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-21 03:07:38 +00:00
Alkis Evlogimenos
4f9a6c30a2 Make this compile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17150 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-21 02:44:16 +00:00
Misha Brukman
3070e2ff79 * Added basic support for JITing functions, basic blocks, instruction encoding,
including registers, constants, and partial support for global addresses
* The JIT is disabled by default to allow building llvm-gcc, which wants to test
  running programs during configure


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17149 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-21 01:42:02 +00:00
Nate Begeman
0797d4905a Don't clear or sign extend bool->int. This fires a few dozen times on the test suite
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17147 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-20 21:55:41 +00:00
Brian Gaeke
a30dd79be8 Explain what this pass does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17146 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-20 19:38:58 +00:00
John Criswell
57bbfcec91 Small performance improvement in generated C code:
Instead of unconditionally copying all phi node values into temporaries for
all successor blocks, generate code that will determine what successor
block will be called and then copy only those phi node values needed by
the successor block.

This seems to cut down namd execution time from being 8% higher than GCC to
4% higher than GCC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17144 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-20 14:38:39 +00:00
Misha Brukman
d8e6e7f563 * Add baseline structural JIT code, but disable the JIT to allow llvm-gcc builds
- Support added for functions, basic blocks, constant pool, constants,
    registers, and some basic support for globals, all untested
* Turn assert()s into abort()s so that unimplemented functions fail in release


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17143 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-19 19:49:42 +00:00
Chris Lattner
3fd0e55de1 Hrm, some people complain when the compiler cheerfully tells them what it's
doing... I guess they're right.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17142 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-19 06:33:16 +00:00
Misha Brukman
3567a41307 Fix some grammar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17141 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-19 05:55:54 +00:00
Brian Gaeke
849c7b5708 Simplify mapping info generation. In particular, the LLVM-to-MachineInstr map
is no longer emitted, and we do not reference any MachineCodeForInstruction
information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17138 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-19 05:15:21 +00:00
Reid Spencer
86d341b204 Initial automake generated Makefile template
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17136 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 23:55:41 +00:00
Nate Begeman
eaa13851a7 Initial implementation of the strength reduction for GEP instructions in
loops.  This optimization is not turned on by default yet, but may be run
with the opt tool's -loop-reduce flag.  There are many FIXMEs listed in the
code that will make it far more applicable to a wide range of code, but you
have to start somewhere :)

This limited version currently triggers on the following tests in the
MultiSource directory:
pcompress2: 7 times
cfrac: 5 times
anagram: 2 times
ks: 6 times
yacr2: 2 times


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17134 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 21:08:22 +00:00
Misha Brukman
9c02f5c566 AIX does not have mkdtemp() so emulate its behavior using mktemp() and mkdir()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17131 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 17:39:45 +00:00
Chris Lattner
7d0974b9a0 Improve compatibility with VC++, patch contributed by Morten Ofstad!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17126 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 15:54:17 +00:00
Chris Lattner
f26801b0e6 Get this file compiling with VC++, patch contributed by Morten Ofstad. Thanks Morten!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17125 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 15:43:46 +00:00
Reid Spencer
17e6e44298 Correction to allow compilation with Visual C++.
Patch contributed by Morten Ofstad. Thanks Morten!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17123 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 14:38:48 +00:00
Chris Lattner
698f96f7c8 Simplify code by deleting instructions that preceed unreachable instructions.
Simplify code by simplifying terminators that branch to blocks that start
with an unreachable instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17116 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 04:07:22 +00:00
Chris Lattner
fc5c1bb000 Turn store -> null/undef into the LLVM unreachable instruction! This simple
change hacks off 10K of bytecode from perlbmk (.5%) even though the front-end
is not generating them yet and we are not optimizing the resultant code.
This isn't too bad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17111 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 03:00:50 +00:00
Chris Lattner
17be63552a Turn things with obviously undefined semantics into 'store -> null'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17110 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 02:59:09 +00:00
Chris Lattner
77bcee74da My friend the invoke instruction does not dominate all basic blocks if it
occurs in the entry node of a function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17109 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 01:48:31 +00:00
Chris Lattner
28e792c232 Fix a bug that occurs when the constant value is the result of an invoke. In
particular, invoke ret values are only live in the normal dest of the invoke
not in the unwind dest.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17108 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 01:21:17 +00:00
Chris Lattner
963869e41a Print a semicolon for the unreacahble instruction. This fixes problems
where C requires semicolons in some cases to indicate null statements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17107 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-17 23:49:11 +00:00
Chris Lattner
c7ff6c8029 Getting ADCE to interact well with unreachable instructions seems like a nontrivial
exercise that I'm not interested in tackling right now.  Just punt and treat them
like unwind's.

This 'fixes' test/Regression/Transforms/ADCE/unreachable-function.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17106 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-17 23:45:06 +00:00
Chris Lattner
3787e765fa Fix Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll
If a function had no return instruction in it, and the result of the inlined
call instruction was used, we would crash.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17104 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-17 23:21:07 +00:00
Nate Begeman
792558898f Pass -single_module option to gcc when linking dynamic libraries for use with bugpoint, so that we can bugpoint multiple .cp files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17102 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-17 23:03:32 +00:00
Nate Begeman
fcf4a42cdf Generate correct stubs for weak-linked symbols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17101 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-17 23:01:34 +00:00
Chris Lattner
cfbf9faaa4 fold gep undef, ... -> undef
This comes up many times in perlbmk and probably others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17100 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-17 21:54:55 +00:00
Chris Lattner
ca45930548 Remove printout, realize that instructions in the entry block dominate all
other blocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17099 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-17 21:31:34 +00:00
Chris Lattner
7e40f63428 When inserting PHI nodes, don't insert any phi nodes that are obviously
unneccesary.  This allows us to delete several hundred phi nodes of the
form PHI(x,x,x,undef) from 253.perlbmk and probably other programs as well.

This implements Mem2Reg/UndefValuesMerge.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17098 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-17 21:25:56 +00:00
Chris Lattner
8143c2bc0d Enhance hasConstantValue to ignore undef values in phi nodes. This allows it
to think that PHI[4, undef] == 4.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17096 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-17 21:23:26 +00:00
Chris Lattner
c30bda7540 hasConstantValue will soon return instructions that don't dominate the PHI node,
so prepare for this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17095 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-17 21:22:38 +00:00
Chris Lattner
665825e58e The first hunk corrects a bug when printing undef null values. We would print
0->field, which is illegal.  Now we print ((foo*)0)->field.

The second hunk is an optimization to not print undefined phi values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17094 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-17 17:48:59 +00:00
Chris Lattner
611fb259ba Don't print stuff out from the code generator. This broke the JIT horribly
last night. :)  bork!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17093 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-17 17:40:50 +00:00
Reid Spencer
ec660ae754 Make the library name SparcV9 specific
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17089 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-17 15:01:12 +00:00
Reid Spencer
26dde42381 Consolidate the definitions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17088 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-17 15:00:26 +00:00