[llvm-bugs] [Bug 51419] New: [InstCombine] Infinite loop in InstCombine on smax+cmp+select sequence

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 9 12:37:13 PDT 2021


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

            Bug ID: 51419
           Summary: [InstCombine] Infinite loop in InstCombine on
                    smax+cmp+select sequence
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: cameron.mcinally at nyu.edu
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    spatel+llvm at rotateright.com

The following test case is tripping an infinite loop in InstCombine. I've been
unable to track down the root cause yet.

This issue was found in release/13.x, but Godbolt shows it failing in trunk as
well.

https://godbolt.org/z/xKasbGheK

; RUN: opt -O3 -instcombine -S < %s
define i64 @infloop(double %d, i64 %a) {
  %1 = fptosi double %d to i32
  %2 = call i32 @llvm.smax.i32(i32 %1, i32 0)
  %3 = icmp slt i32 %2, 2
  %4 = zext i1 %3 to i32
  %5 = select i1 %3, i32 %2, i32 1
  %6 = zext i32 %5 to i64
  %7 = mul i64 %6, 4
  %8 = add i64 %a, %7
  ret i64 %8
}

-- 
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/20210809/70edc805/attachment.html>


More information about the llvm-bugs mailing list