Dan Gohman
6065ff317b
Delete now-unnecessary const_casts.
...
llvm-svn: 101637
2010-04-17 15:32:28 +00:00
Dan Gohman
a0f855157e
Use const qualifiers with TargetLowering. This eliminates several
...
const_casts, and it reinforces the design of the Target classes being
immutable.
SelectionDAGISel::IsLegalToFold is now a static member function, because
PIC16 uses it in an unconventional way. There is more room for API
cleanup here.
And PIC16's AsmPrinter no longer uses TargetLowering.
llvm-svn: 101635
2010-04-17 15:26:15 +00:00
Evan Cheng
6442d111dd
More work to allow dag combiner to promote 16-bit ops to 32-bit.
...
llvm-svn: 101621
2010-04-17 06:13:15 +00:00
Evan Cheng
aa2f3449c4
Another 80 col violation.
...
llvm-svn: 101620
2010-04-17 06:12:32 +00:00
Eric Christopher
e78496e5f1
Revert 101465, it broke internal OpenGL testing.
...
Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.
llvm-svn: 101579
2010-04-16 23:37:20 +00:00
Evan Cheng
b55929892f
(i32 sext_in_reg (i32 aext (i16 x)), i16) -> (i32 sext x). No known test case until -promote-16bit is enabled.
...
llvm-svn: 101551
2010-04-16 22:26:19 +00:00
Dan Gohman
b3afc2a215
Create a new TargetSelectionDAGInfo class. This will eventually acquire
...
SelectionDAG-specific parts of TargetLowering.
llvm-svn: 101537
2010-04-16 21:12:11 +00:00
Dan Gohman
2912cb780f
Commit this, which should have accompanied 101531.
...
llvm-svn: 101532
2010-04-16 20:22:43 +00:00
Evan Cheng
80afc6964c
80 col.
...
llvm-svn: 101501
2010-04-16 17:58:41 +00:00
Evan Cheng
e541446e11
80 col.
...
llvm-svn: 101500
2010-04-16 17:57:59 +00:00
Dan Gohman
e9683c52da
Avoid creating virtual registers for unused values.
...
llvm-svn: 101480
2010-04-16 17:15:02 +00:00
Dan Gohman
30de6c2b1c
Fix an assertion string.
...
llvm-svn: 101478
2010-04-16 16:55:18 +00:00
Dan Gohman
cb1d4ed9d0
Fix a comment.
...
llvm-svn: 101477
2010-04-16 16:52:37 +00:00
Gabor Greif
e7d6812008
reapply r101434
...
with a fix for self-hosting
rotate CallInst operands, i.e. move callee to the back
of the operand array
the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary
llvm-svn: 101465
2010-04-16 15:33:14 +00:00
Evan Cheng
d143bfe0a4
Adding support for dag combiner to promote operations for profit. This requires target specific queries. For example, x86 should promote i16 to i32 when it does not impact load folding.
...
x86 support is off by default. It can be enabled with -promote-16bit.
Work in progress.
llvm-svn: 101448
2010-04-16 06:14:10 +00:00
Dan Gohman
01d4af69bf
Refine further the scope where the global DebugLoc value is active.
...
llvm-svn: 101443
2010-04-16 05:06:56 +00:00
Gabor Greif
cd116e8c6a
back out r101423 and r101397, they break llvm-gcc self-host on darwin10
...
llvm-svn: 101434
2010-04-16 01:16:20 +00:00
Gabor Greif
2e18d34d80
reapply r101364, which has been backed out in r101368
...
with a fix
rotate CallInst operands, i.e. move callee to the back
of the operand array
the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary
llvm-svn: 101397
2010-04-15 20:51:13 +00:00
Dan Gohman
d48633d340
Fix a bunch of namespace polution.
...
llvm-svn: 101376
2010-04-15 17:08:50 +00:00
Gabor Greif
6022150477
back out r101364, as it trips the linux nightlybot on some clang C++ tests
...
llvm-svn: 101368
2010-04-15 12:46:56 +00:00
Gabor Greif
428ca23bbd
rotate CallInst operands, i.e. move callee to the back
...
of the operand array
the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary
llvm-svn: 101364
2010-04-15 10:49:53 +00:00
Chris Lattner
1b7ecfdf60
enhance the load/store narrowing optimization to handle a
...
tokenfactor in between the load/store. This allows us to
optimize test7 into:
_test7: ## @test7
## BB#0: ## %entry
movl (%rdx), %eax
## kill: SIL<def> ESI<kill>
movb %sil, 5(%rdi)
ret
instead of:
_test7: ## @test7
## BB#0: ## %entry
movl 4(%esp), %ecx
movl $-65281, %eax ## imm = 0xFFFFFFFFFFFF00FF
andl 4(%ecx), %eax
movzbl 8(%esp), %edx
shll $8, %edx
addl %eax, %edx
movl 12(%esp), %eax
movl (%eax), %eax
movl %edx, 4(%ecx)
ret
llvm-svn: 101355
2010-04-15 06:10:49 +00:00
Chris Lattner
8c5a5c9094
teach codegen to turn trunc(zextload) into load when possible.
...
This doesn't occur much at all, it only seems to formed in the case
when the trunc optimization kicks in due to phase ordering. In that
case it is saves a few bytes on x86-32.
llvm-svn: 101350
2010-04-15 05:40:59 +00:00
Chris Lattner
510d19e597
add a simple dag combine to replace trivial shl+lshr with
...
and. This happens with the store->load narrowing stuff.
llvm-svn: 101348
2010-04-15 05:28:43 +00:00
Chris Lattner
3282f3d34f
Implement rdar://7860110 (also in target/readme.txt) narrowing
...
a load/or/and/store sequence into a narrower store when it is
safe. Daniel tells me that clang will start producing this sort
of thing with bitfields, and this does trigger a few dozen times
on 176.gcc produced by llvm-gcc even now.
This compiles code like CodeGen/X86/2009-05-28-DAGCombineCrash.ll
into:
movl %eax, 36(%rdi)
instead of:
movl $4294967295, %eax ## imm = 0xFFFFFFFF
andq 32(%rdi), %rax
shlq $32, %rcx
addq %rax, %rcx
movq %rcx, 32(%rdi)
and each of the testcases into a single store. Each of them used
to compile into craziness like this:
_test4:
movl $65535, %eax ## imm = 0xFFFF
andl (%rdi), %eax
shll $16, %esi
addl %eax, %esi
movl %esi, (%rdi)
ret
llvm-svn: 101343
2010-04-15 04:48:01 +00:00
Dan Gohman
64a84ceb3f
Add more const qualifiers for LLVM IR pointers in CodeGen.
...
llvm-svn: 101342
2010-04-15 04:33:49 +00:00
Dan Gohman
0e0b8cf9fd
Add const qualifiers to CodeGen's use of LLVM IR constructs.
...
llvm-svn: 101334
2010-04-15 01:51:59 +00:00
Evan Cheng
8249affa3b
More 80 violations.
...
llvm-svn: 101330
2010-04-15 01:25:27 +00:00
Evan Cheng
263c547804
80 col violations.
...
llvm-svn: 101325
2010-04-15 01:01:55 +00:00
Dan Gohman
1b67547226
Delete unneeeded arguments.
...
llvm-svn: 101276
2010-04-14 20:17:22 +00:00
Dan Gohman
d5d199da5f
Delete unused arguments.
...
llvm-svn: 101275
2010-04-14 20:05:00 +00:00
Dan Gohman
c64d1d02a3
Factor out EH landing pad code into a separate function, and constify
...
a bunch of stuff to support it.
llvm-svn: 101273
2010-04-14 19:53:31 +00:00
Dan Gohman
c94abce286
Reset the debug location even if the instruction was a terminator.
...
llvm-svn: 101272
2010-04-14 19:30:02 +00:00
Dan Gohman
2d61a3f384
Refine #includes.
...
llvm-svn: 101269
2010-04-14 18:49:17 +00:00
Dan Gohman
b0b1974ddd
Pull utility routines with no SelectionDAG dependence out of
...
SelectionDAGBuilder. FunctionLoweringInfo isn't an ideal place for
them to live, but it's better than SelectionDAGBuilder for now.
llvm-svn: 101267
2010-04-14 18:31:02 +00:00
Dan Gohman
64582fc238
Fix typos in comments.
...
llvm-svn: 101266
2010-04-14 18:24:06 +00:00
Dan Gohman
60b5b8fa20
Delete an obsolete comment.
...
llvm-svn: 101264
2010-04-14 17:40:25 +00:00
Dan Gohman
4fd4153d52
Delete an unused function.
...
llvm-svn: 101263
2010-04-14 17:22:02 +00:00
Dan Gohman
45b0642839
Clear the FunctionLoweringInfo object before doing other things that
...
don't need it.
llvm-svn: 101262
2010-04-14 17:13:16 +00:00
Dan Gohman
3738dc7587
Move this assert out of SelectionDAGISel into FunctionLoweringInfo, and
...
drop the redundant #ifndef NDEBUG.
llvm-svn: 101261
2010-04-14 17:11:23 +00:00
Dan Gohman
4374fdf868
Add a comment.
...
llvm-svn: 101260
2010-04-14 17:09:37 +00:00
Dan Gohman
d0c66476e1
Move the code for initialing the entry block livein set out of
...
SelectionDAGISel.
llvm-svn: 101258
2010-04-14 17:05:00 +00:00
Dan Gohman
859cb3eea9
Reorgnaize this code to be more tidy and readable.
...
llvm-svn: 101256
2010-04-14 17:02:07 +00:00
Dan Gohman
a1656764cc
Trim #includes.
...
llvm-svn: 101255
2010-04-14 16:54:39 +00:00
Dan Gohman
2c09c272ff
Move the code for emitting livein copies out of SelectionDAGISel.
...
llvm-svn: 101254
2010-04-14 16:51:49 +00:00
Dan Gohman
6471bcb1fd
Sink landing-pad marking code out of
...
SelectionDAGISel::runOnMachineFunction into FunctionLowering.
llvm-svn: 101252
2010-04-14 16:32:56 +00:00
Dan Gohman
625913100a
It's not necessary to recompute EB here.
...
llvm-svn: 101251
2010-04-14 16:30:40 +00:00
Dan Gohman
1158c51fe0
Generalize this code to handle Instructions in addition to ConstantExprs.
...
llvm-svn: 101210
2010-04-14 02:33:23 +00:00
Dan Gohman
f3d8d6ef18
Reorder the methods of this class to be a little more organized.
...
llvm-svn: 101206
2010-04-14 02:09:45 +00:00
Dan Gohman
a400b6eca8
Add a few comments.
...
llvm-svn: 101148
2010-04-13 17:07:06 +00:00