[llvm-bugs] [Bug 40194] New: BDCE clears poison flags too aggressively
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Jan 1 03:43:38 PST 2019
https://bugs.llvm.org/show_bug.cgi?id=40194
Bug ID: 40194
Summary: BDCE clears poison flags too aggressively
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedbugs at nondot.org
Reporter: nikita.ppv at gmail.com
CC: llvm-bugs at lists.llvm.org
BDCE currently clears poison generating flags on all instructions that might
have been affected by a dead use. However, we don't actually have to do this
for all instructions.
In particular shl, lshr and ashr already take their nuw/nsw/exact flags into
account when computing demanded bits. Only add, sub and mul compute demanded
bits without respecting nuw/nsw.
As such, it should be sufficient to clear poison flags on add, sub and mul
only. This also matches what SimplifyDemandedBits in InstCombine does.
--
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/20190101/e0b9123f/attachment-0001.html>
More information about the llvm-bugs
mailing list