- Apr 12, 2004
-
-
Chris Lattner authored
llvm-svn: 12849
-
Chris Lattner authored
llvm-svn: 12848
-
Chris Lattner authored
If the source of the cast is a load, we can just use the source memory location, without having to create a temporary stack slot entry. Before we code generated this: double %int(int* %P) { %V = load int* %P %V2 = cast int %V to double ret double %V2 } into: int: sub %ESP, 4 mov %EAX, DWORD PTR [%ESP + 8] mov %EAX, DWORD PTR [%EAX] mov DWORD PTR [%ESP], %EAX fild DWORD PTR [%ESP] add %ESP, 4 ret Now we produce this: int: mov %EAX, DWORD PTR [%ESP + 4] fild DWORD PTR [%EAX] ret ... which is nicer. llvm-svn: 12846
-
Chris Lattner authored
test/Regression/CodeGen/X86/fp_load_fold.llx llvm-svn: 12844
-
- Apr 11, 2004
-
-
Chris Lattner authored
llvm-svn: 12842
-
Chris Lattner authored
for mul and div. Instead of generating this: test_divr: fld QWORD PTR [%ESP + 4] fld QWORD PTR [.CPItest_divr_0] fdivrp %ST(1) ret We now generate this: test_divr: fld QWORD PTR [%ESP + 4] fdivr QWORD PTR [.CPItest_divr_0] ret This code desperately needs refactoring, which will come in the next patch. llvm-svn: 12841
-
Chris Lattner authored
instructions use. This doesn't change any functionality except that long constant expressions of these operations will now magically start working. llvm-svn: 12840
-
Chris Lattner authored
fld QWORD PTR [%ESP + 4] fadd QWORD PTR [.CPItest_add_0] instead of: fld QWORD PTR [%ESP + 4] fld QWORD PTR [.CPItest_add_0] faddp %ST(1) I also intend to do this for mul & div, but it appears that I have to refactor a bit of code before I can do so. This is tested by: test/Regression/CodeGen/X86/fp_constant_op.llx llvm-svn: 12839
-
Chris Lattner authored
llvm-svn: 12838
-
Chris Lattner authored
llvm-svn: 12836
-
Chris Lattner authored
1. If an incoming argument is dead, don't load it from the stack 2. Do not code gen noop copies at all (ie, cast int -> uint), not even to a move. This should reduce register pressure for allocators that are unable to coallesce away these copies in some cases. llvm-svn: 12835
-
- Apr 10, 2004
-
-
Chris Lattner authored
llvm-svn: 12815
-
- Apr 09, 2004
-
-
John Criswell authored
is listed first and the address is listed second. llvm-svn: 12795
-
John Criswell authored
llvm-svn: 12787
-
John Criswell authored
InstSelectSimple.cpp: Change the checks for proper I/O port address size into an exit() instead of an assertion. Assertions aren't used in Release builds, and handling this error should be graceful (not that this counts as graceful, but it's more graceful). Modified the generation of the IN/OUT instructions to have 0 arguments. X86InstrInfo.td: Added the OpSize attribute to the 16 bit IN and OUT instructions. llvm-svn: 12786
-
- Apr 08, 2004
-
-
John Criswell authored
I/O port instructions on x86. The specific code sequence is tailored to the parameters and return value of the intrinsic call. Added the ability for implicit defintions to be printed in the Instruction Printer. Added the ability for RawFrm instruction to print implict uses and defintions with correct comma output. This required adjustment to some methods so that a leading comma would or would not be printed. llvm-svn: 12782
-
- Apr 06, 2004
-
-
Jakub Staszak authored
file based off InstSelectSimple.cpp, slowly being replaced by generated code from the really simple X86 instruction selector tablegen backend llvm-svn: 12715
-
Jakub Staszak authored
Tablgen files for really simple instruction selector llvm-svn: 12714
-
Chris Lattner authored
llvm-svn: 12711
-
Chris Lattner authored
llvm-svn: 12710
-
Chris Lattner authored
Enable folding of long seteq/setne comparisons into branches and select instructions Implement unfolded long relational comparisons against a constants a bit more efficiently Folding comparisons changes code that looks like this: mov %EAX, DWORD PTR [%ESP + 4] mov %EDX, DWORD PTR [%ESP + 8] mov %ECX, %EAX or %ECX, %EDX sete %CL test %CL, %CL je .LBB2 # PC rel: F into code that looks like this: mov %EAX, DWORD PTR [%ESP + 4] mov %EDX, DWORD PTR [%ESP + 8] mov %ECX, %EAX or %ECX, %EDX jne .LBB2 # PC rel: F This speeds up 186.crafty by 6% with llc-ls. llvm-svn: 12702
-
Chris Lattner authored
comparing a long against zero got us this: sub %ESP, 8 mov DWORD PTR [%ESP + 4], %ESI mov DWORD PTR [%ESP], %EDI mov %EAX, DWORD PTR [%ESP + 12] mov %EDX, DWORD PTR [%ESP + 16] mov %ECX, 0 mov %ESI, 0 mov %EDI, %EAX xor %EDI, %ECX mov %ECX, %EDX xor %ECX, %ESI or %EDI, %ECX sete %CL test %CL, %CL je .LBB2 # PC rel: F Now it gets us this: mov %EAX, DWORD PTR [%ESP + 4] mov %EDX, DWORD PTR [%ESP + 8] mov %ECX, %EAX or %ECX, %EDX sete %CL test %CL, %CL je .LBB2 # PC rel: F llvm-svn: 12696
-
Chris Lattner authored
example, multiplying X*(1 + (1LL << 32)) now produces: test: mov %ECX, DWORD PTR [%ESP + 4] mov %EDX, DWORD PTR [%ESP + 8] mov %EAX, %ECX add %EDX, %ECX ret [[[Note to Alkis: why isn't linear scan generating this code?? This might be a problem with your intervals being too conservative: test: mov %EAX, DWORD PTR [%ESP + 4] mov %EDX, DWORD PTR [%ESP + 8] add %EDX, %EAX ret end note]]] Whereas GCC produces this: T: sub %esp, 12 mov %edx, DWORD PTR [%esp+16] mov DWORD PTR [%esp+8], %edi mov %ecx, DWORD PTR [%esp+20] xor %edi, %edi mov DWORD PTR [%esp], %ebx mov %ebx, %edi mov %eax, %edx mov DWORD PTR [%esp+4], %esi add %ebx, %edx mov %edi, DWORD PTR [%esp+8] lea %edx, [%ecx+%ebx] mov %esi, DWORD PTR [%esp+4] mov %ebx, DWORD PTR [%esp] add %esp, 12 ret I'm not sure example what GCC is smoking here, but it looks like it has just confused itself with a bunch of stack slots or something. The intel compiler is better, but still not good: T: movl 4(%esp), %edx #2.11 movl 8(%esp), %eax #2.11 lea (%eax,%edx), %ecx #3.12 movl $1, %eax #3.12 mull %edx #3.12 addl %ecx, %edx #3.12 ret #3.12 llvm-svn: 12693
-
Chris Lattner authored
long %test(long %X) { %Y = mul long %X, 123 ret long %Y } we used to generate: test: sub %ESP, 12 mov DWORD PTR [%ESP + 8], %ESI mov DWORD PTR [%ESP + 4], %EDI mov DWORD PTR [%ESP], %EBX mov %ECX, DWORD PTR [%ESP + 16] mov %ESI, DWORD PTR [%ESP + 20] mov %EDI, 123 mov %EBX, 0 mov %EAX, %ECX mul %EDI imul %ESI, %EDI add %ESI, %EDX imul %ECX, %EBX add %ESI, %ECX mov %EDX, %ESI mov %EBX, DWORD PTR [%ESP] mov %EDI, DWORD PTR [%ESP + 4] mov %ESI, DWORD PTR [%ESP + 8] add %ESP, 12 ret Now we emit: test: mov %EAX, DWORD PTR [%ESP + 4] mov %ECX, DWORD PTR [%ESP + 8] mov %EDX, 123 mul %EDX imul %ECX, %ECX, 123 add %ECX, %EDX mov %EDX, %ECX ret Which, incidently, is substantially nicer than what GCC manages: T: sub %esp, 8 mov %eax, 123 mov DWORD PTR [%esp], %ebx mov %ebx, DWORD PTR [%esp+16] mov DWORD PTR [%esp+4], %esi mov %esi, DWORD PTR [%esp+12] imul %ecx, %ebx, 123 mov %ebx, DWORD PTR [%esp] mul %esi mov %esi, DWORD PTR [%esp+4] add %esp, 8 lea %edx, [%ecx+%edx] ret llvm-svn: 12692
-
Chris Lattner authored
On this testcase: long %test(long %X) { %Y = shr long %X, ubyte 32 ret long %Y } instead of: t: mov %EAX, DWORD PTR [%ESP + 4] mov %EAX, DWORD PTR [%ESP + 8] sar %EAX, 0 mov %EDX, 0 ret we now emit: test: mov %EAX, DWORD PTR [%ESP + 4] mov %EAX, DWORD PTR [%ESP + 8] mov %EDX, 0 ret llvm-svn: 12688
-
Chris Lattner authored
llvm-svn: 12687
-
Chris Lattner authored
For example, on this instruction: call void %test(long 1234) Instead of this: mov %EAX, 1234 mov %ECX, 0 mov DWORD PTR [%ESP], %EAX mov DWORD PTR [%ESP + 4], %ECX call test We now emit this: mov DWORD PTR [%ESP], 1234 mov DWORD PTR [%ESP + 4], 0 call test llvm-svn: 12686
-
Chris Lattner authored
of the words of the constant is zeros. For example: Y = and long X, 1234 now generates: Yl = and Xl, 1234 Yh = 0 instead of: Yl = and Xl, 1234 Yh = and Xh, 0 llvm-svn: 12685
-
Chris Lattner authored
llvm-svn: 12684
-
Chris Lattner authored
This allows us to handle code like 'add long %X, 123456789012' more efficiently. llvm-svn: 12683
-
Chris Lattner authored
llvm-svn: 12682
-
Chris Lattner authored
long %test(long %X) { %Y = sub long 0, %X ret long %Y } We used to generate: test: sub %ESP, 4 mov DWORD PTR [%ESP], %ESI mov %ECX, DWORD PTR [%ESP + 8] mov %ESI, DWORD PTR [%ESP + 12] mov %EAX, 0 mov %EDX, 0 sub %EAX, %ECX sbb %EDX, %ESI mov %ESI, DWORD PTR [%ESP] add %ESP, 4 ret Now we generate: test: mov %EAX, DWORD PTR [%ESP + 4] mov %EDX, DWORD PTR [%ESP + 8] neg %EAX adc %EDX, 0 neg %EDX ret llvm-svn: 12681
-
Chris Lattner authored
llvm-svn: 12680
-
Chris Lattner authored
* In promote32, if we can just promote a constant value, do so instead of promoting a constant dynamically. * In visitReturn inst, actually USE the promote32 argument that takes a Value* The end result of this is that we now generate this: test: mov %EAX, 0 ret instead of... test: mov %AX, 0 movzx %EAX, %AX ret for: ushort %test() { ret ushort 0 } llvm-svn: 12679
-
- Apr 05, 2004
-
-
Chris Lattner authored
types and can have arbitrary 32- and 64-bit integer types indexing into sequential types. llvm-svn: 12653
-
- Apr 02, 2004
-
-
Alkis Evlogimenos authored
llvm-svn: 12615
-
Alkis Evlogimenos authored
llvm-svn: 12611
-
Alkis Evlogimenos authored
llvm-svn: 12610
-
Alkis Evlogimenos authored
llvm-svn: 12607
-
- Apr 01, 2004
-
-
Chris Lattner authored
Implement a small optimization. In test/Regression/CodeGen/X86/select.ll, we now generate this for foldSel3: foldSel3: mov %AL, BYTE PTR [%ESP + 4] fld DWORD PTR [%ESP + 8] fld DWORD PTR [%ESP + 12] mov %EAX, DWORD PTR [%ESP + 16] mov %ECX, DWORD PTR [%ESP + 20] cmp %EAX, %ECX fxch %ST(1) fcmovae %ST(0), %ST(1) *** fstp %ST(1) ret Instead of: foldSel3: mov %AL, BYTE PTR [%ESP + 4] fld DWORD PTR [%ESP + 8] fld DWORD PTR [%ESP + 12] mov %EAX, DWORD PTR [%ESP + 16] mov %ECX, DWORD PTR [%ESP + 20] cmp %EAX, %ECX fxch %ST(1) fcmovae %ST(0), %ST(1) *** fxch %ST(1) *** fstp %ST(0) ret In practice, this only effects code size: performance should be basically unaffected. llvm-svn: 12588
-