[llvm] r303029 - [InstCombine] Merge duplicate functionality between InstCombine and ValueTracking

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Sun May 14 21:17:25 PDT 2017


On Sun, May 14, 2017 at 7:44 PM, Craig Topper via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: ctopper
> Date: Sun May 14 21:44:08 2017
> New Revision: 303029
>
> URL: http://llvm.org/viewvc/llvm-project?rev=303029&view=rev
> Log:
> [InstCombine] Merge duplicate functionality between InstCombine and ValueTracking
>
> Summary:
> Merge overflow computation for signed add,
> appearing both in InstCombine and ValueTracking.
>
> As part of the merge,
> cleanup the interface for overflow checks in InstCombine.
>
> Patch by Yoav Ben-Shalom.
>
> Reviewers: craig.topper, majnemer
>
> Reviewed By: craig.topper
>
> Subscribers: takuto.ikuta, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D32946
>
> Modified:
>     llvm/trunk/lib/Analysis/ValueTracking.cpp
>     llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp
>     llvm/trunk/lib/Transforms/InstCombine/InstCombineInternal.h
>     llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
>
> Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=303029&r1=303028&r2=303029&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)
> +++ llvm/trunk/lib/Analysis/ValueTracking.cpp Sun May 14 21:44:08 2017
> @@ -3495,6 +3495,51 @@ OverflowResult llvm::computeOverflowForU
>    return OverflowResult::MayOverflow;
>  }
>
> +/// \brief Return true if we can prove that adding the two values of the
> +/// knownbits will not overflow.
> +/// Otherwise return false.

Thanks for this nice refactoring.
I think you can just drop the last line of this comment, as it's redundant.

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare


More information about the llvm-commits mailing list