| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
llvm-svn: 131082
|
|
|
|
|
|
|
| |
Returning a new node makes the code try to replace the old node, which
in the included testcase is killed by CSE.
llvm-svn: 129650
|
|
|
|
|
|
| |
RHS of a shift.
llvm-svn: 129522
|
|
|
|
|
|
| |
with undef arguments.
llvm-svn: 129185
|
|
|
|
|
|
|
|
| |
transformations in target-specific DAG combines without causing DAGCombiner to
delete the same node twice. If you know of a better way to avoid this (see my
next patch for an example), please let me know.
llvm-svn: 128758
|
|
|
|
|
|
| |
the load is indexed. rdar://9117613.
llvm-svn: 127440
|
|
|
|
|
|
| |
Radar 9056407.
llvm-svn: 126864
|
|
|
|
| |
llvm-svn: 126565
|
|
|
|
|
|
|
|
|
|
|
| |
legalized code for large integer arithmetic.
1. Inform users of ADDEs with two 0 operands that it never sets carry
2. Fold other ADDs or ADDCs into the ADDE if possible
It would be neat if we could do the same thing for SETCC+ADD eventually, but we can't do that in target independent code.
llvm-svn: 126557
|
|
|
|
|
|
| |
the type of the LHS.
llvm-svn: 126518
|
|
|
|
|
|
|
|
|
|
| |
Limit the folding of any_ext and sext into the load operation to scalars.
Limit the active-bits trunc optimization to scalars.
Document vector trunc and vector sext in LangRef.
Similar to commit 126080 (for enabling zext).
llvm-svn: 126424
|
|
|
|
|
|
|
|
| |
The DAGCombiner folds the zext into complex load instructions. This patch
prevents this optimization on vectors since none of the supported targets
knows how to perform load+vector_zext in one instruction.
llvm-svn: 126080
|
|
|
|
|
|
| |
other getNode() methods. Radar 9002173.
llvm-svn: 125665
|
|
|
|
| |
llvm-svn: 125651
|
|
|
|
|
|
|
|
|
| |
transformation if we can't legally create a build vector of the correct
type. Check that we can make the transformation first, and add a TODO to
refactor this code with similar cases.
Fixes: PR9223 and rdar://9000350
llvm-svn: 125631
|
|
|
|
|
|
|
|
|
| |
generating i8 shift amounts for things like i1024 types. Add
an assert in getNode to prevent this from occuring in the future,
fix the buggy transformation, revert my previous patch, and
document this gotcha in ISDOpcodes.h
llvm-svn: 125465
|
|
|
|
|
|
|
|
| |
The DAGCombiner created illegal BUILD_VECTOR operations.
The patch added a check that either illegal operations are
allowed or that the created operation is legal.
llvm-svn: 125435
|
|
|
|
|
|
| |
that the condition is not a vector.
llvm-svn: 125398
|
|
|
|
|
|
|
|
|
|
|
| |
The bug happens when the DAGCombiner attempts to optimize one of the patterns
of the SUB opcode. It tries to create a zero of type v2i64. This type is legal
on 32bit machines, but the initializer of this vector (i64) is target dependent.
Currently, the initializer attempts to create an i64 zero constant, which fails.
Added a flag to tell the DAGCombiner to create a legal zero, if we require that
the pass would generate legal types.
llvm-svn: 125391
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the load, then it may be legal to transform the load and store to integer
load and store of the same width.
This is done if the target specified the transformation as profitable. e.g.
On arm, this can transform:
vldr.32 s0, []
vstr.32 s0, []
to
ldr r12, []
str r12, []
rdar://8944252
llvm-svn: 124708
|
|
|
|
| |
llvm-svn: 124587
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
c1+c2) when c1 equals the amount of bits that are truncated off.
This happens all the time when a smul is promoted to a larger type.
On x86-64 we now compile "int test(int x) { return x/10; }" into
movslq %edi, %rax
imulq $1717986919, %rax, %rax
movq %rax, %rcx
shrq $63, %rcx
sarq $34, %rax <- used to be "shrq $32, %rax; sarl $2, %eax"
addl %ecx, %eax
This fires 96 times in gcc.c on x86-64.
llvm-svn: 124559
|
|
|
|
|
|
|
|
| |
This happens e.g. for code like "X - X%10" where we lower the modulo operation
to a series of multiplies and shifts that are then subtracted from X, leading to
this missed optimization.
llvm-svn: 124532
|
|
|
|
|
|
| |
and fixes here and there.
llvm-svn: 123170
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
illegal. The latter usually compiles into smaller code.
example code:
unsigned foo(unsigned x, unsigned y) {
if (x != 0) y--;
return y;
}
before:
_foo: ## @foo
cmpl $1, 4(%esp) ## encoding: [0x83,0x7c,0x24,0x04,0x01]
sbbl %eax, %eax ## encoding: [0x19,0xc0]
notl %eax ## encoding: [0xf7,0xd0]
addl 8(%esp), %eax ## encoding: [0x03,0x44,0x24,0x08]
ret ## encoding: [0xc3]
after:
_foo: ## @foo
cmpl $1, 4(%esp) ## encoding: [0x83,0x7c,0x24,0x04,0x01]
movl 8(%esp), %eax ## encoding: [0x8b,0x44,0x24,0x08]
adcl $-1, %eax ## encoding: [0x83,0xd0,0xff]
ret ## encoding: [0xc3]
llvm-svn: 122455
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
loads properly. We miscompiled the testcase into:
_test: ## @test
movl $128, (%rdi)
movzbl 1(%rdi), %eax
ret
Now we get a proper:
_test: ## @test
movl $128, (%rdi)
movsbl (%rdi), %eax
movzbl %ah, %eax
ret
This fixes PR8757.
llvm-svn: 122392
|
|
|
|
|
|
| |
unhanded cases faster and simplify code.
llvm-svn: 122391
|
|
|
|
| |
llvm-svn: 122389
|
|
|
|
|
|
|
|
| |
the shift type was needed one place, the shift count
type another. The transform in 123555 had the same
problem.
llvm-svn: 122366
|
|
|
|
| |
llvm-svn: 122360
|
|
|
|
| |
llvm-svn: 122355
|
|
|
|
|
|
|
|
| |
count operand. These should be the same but apparently are
not always, and this is cleaner anyway. This improves the
code in an existing test.
llvm-svn: 122354
|
|
|
|
| |
llvm-svn: 122353
|
|
|
|
| |
llvm-svn: 122349
|
|
|
|
|
|
|
| |
something that just glues two nodes together, even if it is
sometimes used for flags.
llvm-svn: 122310
|
|
|
|
| |
llvm-svn: 122259
|
|
|
|
|
|
|
| |
BUILD_VECTOR operands where the element type is not legal. I had previously
changed this code to insert TRUNCATE operations, but that was just wrong.
llvm-svn: 122102
|
|
|
|
|
|
|
| |
code for the case where 32-bit divide by constant is
turned into 64-bit multiply by constant. 8771012.
llvm-svn: 122090
|
|
|
|
|
|
| |
a wider mul if the wider mul is legal.
llvm-svn: 121848
|
|
|
|
|
|
| |
result, the top bits are truncated off anyway, just use SRL.
llvm-svn: 121846
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when the wider type is legal. This allows us to compile:
define zeroext i16 @test1(i16 zeroext %x) nounwind {
entry:
%div = udiv i16 %x, 33
ret i16 %div
}
into:
test1: # @test1
movzwl 4(%esp), %eax
imull $63551, %eax, %eax # imm = 0xF83F
shrl $21, %eax
ret
instead of:
test1: # @test1
movw $-1985, %ax # imm = 0xFFFFFFFFFFFFF83F
mulw 4(%esp)
andl $65504, %edx # imm = 0xFFE0
movl %edx, %eax
shrl $5, %eax
ret
Implementing rdar://8760399 and example #4 from:
http://blog.regehr.org/archives/320
We should implement the same thing for [su]mul_hilo, but I don't
have immediate plans to do this.
llvm-svn: 121696
|
|
|
|
| |
llvm-svn: 121356
|
|
|
|
|
|
|
|
| |
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.
llvm-svn: 121120
|
|
|
|
| |
llvm-svn: 120235
|
|
|
|
| |
llvm-svn: 119990
|
|
|
|
|
|
| |
not anyext(select). Spotted by Frits van Bommel.
llvm-svn: 119739
|
|
|
|
|
|
|
|
|
|
| |
if the extension types were not the same. The result was that if you
fed a select with sext and zext loads, as in the testcase, then it
would get turned into a zext (or sext) of the select, which is wrong
in the cases when it should have been an sext (resp. zext). Reported
and diagnosed by Sebastien Deldon.
llvm-svn: 119728
|
|
|
|
|
|
| |
in order to fold it into a load.
llvm-svn: 118471
|
|
|
|
|
|
| |
just do it earlier too.
llvm-svn: 118195
|
|
|
|
|
|
|
|
| |
this by using an undef as a pointer.
Fixes rdar://8625016
llvm-svn: 118164
|