Skip to content
Commit cd4fbcd1 authored by David Majnemer's avatar David Majnemer
Browse files

InstSimplify: Simplify (X - (0 - Y)) if the second sub is NUW

If the NUW bit is set for 0 - Y, we know that all values for Y other
than 0 would produce a poison value.  This allows us to replace (0 - Y)
with 0 in the expression (X - (0 - Y)) which will ultimately leave us
with X.

This partially fixes PR20189.

llvm-svn: 214384
parent 32dbdf62
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment