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: unassignedb...@nondot.org
          Reporter: nikita....@gmail.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to