History log of /llvm-project/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp (Results 426 – 450 of 463)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# e2754dc8 14-Dec-2012 Michael Ilseman <milseman@apple.com>

Add back FoldOpIntoPhi optimizations with fix. Included test cases to help catch these errors and to test the presence of the optimization itself

llvm-svn: 170248


# a1bbeeca 13-Dec-2012 Eric Christopher <echristo@gmail.com>

Revert "Restore the PHI optimization I accidently removed" temporarily since
it seems to be breaking self-host for a few people and is PR14592.

This reverts commit r170024.

llvm-svn: 170106


# 3c814128 12-Dec-2012 Michael Ilseman <milseman@apple.com>

Restore the PHI optimization I accidently removed

llvm-svn: 170024


# 9fc0f258 12-Dec-2012 Michael Ilseman <milseman@apple.com>

Remove trailing whitespace

llvm-svn: 170022


# d5787be5 12-Dec-2012 Michael Ilseman <milseman@apple.com>

Remove redunant optimizations from InstCombine, instead call the appropriate functions from SimplifyInstruction

llvm-svn: 169941


Revision tags: llvmorg-3.2.0-rc3, llvmorg-3.2.0-rc2, llvmorg-3.2.0-rc1
# cdfe20b9 08-Oct-2012 Micah Villmow <villmow@gmail.com>

Move TargetData to DataLayout.

llvm-svn: 165402


# 91ce36c9 27-Sep-2012 Sylvestre Ledru <sylvestre@debian.org>

Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767

llvm-svn: 164768


# 721cffd5 27-Sep-2012 Sylvestre Ledru <sylvestre@debian.org>

Fix a typo 'iff' => 'if'

llvm-svn: 164767


# 319be53a 26-Jun-2012 Evan Cheng <evan.cheng@apple.com>

Remove a instcombine transform that (no longer?) makes sense:
// C - zext(bool) -> bool ? C - 1 : C
if (ZExtInst *ZI = dyn_cast<ZExtInst>(Op1))
if (ZI->getSrcTy()->isIntegerTy(1))

Remove a instcombine transform that (no longer?) makes sense:
// C - zext(bool) -> bool ? C - 1 : C
if (ZExtInst *ZI = dyn_cast<ZExtInst>(Op1))
if (ZI->getSrcTy()->isIntegerTy(1))
return SelectInst::Create(ZI->getOperand(0), SubOne(C), C);

This ends up forming sext i1 instructions that codegen to terrible code. e.g.
int blah(_Bool x, _Bool y) {
return (x - y) + 1;
}
=>
movzbl %dil, %eax
movzbl %sil, %ecx
shll $31, %ecx
sarl $31, %ecx
leal 1(%rax,%rcx), %eax
ret


Without the rule, llvm now generates:
movzbl %sil, %ecx
movzbl %dil, %eax
incl %eax
subl %ecx, %eax
ret

