aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Declare a function in the correct namespace.Reid Spencer2004-10-181-1/+1
| | | | | | | Patch contributed by Morten Ofstad. Thanks Morten! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17124 91177308-0d34-0410-b5e6-96231b3b80d8
* Correction to allow compilation with Visual C++.Reid Spencer2004-10-184-6/+8
| | | | | | | Patch contributed by Morten Ofstad. Thanks Morten! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17123 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code by deleting instructions that preceed unreachable instructions.Chris Lattner2004-10-181-1/+101
| | | | | | | | 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
* New testcaseChris Lattner2004-10-181-0/+29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17115 91177308-0d34-0410-b5e6-96231b3b80d8
* Actually link all the analysis passes and their dependencies.Reid Spencer2004-10-181-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17114 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove extra comma.Reid Spencer2004-10-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17113 91177308-0d34-0410-b5e6-96231b3b80d8
* Actually link in all the analysis passes.Reid Spencer2004-10-181-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17112 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn store -> null/undef into the LLVM unreachable instruction! This simpleChris Lattner2004-10-181-0/+27
| | | | | | | | | 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
* Turn things with obviously undefined semantics into 'store -> null'Chris Lattner2004-10-181-26/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17110 91177308-0d34-0410-b5e6-96231b3b80d8
* My friend the invoke instruction does not dominate all basic blocks if itChris Lattner2004-10-181-1/+2
| | | | | | | 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
* Fix a bug that occurs when the constant value is the result of an invoke. InChris Lattner2004-10-181-5/+6
| | | | | | | | 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
* Print a semicolon for the unreacahble instruction. This fixes problemsChris Lattner2004-10-172-2/+2
| | | | | | | 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
* Getting ADCE to interact well with unreachable instructions seems like a ↵Chris Lattner2004-10-171-2/+3
| | | | | | | | | | | | 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
* New testcase that ADCE shouldn't crash onChris Lattner2004-10-171-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17105 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.llChris Lattner2004-10-171-4/+8
| | | | | | | | 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
* New testcase that crashes the inlinerChris Lattner2004-10-171-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17103 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass -single_module option to gcc when linking dynamic libraries for use ↵Nate Begeman2004-10-172-0/+2
| | | | | | 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
* Generate correct stubs for weak-linked symbolsNate Begeman2004-10-171-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17101 91177308-0d34-0410-b5e6-96231b3b80d8
* fold gep undef, ... -> undefChris Lattner2004-10-171-1/+8
| | | | | | | 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
* Remove printout, realize that instructions in the entry block dominate allChris Lattner2004-10-171-6/+6
| | | | | | | other blocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17099 91177308-0d34-0410-b5e6-96231b3b80d8
* When inserting PHI nodes, don't insert any phi nodes that are obviouslyChris Lattner2004-10-171-10/+31
| | | | | | | | | | 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
* New testcase, no PHI should be inserted.Chris Lattner2004-10-171-0/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17097 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance hasConstantValue to ignore undef values in phi nodes. This allows itChris Lattner2004-10-171-2/+3
| | | | | | | to think that PHI[4, undef] == 4. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17096 91177308-0d34-0410-b5e6-96231b3b80d8
* hasConstantValue will soon return instructions that don't dominate the PHI node,Chris Lattner2004-10-172-20/+39
| | | | | | | so prepare for this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17095 91177308-0d34-0410-b5e6-96231b3b80d8
* The first hunk corrects a bug when printing undef null values. We would printChris Lattner2004-10-172-12/+22
| | | | | | | | | 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
* Don't print stuff out from the code generator. This broke the JIT horriblyChris Lattner2004-10-171-1/+0
| | | | | | | last night. :) bork! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17093 91177308-0d34-0410-b5e6-96231b3b80d8
* Add HAVE_BZLIB_H and HAVE_ZLIB_H tests.Reid Spencer2004-10-171-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17092 91177308-0d34-0410-b5e6-96231b3b80d8
* Update to reflect building zlib for LLVMReid Spencer2004-10-171-151/+673
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17091 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing targets for install/cleanReid Spencer2004-10-171-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17090 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the library name SparcV9 specificReid Spencer2004-10-171-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17089 91177308-0d34-0410-b5e6-96231b3b80d8
* Consolidate the definitionsReid Spencer2004-10-171-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17088 91177308-0d34-0410-b5e6-96231b3b80d8
* PPC32GenCodeEmitter instead of PowerPCGenCodeEmitterReid Spencer2004-10-171-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17087 91177308-0d34-0410-b5e6-96231b3b80d8
* Add runtime directoriesReid Spencer2004-10-172-34/+339
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17086 91177308-0d34-0410-b5e6-96231b3b80d8
* Support bytecode generation, GenCodeEmitter, etc.Reid Spencer2004-10-171-28/+92
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17085 91177308-0d34-0410-b5e6-96231b3b80d8
* Add runtime directory, include Makefile_rulesReid Spencer2004-10-171-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17084 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite support for cast uint -> FP. In particular, we used to compile this:Chris Lattner2004-10-171-14/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | double %test(uint %X) { %tmp.1 = cast uint %X to double ; <double> [#uses=1] ret double %tmp.1 } into: test: sub %ESP, 8 mov %EAX, DWORD PTR [%ESP + 12] mov %ECX, 0 mov DWORD PTR [%ESP], %EAX mov DWORD PTR [%ESP + 4], %ECX fild QWORD PTR [%ESP] add %ESP, 8 ret ... which basically zero extends to 8 bytes, then does an fild for an 8-byte signed int. Now we generate this: test: sub %ESP, 4 mov %EAX, DWORD PTR [%ESP + 8] mov DWORD PTR [%ESP], %EAX fild DWORD PTR [%ESP] shr %EAX, 31 fadd DWORD PTR [.CPItest_0 + 4*%EAX] add %ESP, 4 ret .section .rodata .align 4 .CPItest_0: .quad 5728578726015270912 This does a 32-bit signed integer load, then adds in an offset if the sign bit of the integer was set. It turns out that this is substantially faster than the preceeding sequence. Consider this testcase: unsigned a[2]={1,2}; volatile double G; void main() { int i; for (i=0; i<100000000; ++i ) G += a[i&1]; } On zion (a P4 Xeon, 3Ghz), this patch speeds up the testcase from 2.140s to 0.94s. On apoc, an athlon MP 2100+, this patch speeds up the testcase from 1.72s to 1.34s. Note that the program takes 2.5s/1.97s on zion/apoc with GCC 3.3 -O3 -fomit-frame-pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17083 91177308-0d34-0410-b5e6-96231b3b80d8
* Unify handling of constant pool indexes with the other code paths, allowingChris Lattner2004-10-171-17/+17
| | | | | | | us to use index registers for CPI's git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17082 91177308-0d34-0410-b5e6-96231b3b80d8
* Give the asmprinter the ability to print memrefs with a constant pool index,Chris Lattner2004-10-171-26/+41
| | | | | | | index reg and scale git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17081 91177308-0d34-0410-b5e6-96231b3b80d8
* fold:Chris Lattner2004-10-171-3/+46
| | | | | | | | | | | | | | | | | | | | | %X = and Y, constantint %Z = setcc %X, 0 instead of emitting: and %EAX, 3 test %EAX, %EAX je .LBBfoo2_2 # UnifiedReturnBlock We now emit: test %EAX, 3 je .LBBfoo2_2 # UnifiedReturnBlock This triggers 581 times on 176.gcc for example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17080 91177308-0d34-0410-b5e6-96231b3b80d8
* All of these labels are off by one now that the unreachable instruction existsChris Lattner2004-10-171-21/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17079 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement bitfield insert by recognizing the following pattern:Nate Begeman2004-10-171-5/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. optional shift left 2. and x, immX 3. and y, immY 4. or z, x, y ==> rlwimi z, x, y, shift, mask begin, mask end where immX == ~immY and immX is a run of set bits. This transformation fires 32 times on voronoi, once on espresso, and probably several dozen times on external benchmarks such as gcc. To put this in terms of actual code generated for struct B { unsigned a : 3; unsigned b : 2; }; void storeA (struct B *b, int v) { b->a = v;} void storeB (struct B *b, int v) { b->b = v;} Old: _storeA: rlwinm r2, r4, 0, 29, 31 lwz r4, 0(r3) rlwinm r4, r4, 0, 0, 28 or r2, r4, r2 stw r2, 0(r3) blr _storeB: rlwinm r2, r4, 3, 0, 28 rlwinm r2, r2, 0, 27, 28 lwz r4, 0(r3) rlwinm r4, r4, 0, 29, 26 or r2, r2, r4 stw r2, 0(r3) blr New: _storeA: lwz r2, 0(r3) rlwimi r2, r4, 0, 29, 31 stw r2, 0(r3) blr _storeB: lwz r2, 0(r3) rlwimi r2, r4, 3, 27, 28 stw r2, 0(r3) blr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17078 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix constant folding relational operators with undef operands.Chris Lattner2004-10-171-7/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17077 91177308-0d34-0410-b5e6-96231b3b80d8
* Reid added --version to the CommandLine lib. Don't conflict with it.Chris Lattner2004-10-171-4/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17076 91177308-0d34-0410-b5e6-96231b3b80d8
* I forgot that sparc no longer uses the shared asmwriter. Give it supportChris Lattner2004-10-171-2/+4
| | | | | | | for undef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17075 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for unreachable and undefChris Lattner2004-10-172-0/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17074 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial Makefile.am for building with automakeReid Spencer2004-10-1720-0/+346
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17073 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial Makefile.am for building with automake.Reid Spencer2004-10-171-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17072 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure that for systems where the string functions are actually macrosReid Spencer2004-10-171-0/+24
| | | | | | | | that we undefine the macro before using its name in the definition. This can happen on Linux if _GNU_SOURCE is defined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17071 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement constant folding of undef values.Chris Lattner2004-10-161-4/+54
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17070 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a type violationChris Lattner2004-10-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17069 91177308-0d34-0410-b5e6-96231b3b80d8