History log of /llvm-project/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp (Results 376 – 400 of 463)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-3.5.0-rc2
# a92687d6 31-Jul-2014 David Majnemer <david.majnemer@gmail.com>

InstCombine: Correctly propagate NSW/NUW for x-(-A) -> x+A

We can only propagate the nsw bits if both subtraction instructions are
marked with the appropriate bit.

N.B. We only propagate the nsw b

InstCombine: Correctly propagate NSW/NUW for x-(-A) -> x+A

We can only propagate the nsw bits if both subtraction instructions are
marked with the appropriate bit.

N.B. We only propagate the nsw bit in InstCombine because the nuw case
is already handled in InstSimplify.

This fixes PR20189.

llvm-svn: 214385

show more ...


Revision tags: llvmorg-3.5.0-rc1
# de409fd7 17-Jul-2014 Suyog Sarda <suyog.sarda@samsung.com>

Fix Typo (first commit to test commit access)

llvm-svn: 213228


# 6cbe670d 07-Jul-2014 Benjamin Kramer <benny.kra@googlemail.com>

Make helper functions static.

llvm-svn: 212460


# bdeef602 02-Jul-2014 David Majnemer <david.majnemer@gmail.com>

InstCombine: Don't turn -(x/INT_MIN) -> x/INT_MIN

It is not safe to negate the smallest signed integer, doing so yields
the same number back.

This fixes PR20186.

llvm-svn: 212164


# adc07739 27-Jun-2014 Dinesh Dwivedi <dinesh.d@samsung.com>

Added instruction combine to transform few more negative values addition to subtraction (Part 3)
This patch enables transforms for