It also helps with ARM (and pretty much any target that doesn't have a sext i1 :-).

The transformation was done as part of Eli's r75531. He has given the ok to
remove it.

rdar://11748024

llvm-svn: 159230

show more ...


# 2710f1b0 08-Jun-2012 Nuno Lopes <nunoplopes@sapo.pt>

canonicalize:
-%a + 42
into
42 - %a

previously we were emitting:
-(%a + 42)

This fixes the infinite loop in PR12338. The generated code is still not perfect, though.
Will work on that next

llvm-sv

canonicalize:
-%a + 42
into
42 - %a

previously we were emitting:
-(%a + 42)

This fixes the infinite loop in PR12338. The generated code is still not perfect, though.
Will work on that next

llvm-svn: 158237

show more ...


# a2f6cecb 22-May-2012 Nuno Lopes <nunoplopes@sapo.pt>

add a new pass to instrument loads and stores for run-time bounds checking
move EmitGEPOffset from InstCombine to Transforms/Utils/Local.h

(a draft of this) patch reviewed by Andrew, thanks.

llvm-s

add a new pass to instrument loads and stores for run-time bounds checking
move EmitGEPOffset from InstCombine to Transforms/Utils/Local.h

(a draft of this) patch reviewed by Andrew, thanks.

llvm-svn: 157261

show more ...


Revision tags: llvmorg-3.1.0
# f5730303 10-May-2012 Nuno Lopes <nunoplopes@sapo.pt>

objectsize: add support for GEPs with non-constant indexes
add an additional parameter to InstCombiner::EmitGEPOffset() to force it to *not* emit operations with NUW flag

llvm-svn: 156585


Revision tags: llvmorg-3.1.0-rc3, llvmorg-3.1.0-rc2
# 7813dcee 26-Apr-2012 Chad Rosier <mcrosier@apple.com>

Add instcombine patterns for the following transformations:

(x & y) | (x ^ y) -> x | y
(x & y) + (x ^ y) -> x | y

Patch by Manman Ren.
rdar://10770603

llvm-svn: 155674


Revision tags: llvmorg-3.1.0-rc1
# ba0a6cab 04-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com>

Always compute all the bits in ComputeMaskedBits.
This allows us to keep passing reduced masks to SimplifyDemandedBits, but
know about all the bits if SimplifyDemandedBits fails. This allows instcomb

Always compute all the bits in ComputeMaskedBits.
This allows us to keep passing reduced masks to SimplifyDemandedBits, but
know about all the bits if SimplifyDemandedBits fails. This allows instcombine
to simplify cases like the one in the included testcase.

llvm-svn: 154011

show more ...


# 7746eb62 20-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com>

InstCombine: Make OptimizePointerDifference more aggressive.

- Ignore pointer casts.
- Also expand GEPs that aren't constantexprs when they have one use or only constant indices.

- We now compile "

InstCombine: Make OptimizePointerDifference more aggressive.

- Ignore pointer casts.
- Also expand GEPs that aren't constantexprs when they have one use or only constant indices.

- We now compile "&foo[i] - &foo[j]" into "i - j".

llvm-svn: 150961

show more ...


# b16bd77b 24-Dec-2011 Benjamin Kramer <benny.kra@googlemail.com>

InstCombine: Add a combine that turns (2^n)-1 ^ x back into (2^n)-1 - x iff x is smaller than 2^n and it fuses with a following add.

This was intended to undo the sub canonicalization in cases where

InstCombine: Add a combine that turns (2^n)-1 ^ x back into (2^n)-1 - x iff x is smaller than 2^n and it fuses with a following add.

This was intended to undo the sub canonicalization in cases where it's not profitable, but it also
finds some cases on it's own.

llvm-svn: 147256

show more ...


# 010337c8 24-Dec-2011 Benjamin Kramer <benny.kra@googlemail.com>

InstCombine: Canonicalize (2^n)-1 - x into (2^n)-1 ^ x iff x is known to be smaller than 2^n.

This has the obvious advantage of being commutable and is always a win on x86 because
const - x wastes a

InstCombine: Canonicalize (2^n)-1 - x into (2^n)-1 ^ x iff x is known to be smaller than 2^n.

This has the obvious advantage of being commutable and is always a win on x86 because
const - x wastes a register there. On less weird architectures this may lead to
a regression because other arithmetic doesn't fuse with it anymore. I'll address that
problem in a followup.

llvm-svn: 147254

show more ...


Revision tags: llvmorg-3.0.0, llvmorg-3.0.0-rc4, llvmorg-3.0.0-rc3, llvmorg-3.0.0-rc2, llvmorg-3.0.0-rc1
# 229907cd 18-Jul-2011 Chris Lattner <sabre@nondot.org>

land David Blaikie's patch to de-constify Type, with a few tweaks.

llvm-svn: 135375


Revision tags: llvmorg-2.9.0, llvmorg-2.9.0-rc3, llvmorg-2.9.0-rc2, llvmorg-2.9.0-rc1
# d406764d 17-Feb-2011 Chris Lattner <sabre@nondot.org>

add is always integer, thanks to Frits for noticing this.

llvm-svn: 125774


# 55920717 17-Feb-2011 Chris Lattner <sabre@nondot.org>

preserve NUW/NSW when transforming add x,x

llvm-svn: 125711


# d3c0e05f 11-Feb-2011 Chris Lattner <sabre@nondot.org>

When lowering an inbounds gep, the intermediate adds can have
unsigned overflow (e.g. due to a negative array index), but
the scales on array size multiplications are known to not
sign wrap.

llvm-sv

When lowering an inbounds gep, the intermediate adds can have
unsigned overflow (e.g. due to a negative array index), but
the scales on array size multiplications are known to not
sign wrap.

llvm-svn: 125409

show more ...


# d86ded17 10-Feb-2011 Chris Lattner <sabre@nondot.org>

implement the first part of PR8882: when lowering an inbounds
gep to explicit addressing, we know that none of the intermediate
computation overflows.

This could use review: it seems that the shifts

implement the first part of PR8882: when lowering an inbounds
gep to explicit addressing, we know that none of the intermediate
computation overflows.

This could use review: it seems that the shifts certainly wouldn't
overflow, but could the intermediate adds overflow if there is a
negative index?

Previously the testcase would instcombine to:

define i1 @test(i64 %i) {
%p1.idx.mask = and i64 %i, 4611686018427387903
%cmp = icmp eq i64 %p1.idx.mask, 1000
ret i1 %cmp
}

now we get:

define i1 @test(i64 %i) {
%cmp = icmp eq i64 %i, 1000
ret i1 %cmp
}

llvm-svn: 125271

show more ...


# 7d0e43ff 10-Feb-2011 Chris Lattner <sabre@nondot.org>

A bunch of cleanups and simplifications using the new PatternMatch predicates
and generally tidying things up. Only very trivial functionality changes
like now doing (-1 - A) -> (~A) for vectors too

A bunch of cleanups and simplifications using the new PatternMatch predicates
and generally tidying things up. Only very trivial functionality changes
like now doing (-1 - A) -> (~A) for vectors too.

InstCombineAddSub.cpp | 296 +++++++++++++++++++++-----------------------------
1 file changed, 126 insertions(+), 170 deletions(-)

llvm-svn: 125264

show more ...


# e20dd530 15-Jan-2011 Chris Lattner <sabre@nondot.org>

one more instcombine variant that is needed to work with future changes,
no functionality change currently.

llvm-svn: 123517


# fbb9ac3c 22-Dec-2010 Duncan Sands <baldrick@free.fr>

Add a generic expansion transform: A op (B op' C) -> (A op B) op' (A op C)
if both A op B and A op C simplify. This fires fairly often but doesn't
make that much difference. On gcc-as-one-file it r

Add a generic expansion transform: A op (B op' C) -> (A op B) op' (A op C)
if both A op B and A op C simplify. This fires fairly often but doesn't
make that much difference. On gcc-as-one-file it removes two "and"s and
turns one branch into a select.

llvm-svn: 122399

show more ...


1...<<111213141516171819