[PATCH] D59211: [LSR] Check for signed overflow in NarrowSearchSpaceByDetectingSupersets.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 11 12:21:33 PDT 2019


fhahn added a comment.

In D59211#1424945 <https://reviews.llvm.org/D59211#1424945>, @efriedma wrote:

> It looks like LSR doesn't deal with this sort of issue consistently... some places we try to overflow-check arithmetic on the offset, and others we use wrapping arithmetic.
>
> What should happen, really, is that each formula includes a bitwidth, and all arithmetic involving that formula use arithmetic that wraps at that bitwidth (like an APInt).  Otherwise it's not really clear what the computation actually means.


Right, that makes sense! I guess that would consistently address the signed overflows and potentially codegen errors by wrong wrapping/truncating. I'm happy to look into that. Unfortunately we are this UBSan failure internally, do you think it would be OK to get this in (either as is or with wrapping arithmetic) until the issue is addressed consistently?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59211/new/

https://reviews.llvm.org/D59211





More information about the llvm-commits mailing list