(x + (~(y | c) + 1) --> x - (y | c) if c is odd

Differential Revis

Added instruction combine to transform few more negative values addition to subtraction (Part 3)
This patch enables transforms for

(x + (~(y | c) + 1) --> x - (y | c) if c is odd

Differential Revision: http://reviews.llvm.org/D4210

llvm-svn: 211881

show more ...


# 99281a06 26-Jun-2014 Dinesh Dwivedi <dinesh.d@samsung.com>

This patch removed duplicate code for matching patterns
which are now handled in SimplifyUsingDistributiveLaws()
(after r211261)

Differential Revision: http://reviews.llvm.org/D4253

llvm-svn: 211

This patch removed duplicate code for matching patterns
which are now handled in SimplifyUsingDistributiveLaws()
(after r211261)

Differential Revision: http://reviews.llvm.org/D4253

llvm-svn: 211768

show more ...


# a7161735 26-Jun-2014 Dinesh Dwivedi <dinesh.d@samsung.com>

Added instruction combine to transform few more negative values addition to subtraction (Part 2)
This patch enables transforms for

(x + (~(y | c) + 1) --> x - (y | c) if c is even

Differential

Added instruction combine to transform few more negative values addition to subtraction (Part 2)
This patch enables transforms for

(x + (~(y | c) + 1) --> x - (y | c) if c is even

Differential Revision: http://reviews.llvm.org/D4209

llvm-svn: 211765

show more ...


# 562fd753 19-Jun-2014 Dinesh Dwivedi <dinesh.d@samsung.com>

Added instruction combine to transform few more negative values addition to subtraction (Part 1)
This patch enables transforms for following patterns.
(x + (~(y & c) + 1) --> x - (y & c)
(x +

Added instruction combine to transform few more negative values addition to subtraction (Part 1)
This patch enables transforms for following patterns.
(x + (~(y & c) + 1) --> x - (y & c)
(x + (~((y >> z) & c) + 1) --> x - ((y>>z) & c)

Differential Revision: http://reviews.llvm.org/D3733

llvm-svn: 211266

show more ...


# b62e52e1 19-Jun-2014 Dinesh Dwivedi <dinesh.d@samsung.com>

Refactored and updated SimplifyUsingDistributiveLaws() to
* Find factorization opportunities using identity values.
* Find factorization opportunities by treating shl(X, C) as mul (X, shl(C))
* K

Refactored and updated SimplifyUsingDistributiveLaws() to
* Find factorization opportunities using identity values.
* Find factorization opportunities by treating shl(X, C) as mul (X, shl(C))
* Keep NSW flag while simplifying instruction using factorization.

This fixes PR19263.

Differential Revision: http://reviews.llvm.org/D3799

llvm-svn: 211261

show more ...


# 33bd53df 17-Jun-2014 Jingyue Wu <jingyue@google.com>

[InstCombine] mark ADD with nuw if no unsigned overflow

Summary:
As a starting step, we only use one simple heuristic: if the sign bits
of both a and b are zero, we can prove "add a, b" do not unsig

[InstCombine] mark ADD with nuw if no unsigned overflow

Summary:
As a starting step, we only use one simple heuristic: if the sign bits
of both a and b are zero, we can prove "add a, b" do not unsigned
overflow, and thus convert it to "add nuw a, b".

Updated all affected tests and added two new tests (@zero_sign_bit and
@zero_sign_bit2) in AddOverflow.ll

Test Plan: make check-all

Reviewers: eliben, rafael, meheff, chandlerc

Reviewed By: chandlerc

Subscribers: chandlerc, llvm-commits

Differential Revision: http://reviews.llvm.org/D4144

llvm-svn: 211084

show more ...


# 04c22586 04-Jun-2014 Rafael Espindola <rafael.espindola@gmail.com>

InstCombine: Improvement to check if signed addition overflows.

This patch implements two things:

1. If we know one number is positive and another is negative, we return true as
signed addition

InstCombine: Improvement to check if signed addition overflows.

This patch implements two things:

1. If we know one number is positive and another is negative, we return true as
signed addition of two opposite signed numbers will never overflow.

2. Implemented TODO : If one of the operands only has one non-zero bit, and if
the other operand has a known-zero bit in a more significant place than it
(not including the sign bit) the ripple may go up to and fill the zero, but
won't change the sign. e.x - (x & ~4) + 1

We make sure that we are ignoring 0 at MSB.

Patch by Suyog Sarda.

llvm-svn: 210186

show more ...


# d1a2c2d9 02-Jun-2014 Rafael Espindola <rafael.espindola@gmail.com>

Add back commit r210029.

The code was actually correct. Sorry for the confusion. I have expanded the
comment saying why the analysis is valid to avoid me misunderstaning it
again in the future.

llv

Add back commit r210029.

The code was actually correct. Sorry for the confusion. I have expanded the
comment saying why the analysis is valid to avoid me misunderstaning it
again in the future.

llvm-svn: 210052

show more ...


# 582c890f 02-Jun-2014 Rafael Espindola <rafael.espindola@gmail.com>

Revert "Add the nsw flag when we detect that an add will not signed overflow."

This reverts commit r210029.

It was not correctly handling cases where LHS and RHS had multiple but different
sign bit

Revert "Add the nsw flag when we detect that an add will not signed overflow."

This reverts commit r210029.

It was not correctly handling cases where LHS and RHS had multiple but different
sign bits.

llvm-svn: 210048

show more ...


# 82899feb 02-Jun-2014 Rafael Espindola <rafael.espindola@gmail.com>

Add the nsw flag when we detect that an add will not signed overflow.

We already had a function for checking this, we were just using it only in
specialized cases.

llvm-svn: 210029


# a248f536 29-May-2014 Rafael Espindola <rafael.espindola@gmail.com>

Revert "Revert "Revert "InstCombine: Improvement to check if signed addition overflows."""

This reverts commit r209776.

It was miscompiling llvm::SelectionDAGISel::MorphNode.

llvm-svn: 209817


# 6196b743 28-May-2014 Rafael Espindola <rafael.espindola@gmail.com>

Revert "Revert "InstCombine: Improvement to check if signed addition overflows.""

This reverts commit r209762, bringing back r209746. It was not responsible for the libc++ build failure

llvm-svn: 2

Revert "Revert "InstCombine: Improvement to check if signed addition overflows.""

This reverts commit r209762, bringing back r209746. It was not responsible for the libc++ build failure

llvm-svn: 209776

show more ...


# fb59b05c 28-May-2014 Rafael Espindola <rafael.espindola@gmail.com>

Revert "InstCombine: Improvement to check if signed addition overflows."

This reverts commit r209746.

It looks it is causing a crash while building libcxx. I am trying to get a
reduced testcase.

l

Revert "InstCombine: Improvement to check if signed addition overflows."

This reverts commit r209746.

It looks it is causing a crash while building libcxx. I am trying to get a
reduced testcase.

llvm-svn: 209762

show more ...


# 085b5794 28-May-2014 Rafael Espindola <rafael.espindola@gmail.com>

InstCombine: Improvement to check if signed addition overflows.

This patch implements two things:

1. If we know one number is positive and another is negative, we return true as
signed addition

InstCombine: Improvement to check if signed addition overflows.

This patch implements two things:

1. If we know one number is positive and another is negative, we return true as
signed addition of two opposite signed numbers will never overflow.

2. Implemented TODO : If one of the operands only has one non-zero bit, and if
the other operand has a known-zero bit in a more significant place than it
(not including the sign bit) the ripple may go up to and fill the zero, but
won't change the sign. e.x - (x & ~4) + 1

We make sure that we are ignoring 0 at MSB.

Patch by Suyog Sarda.

llvm-svn: 209746

show more ...


Revision tags: llvmorg-3.4.2, llvmorg-3.4.2-rc1
# a0653a3e 14-May-2014 Jay Foad <jay.foad@gmail.com>

Rename ComputeMaskedBits to computeKnownBits. "Masked" has been
inappropriate since it lost its Mask parameter in r154011.

llvm-svn: 208811


# 9ef66a82 11-May-2014 Serge Pavlov <sepavloff@gmail.com>

Reorder shuffle and binary operation.

This patch enables transformations:

BinOp(shuffle(v1), shuffle(v2)) -> shuffle(BinOp(v1, v2))
BinOp(shuffle(v1), const1) -> shuffle(BinOp, const2)

The

Reorder shuffle and binary operation.

This patch enables transformations:

BinOp(shuffle(v1), shuffle(v2)) -> shuffle(BinOp(v1, v2))
BinOp(shuffle(v1), const1) -> shuffle(BinOp, const2)

They allow to eliminate extra shuffles in some cases.

Differential Revision: http://reviews.llvm.org/D3525

llvm-svn: 208488

show more ...


Revision tags: llvmorg-3.4.1, llvmorg-3.4.1-rc2
# f40110f4 25-Apr-2014 Craig Topper <craig.topper@gmail.com>

[C++] Use 'nullptr'. Transforms edition.

llvm-svn: 207196


# 964daaaf 22-Apr-2014 Chandler Carruth <chandlerc@gmail.com>

[Modules] Fix potential ODR violations by sinking the DEBUG_TYPE
definition below all of the header #include lines, lib/Transforms/...
edition.

This one is tricky for two reasons. We again have a co

[Modules] Fix potential ODR violations by sinking the DEBUG_TYPE
definition below all of the header #include lines, lib/Transforms/...
edition.

This one is tricky for two reasons. We again have a couple of passes
that define something else before the includes as well. I've sunk their
name macros with the DEBUG_TYPE.

Also, InstCombine contains headers that need DEBUG_TYPE, so now those
headers #define and #undef DEBUG_TYPE around their code, leaving them
well formed modular headers. Fixing these headers was a large motivation
for all of these changes, as "leaky" macros of this form are hard on the
modules implementation.

llvm-svn: 206844

show more ...


# 5f1f26e8 21-Apr-2014 Chandler Carruth <chandlerc@gmail.com>

[Modules] Sink all the DEBUG_TYPE defines for InstCombine out of the
header files and into the cpp files.

These files will require more touches as the header files actually use
DEBUG(). Eventually,

[Modules] Sink all the DEBUG_TYPE defines for InstCombine out of the
header files and into the cpp files.

These files will require more touches as the header files actually use
DEBUG(). Eventually, I'll have to introduce a matched #define and #undef
of DEBUG_TYPE for the header files, but that comes as step N of many to
clean all of this up.

llvm-svn: 206777

show more ...


Revision tags: llvmorg-3.4.1-rc1
# 820a908d 04-Mar-2014 Chandler Carruth <chandlerc@gmail.com>

[Modules] Move the LLVM IR pattern match header into the IR library, it
obviously is coupled to the IR.

llvm-svn: 202818


# 03eb0de9 04-Mar-2014 Chandler Carruth <chandlerc@gmail.com>

[Modules] Move GetElementPtrTypeIterator into the IR library. As its
name might indicate, it is an iterator over the types in an instruction
in the IR.... You see where this is going.

Another step o

[Modules] Move GetElementPtrTypeIterator into the IR library. As its
name might indicate, it is an iterator over the types in an instruction
in the IR.... You see where this is going.

Another step of modularizing the support library.

llvm-svn: 202815

show more ...


1...<<111213141516171819