[llvm-bugs] [Bug 28086] New: Early CSE and GVN miss an assume optimization when the value isn't used directly

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 10 16:46:19 PDT 2016


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

            Bug ID: 28086
           Summary: Early CSE and GVN miss an assume optimization when the
                    value isn't used directly
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: josh.klontz at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16515
  --> https://llvm.org/bugs/attachment.cgi?id=16515&action=edit
Minimum reproducing example

See https://groups.google.com/forum/#!topic/llvm-dev/90lQByG6teg for the
conversation.

Here's a minimum reproducing example:

define i32 @foo(i32*) {
entry:
  %1 = load i32, i32* %0
  %2 = icmp eq i32 %1, 3
  call void @llvm.assume(i1 %2)
  %3 = load i32, i32* %0
  ret i32 %3
}

Both -early-cse and -gvn independently simplify this IR to:

define i32 @foo(i32*) {
entry:
  %1 = load i32, i32* %0
  ret i32 %1
}

Instead of:

define i32 @foo(i32*) {
entry:
  ret i32 3
}

-- 
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/20160610/8faae709/attachment.html>


More information about the llvm-bugs mailing list