summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Make this compatible with the HP/intel compiler. Fix by Duraid, thanks!Chris Lattner2005-01-141-1/+1
| | | | llvm-svn: 19548
* Fix and improve win32 path validation.Jeff Cohen2005-01-141-10/+22
| | | | llvm-svn: 19545
* Make asctime_r work for HP/UX.Reid Spencer2005-01-141-0/+4
| | | | llvm-svn: 19544
* if two gep comparisons only differ by one index, compare that index directly.Chris Lattner2005-01-141-0/+28
| | | | | | This allows us to better optimize begin() -> end() comparisons in common cases. llvm-svn: 19542
* Do not overrun iterators. This fixes a 176.gcc crashChris Lattner2005-01-131-2/+1
| | | | llvm-svn: 19541
* Turn select C, (X+Y), (X-Y) --> (X+(select C, Y, (-Y))). This occurs inChris Lattner2005-01-131-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | the 'sim' program and probably elsewhere. In sim, it comes up for cases like this: #define round(x) ((x)>0.0 ? (x)+0.5 : (x)-0.5) double G; void T(double X) { G = round(X); } (it uses the round macro a lot). This changes the LLVM code from: %tmp.1 = setgt double %X, 0.000000e+00 ; <bool> [#uses=1] %tmp.4 = add double %X, 5.000000e-01 ; <double> [#uses=1] %tmp.6 = sub double %X, 5.000000e-01 ; <double> [#uses=1] %mem_tmp.0 = select bool %tmp.1, double %tmp.4, double %tmp.6 store double %mem_tmp.0, double* %G to: %tmp.1 = setgt double %X, 0.000000e+00 ; <bool> [#uses=1] %mem_tmp.0.p = select bool %tmp.1, double 5.000000e-01, double -5.000000e-01 %mem_tmp.0 = add double %mem_tmp.0.p, %X store double %mem_tmp.0, double* %G ret void llvm-svn: 19537
* Implement an optimization for == and != comparisons like this:Chris Lattner2005-01-131-1/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _Bool test2(int X, int Y) { return &arr[X][Y] == arr; } instead of generating this: bool %test2(int %X, int %Y) { %tmp.3.idx = mul int %X, 160 ; <int> [#uses=1] %tmp.3.idx1 = shl int %Y, ubyte 2 ; <int> [#uses=1] %tmp.3.offs2 = sub int 0, %tmp.3.idx ; <int> [#uses=1] %tmp.7 = seteq int %tmp.3.idx1, %tmp.3.offs2 ; <bool> [#uses=1] ret bool %tmp.7 } generate this: bool %test2(int %X, int %Y) { seteq int %X, 0 ; <bool>:0 [#uses=1] seteq int %Y, 0 ; <bool>:1 [#uses=1] %tmp.7 = and bool %0, %1 ; <bool> [#uses=1] ret bool %tmp.7 } This idiom occurs in C++ programs when iterating from begin() to end(), in a vector or array. For example, we now compile this: void test(int X, int Y) { for (int *i = arr; i != arr+100; ++i) foo(*i); } to this: no_exit: ; preds = %entry, %no_exit ... %exitcond = seteq uint %indvar.next, 100 ; <bool> [#uses=1] br bool %exitcond, label %return, label %no_exit instead of this: no_exit: ; preds = %entry, %no_exit ... %inc5 = getelementptr [100 x [40 x int]]* %arr, int 0, int 0, int %inc.rec ; <int*> [#uses=1] %tmp.8 = seteq int* %inc5, getelementptr ([100 x [40 x int]]* %arr, int 0, int 100, int 0) ; <bool> [#uses=1] %indvar.next = add uint %indvar, 1 ; <uint> [#uses=1] br bool %tmp.8, label %return, label %no_exit llvm-svn: 19536
* Add new ImplicitDef node, rename CopyRegSDNode class to RegSDNode.Chris Lattner2005-01-135-10/+16
| | | | llvm-svn: 19535
* Fix some bugs in code I didn't mean to check in.Chris Lattner2005-01-131-5/+12
| | | | llvm-svn: 19534
* Fix a crash compiling 129.compressChris Lattner2005-01-131-6/+109
| | | | llvm-svn: 19533
* Codegen factor nodes more intelligently according to perceived register ↵Chris Lattner2005-01-131-2/+14
| | | | | | pressure. llvm-svn: 19532
* Don't forget the existing root.Chris Lattner2005-01-131-4/+2
| | | | llvm-svn: 19531
* Initial trivial (but stupid) codegen for this node.Chris Lattner2005-01-131-0/+4
| | | | llvm-svn: 19529
* Codegen independent ops as being independent.Chris Lattner2005-01-131-7/+21
| | | | llvm-svn: 19528
* Legalize new node, add assertion.Chris Lattner2005-01-131-0/+16
| | | | llvm-svn: 19527
* Print new node.Chris Lattner2005-01-131-0/+1
| | | | llvm-svn: 19526
* Add some really pedantic assertions to the load folding code. Fix a bunchChris Lattner2005-01-131-35/+43
| | | | | | | of cases where we accidentally emitted a load folded once and unfolded elsewhere. llvm-svn: 19522
* Do not fold (zero_ext (sign_ext V)) -> (sign_ext V), they are not the same.Chris Lattner2005-01-121-2/+2
| | | | | | This fixes llvm-test/SingleSource/Regression/C/casts.c llvm-svn: 19519
* We can only fold a load into an op if there is exactly one use of the value.Chris Lattner2005-01-121-1/+2
| | | | | | | Checking to see if the load has two uses is not equivalent, as the chain value may have zero uses. llvm-svn: 19518
* New methodChris Lattner2005-01-121-0/+33
| | | | llvm-svn: 19517
* Fix sign extend to long. When coming from sbyte, we used to generate:Chris Lattner2005-01-121-2/+2
| | | | | | | | | | | | | | | | movsbl 4(%esp), %eax movl %eax, %edx sarl $7, %edx Now we generate: movsbl 4(%esp), %eax movl %eax, %edx sarl $31, %edx Which is right. llvm-svn: 19515
* Try both ways to fold an add together. This allows us to generate this codeChris Lattner2005-01-121-0/+4
| | | | | | | | | | | | | | | | | | | | | imul %EAX, %EAX, 400 add %ECX, %EAX add %ESI, DWORD PTR [%ECX + 4*%EDX] inc %EDX cmp %EDX, 100 instead of this: imul %EAX, %EAX, 400 add %ECX, %EAX mov %EAX, %EDX shl %EAX, 2 add %ECX, %EAX add %ESI, DWORD PTR [%ECX] inc %EDX cmp %EDX, 100 llvm-svn: 19513
* Shut up warnings with GCC 3.4.3 about uninitialized variables.Reid Spencer2005-01-121-2/+1
| | | | llvm-svn: 19512
* Fix a major miscompilation where we were overwriting the scale reg.Chris Lattner2005-01-121-1/+1
| | | | llvm-svn: 19511
* Do not use the type of the RHS constant to determine the type of the operation.Chris Lattner2005-01-121-1/+1
| | | | | | This fails for shifts because the constant is always 8 bits. llvm-svn: 19508
* Do not lose the offset from teh global when peephole optimizing instructions.Chris Lattner2005-01-121-1/+3
| | | | | | This fixes FreeBench/pcompress llvm-svn: 19507
* Silence VC++ warnings.Chris Lattner2005-01-124-17/+22
| | | | llvm-svn: 19506
* Fix C++ more compilatiom errorsJeff Cohen2005-01-121-0/+1
| | | | llvm-svn: 19504
* Fix a compile error with VC++, which things that static const arrays needChris Lattner2005-01-121-2/+2
| | | | | | to be dynamically initialized. :( llvm-svn: 19503
* Fix a bug that caused us to crash on povray. We weren't emitting an ↵Chris Lattner2005-01-121-49/+69
| | | | | | FP_REG_KILL into a block that had a successor with a FP PHI node. llvm-svn: 19502
* Print a load of a null pointer (in intel mode) like this:Chris Lattner2005-01-121-1/+1
| | | | | | | | | | mov %AX, WORD PTR [0] instead of like this: mov %AX, WORD PTR [] llvm-svn: 19501
* Print a load of a null pointer like this:Chris Lattner2005-01-121-1/+1
| | | | | | | | | | movw 0, %ax instead of like this: movw , %ax llvm-svn: 19500
* Fix a crash compiling povray on UINT_TO_FP from i16.Chris Lattner2005-01-121-3/+1
| | | | llvm-svn: 19499
* Add an option to view the selection dags as they are generated.Chris Lattner2005-01-121-0/+11
| | | | llvm-svn: 19498
* There are no [mem] op= reg instructions for FP, so remove their entries.Chris Lattner2005-01-121-12/+11
| | | | llvm-svn: 19496
* Fix a bug where we didn't insert FP_REG_KILL instructions into MBB's thatChris Lattner2005-01-121-0/+15
| | | | | | | contain FP PHI nodes but no other FP defining instructions. This fixes 183.equake llvm-svn: 19495
* Fold TRUNCATE (LOAD P) into a smaller load from P.Chris Lattner2005-01-121-0/+15
| | | | llvm-svn: 19494
* Be more careful about order of arg evalution for CopyToReg nodes. This shrinksChris Lattner2005-01-121-2/+47
| | | | | | | | | 256.bzip2 from 7142 to 7103 lines of .s file. Second, add initial support for folding loads into compares, though this code is dynamically dead for now. :( llvm-svn: 19493
* Fold some more [mem] op= val operators. This allows us to things like thisChris Lattner2005-01-121-2/+39
| | | | | | | | | | | | | several times in 256.bzip2: mov %EAX, DWORD PTR [%ESP + 204] - mov %EAX, DWORD PTR [%EAX] - or %EAX, 2097152 - mov %ECX, DWORD PTR [%ESP + 204] - mov DWORD PTR [%ECX], %EAX + or DWORD PTR [%EAX], 2097152 llvm-svn: 19492
* Fold loads into sign/zero extends. instead of:Chris Lattner2005-01-111-2/+25
| | | | | | | | | | | mov %AL, BYTE PTR [%EDX + l18_length_code] movzx %EAX, %AL Emit: movzx %EAX, BYTE PTR [%EDX + l18_length_code] llvm-svn: 19489
* Comment out debug code :)Chris Lattner2005-01-111-2/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | Select [mem] += Val operations. For constants, we used to get: mov %ECX, -32768 add %ECX, DWORD PTR [l4_match_start] mov DWORD PTR [l4_match_start], %ECX Now we get: add DWORD PTR [l4_match_start], -32768 For other values we used to get: mov %EBP, %EDI ;; because the add destroys the value add %EBP, DWORD PTR [l4_input_len] mov DWORD PTR [l4_input_len], %EBP now we get: add DWORD PTR [l4_input_len], %EDI Both of these use less registers than the alternative, are faster and smaller. llvm-svn: 19488
* Handle the global address case here, not just the offset case.Chris Lattner2005-01-111-4/+11
| | | | llvm-svn: 19487
* Treat int constants as not requiring a register, since they are almost alwaysChris Lattner2005-01-111-14/+22
| | | | | | folded into an instruction. llvm-svn: 19486
* Print the value types in the nodes of the graphChris Lattner2005-01-111-0/+19
| | | | llvm-svn: 19485
* add an assertion, avoid creating copyfromreg/copytoreg pairs that are theChris Lattner2005-01-111-2/+5
| | | | | | same for PHI nodes. llvm-svn: 19484
* * Factor a bunch of binary operator cases into shared code.Chris Lattner2005-01-111-192/+241
| | | | | | | * Fold loads into Add, sub, and, or, xor and mul when possible. * Codegen shl X, 1 as add X, X llvm-svn: 19483
* Clear the whole array, always.Chris Lattner2005-01-111-1/+1
| | | | llvm-svn: 19482
* Fold multiplies by 3,5,9 into addressing modes when possible.Chris Lattner2005-01-111-0/+28
| | | | llvm-svn: 19480
* Squelch optimized warning.Chris Lattner2005-01-111-0/+1
| | | | llvm-svn: 19475
* Instead of generating stuff like this:Chris Lattner2005-01-111-1/+14
| | | | | | | | | | | | | | | mov %ECX, %EAX add %ECX, 32768 mov %SI, WORD PTR [2*%ECX + l13_prev] Generate this: mov %SI, WORD PTR [2*%ECX + l13_prev + 65536] This occurs when you have a GEP instruction where an index is "something + imm". llvm-svn: 19472
OpenPOWER on IntegriCloud