[llvm-bugs] [Bug 43259] New: [InstCombine] Failure to simplify add-of-negative+underflow check+null check of non-null base pointer

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 9 11:15:59 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=43259

            Bug ID: 43259
           Summary: [InstCombine] Failure to simplify
                    add-of-negative+underflow check+null check of non-null
                    base pointer
           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

Again comes up in https://reviews.llvm.org/D67122
Much like what we have in #43251,
for 
#include <cassert>
char* test(char& base, signed long offset) {
  __builtin_assume(offset < 0);
  return &base + offset;
}

We produce 

https://godbolt.org/z/r40U47

and again those two icmp's can be merged:
https://rise4fun.com/Alive/8h2

-- 
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/20190909/f92f0249/attachment.html>


More information about the llvm-bugs mailing list