Chris Lattner
c50e2bcdf7
implement branch inspection/modification methods.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30946 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-13 21:21:17 +00:00
Evan Cheng
8b2794aeff
Merge ISD::TRUNCSTORE to ISD::STORE. Switch to using StoreSDNode.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30945 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-13 21:14:26 +00:00
Chris Lattner
6a250ecc99
add note
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30937 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-13 20:20:58 +00:00
Chris Lattner
594f4c69e6
set isBarrier correctly
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30936 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-13 19:10:34 +00:00
Chris Lattner
eea52d3297
Correctly handle instruction separators.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30935 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-13 17:56:02 +00:00
Chris Lattner
1e5e97462b
mark adjcallstack up/down as clobbering and using the SP
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30908 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-12 17:56:34 +00:00
Evan Cheng
af9db75943
Add properties to ComplexPattern.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30891 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-11 21:03:53 +00:00
Evan Cheng
466685d41a
Reflects ISD::LOAD / ISD::LOADX / LoadSDNode changes.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30844 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-09 20:57:25 +00:00
Evan Cheng
786225adf0
Make use of getStore().
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30759 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 23:01:46 +00:00
Chris Lattner
a66ba5f70b
Don't bother setting JumpTableTextSection, it is about to disappear
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30745 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 03:13:59 +00:00
Chris Lattner
1da31ee472
Pass the MachineFunction into EmitJumpTableInfo.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30742 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 03:01:21 +00:00
Chris Lattner
9b7ce7da82
Move getSectionForFunction to AsmPrinter, change it to return a string.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30735 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 02:42:20 +00:00
Chris Lattner
b56dcc453e
implement DarwinTargetAsmInfo::getSectionForFunction, use it when outputting
...
function bodies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30733 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 00:35:50 +00:00
Chris Lattner
fea13d33e5
emit jump table before debug info
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30731 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 00:26:05 +00:00
Chris Lattner
37dfa02788
Always emit the jump table after the function so it's part of the same 'atom'
...
as the function body.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30730 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-05 00:24:46 +00:00
Evan Cheng
c548428c5d
Combine ISD::EXTLOAD, ISD::SEXTLOAD, ISD::ZEXTLOAD into ISD::LOADX. Add an
...
extra operand to LOADX to specify the exact value extension type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30714 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 00:56:09 +00:00
Chris Lattner
7be164c0ea
wrap long lines
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30662 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:32:43 +00:00
Chris Lattner
7c395ad06f
Shift amounts are always 32-bits, even in 64-bit mode. This fixes
...
CodeGen/PowerPC/2006-09-28-shift_64.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30652 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 20:48:45 +00:00
Chris Lattner
5468966614
Use abstract private/comment directives, to increase portability to ppc/linux
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30621 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-27 02:55:21 +00:00
Chris Lattner
a53115b4c2
Compile:
...
int x __attribute__((used));
to:
.data
.comm _x,4 ; 'x'
.no_dead_strip _x
on both x86 and ppc darwin targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30605 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-26 03:39:53 +00:00
Nate Begeman
f42f133938
Fold AND and ROTL more often
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30577 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-22 05:01:56 +00:00
Chris Lattner
4da1c82f72
The DarwinAsmPrinter need not check for isDarwin. createPPCAsmPrinterPass
...
should create the right asmprinter subclass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30542 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 17:12:19 +00:00
Chris Lattner
dadceedbdb
Wrap some darwin'isms with isDarwin checks.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30541 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 17:07:15 +00:00
Chris Lattner
f142713a30
item done
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30518 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 06:41:56 +00:00
Chris Lattner
ac924c8248
This is already done
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30512 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 04:59:33 +00:00
Chris Lattner
711762497c
Improve PPC64 equality comparisons like PPC32 comparisons.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30510 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 04:33:27 +00:00
Chris Lattner
3836dbd3bd
Two improvements:
...
1. Codegen this comparison:
if (X == 0x8000)
as:
cmplwi cr0, r3, 32768
bne cr0, LBB1_2 ;cond_next
instead of:
lis r2, 0
ori r2, r2, 32768
cmpw cr0, r3, r2
bne cr0, LBB1_2 ;cond_next
2. Codegen this comparison:
if (X == 0x12345678)
as:
xoris r2, r3, 4660
cmplwi cr0, r2, 22136
bne cr0, LBB1_2 ;cond_next
instead of:
lis r2, 4660
ori r2, r2, 22136
cmpw cr0, r3, r2
bne cr0, LBB1_2 ;cond_next
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30509 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 04:25:47 +00:00
Chris Lattner
cc96ac3a7d
Add a note that we should match rlwnm better
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30508 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 03:59:25 +00:00
Chris Lattner
3fe6c1d389
Legalize is no longer limited to cleverness with just constant shift amounts.
...
Allow it to be clever when possible and fall back to the gross code when needed.
This allows us to compile:
long long foo1(long long X, int C) {
return X << (C|32);
}
long long foo2(long long X, int C) {
return X << (C&~32);
}
to:
_foo1:
rlwinm r2, r5, 0, 27, 31
slw r3, r4, r2
li r4, 0
blr
.globl _foo2
.align 4
_foo2:
rlwinm r2, r5, 0, 27, 25
subfic r5, r2, 32
slw r3, r3, r2
srw r5, r4, r5
or r3, r3, r5
slw r4, r4, r2
blr
instead of:
_foo1:
ori r2, r5, 32
subfic r5, r2, 32
addi r6, r2, -32
srw r5, r4, r5
slw r3, r3, r2
slw r6, r4, r6
or r3, r3, r5
slw r4, r4, r2
or r3, r3, r6
blr
.globl _foo2
.align 4
_foo2:
rlwinm r2, r5, 0, 27, 25
subfic r5, r2, 32
addi r6, r2, -32
srw r5, r4, r5
slw r3, r3, r2
slw r6, r4, r6
or r3, r3, r5
slw r4, r4, r2
or r3, r3, r6
blr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30507 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-20 03:47:40 +00:00
Chris Lattner
cf9d0acfef
Fold the PPCISD shifts when presented with 0 inputs. This occurs for code
...
like:
long long test(long long X, int Y) {
return 1ULL << Y;
}
long long test2(long long X, int Y) {
return -1LL << Y;
}
which we used to compile to:
_test:
li r2, 1
subfic r3, r5, 32
li r4, 0
addi r6, r5, -32
srw r3, r2, r3
slw r4, r4, r5
slw r6, r2, r6
or r3, r4, r3
slw r4, r2, r5
or r3, r3, r6
blr
_test2:
li r2, -1
subfic r3, r5, 32
addi r6, r5, -32
srw r3, r2, r3
slw r4, r2, r5
slw r2, r2, r6
or r3, r4, r3
or r3, r3, r2
blr
Now we produce:
_test:
li r2, 1
addi r3, r5, -32
subfic r4, r5, 32
slw r3, r2, r3
srw r4, r2, r4
or r3, r4, r3
slw r4, r2, r5
blr
_test2:
li r2, -1
subfic r3, r5, 32
addi r6, r5, -32
srw r3, r2, r3
slw r4, r2, r5
slw r2, r2, r6
or r3, r4, r3
or r3, r3, r2
blr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30479 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-19 05:22:59 +00:00
Chris Lattner
f0613e1e7c
add a note
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30377 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 20:56:30 +00:00
Evan Cheng
c356a572e3
Reflects MachineConstantPoolEntry changes.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30279 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-12 21:04:05 +00:00
Nate Begeman
019f851ab2
Behold, more work on relocations. Things are looking pretty good now.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30240 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-10 23:03:44 +00:00
Nate Begeman
94be248dbb
First pass at supporting relocations. Relocations are written correctly to
...
the file now, however the relocated address is currently wrong. Fixing
that will require some deep pondering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30207 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 22:42:09 +00:00
Jim Laskey
f45c25f720
Missing tab
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30188 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 13:06:56 +00:00
Nate Begeman
6fe6084ebf
We actually do support object file writing, so don't return true (error)
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30173 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-08 03:42:15 +00:00
Jim Laskey
fde1b3bb2f
1. Remove condition on delete.
...
2. Protect and outline createTargetAsmInfo.
3. Misc. kruft.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30169 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-07 23:39:26 +00:00
Jim Laskey
a0f3d17daa
Make target asm info a property of the target machine.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30162 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-07 22:06:40 +00:00
Jim Laskey
8e8de8f776
Break out target asm info into separate files.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30161 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-07 22:05:02 +00:00
Jim Laskey
563321a258
Separate target specific asm properties from the asm printers.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30126 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-06 18:34:40 +00:00
Chris Lattner
09e460662a
Completely eliminate def&use operands. Now a register operand is EITHER a
...
def operand or a use operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30109 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-05 02:31:13 +00:00
Chris Lattner
1911fd4f85
Completely rearchitect the interface between targets and the pass manager.
...
This pass:
1. Splits TargetMachine into TargetMachine (generic targets, can be implemented
any way, like the CBE) and LLVMTargetMachine (subclass of TM that is used by
things using libcodegen and other support).
2. Instead of having each target fully populate the passmgr for file or JIT
output, move all this to common code, and give targets hooks they can
implement.
3. Commonalize the target population stuff between file emission and JIT
emission.
4. All (native code) codegen stuff now happens in a FunctionPassManager, which
paves the way for "fast -O0" stuff in the CFE later, and now LLC could
lazily stream .bc files from disk to use less memory.
5. There are now many fewer #includes and the targets don't depend on the
scalar xforms or libanalysis anymore (but codegen does).
6. Changing common code generator pass ordering stuff no longer requires
touching all targets.
7. The JIT now has the option of "-fast" codegen or normal optimized codegen,
which is now orthogonal to the fact that JIT'ing is being done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30081 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-04 04:14:57 +00:00
Chris Lattner
c4fa386471
Simplify target construction.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30070 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-03 18:44:02 +00:00
Jim Laskey
ce50a165c7
Handle callee saved registers in dwarf frame info (lead up to exception
...
handling.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29954 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-29 16:24:26 +00:00
Nate Begeman
06abd22b1a
Make ppc64 jit kinda work right. About 2/3 of Olden passes with this,
...
there are clearly some encoding bugs lurking in there somewhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29949 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-29 02:30:59 +00:00
Reid Spencer
3a9ec2463d
For PR387:
...
Close out this long standing bug by removing the remaining overloaded
virtual functions in LLVM. The -Woverloaded-virtual option is now turned on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29934 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-28 01:02:49 +00:00
Chris Lattner
a4f0b3a084
s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29911 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 12:54:02 +00:00
Evan Cheng
0b828e08f9
Do not use getTargetNode() and SelectNodeTo() which takes more than 3
...
SDOperand arguments. Use the variants which take an array and number instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29907 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 08:14:06 +00:00
Evan Cheng
95514bae73
SelectNodeTo now returns a SDNode*.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29901 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-26 08:00:10 +00:00
Evan Cheng
9ade218533
Select() no longer require Result operand by reference.
...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29898 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-26 05:34:46 +00:00