[llvm-bugs] [Bug 44427] New: [InstCombine] sub (and %x, -16), %x -> 0-(and %x, 15)
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Jan 1 13:33:19 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=44427
Bug ID: 44427
Summary: [InstCombine] sub (and %x, -16), %x -> 0-(and %x, 15)
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedbugs at nondot.org
Reporter: lebedev.ri at gmail.com
CC: llvm-bugs at lists.llvm.org
Looks like missed canonicalization to me. Not sure how much matters overall.
Name: sub (and %x, -16), %x -> 0-(and %x, 15)
Pre: isPowerOf2OrZero(-C1)
%o = and i64 %x, C1
%r = sub i64 %o, %x
=>
%n = and i64 %x, (-C1-1)
%r = sub i64 0, %n
https://rise4fun.com/Alive/t0hD
https://godbolt.org/z/R_RMfM
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200101/2068857a/attachment.html>
More information about the llvm-bugs
mailing list