[llvm-bugs] [Bug 37605] New: Infinite loop in -instcombine, ping-pong between fadd/fsub

via llvm-bugs llvm-bugs at lists.llvm.org
Sun May 27 23:16:15 PDT 2018


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

            Bug ID: 37605
           Summary: Infinite loop in -instcombine, ping-pong between
                    fadd/fsub
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: mikael.holmen at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20344
  --> https://bugs.llvm.org/attachment.cgi?id=20344&action=edit
reproducer

Reproduce with
 opt -S -o - tr16071.ll -instcombine

With -debug we see

INSTCOMBINE ITERATION #1 on test
IC: DCE:   %1 = select i1 %tobool, i1 true, i1 undef
IC: ADDING: 5 instrs to worklist
IC: Visiting:   %0 = load i16, i16* @c, align 1
IC: Visiting:   %conv = sitofp i16 %0 to float
IC: Visiting:   %sub = fsub float %conv, bitcast (i32 ptrtoint (i16* @b to i32)
to float)
IC: Old =   %sub = fsub float %conv, bitcast (i32 ptrtoint (i16* @b to i32) to
float)
    New =   <badref> = fadd float %conv, fsub (float -0.000000e+00, float
bitcast (i32 ptrtoint (i16* @b to i32) to float))
IC: ADD:   %sub = fadd float %conv, fsub (float -0.000000e+00, float bitcast
(i32 ptrtoint (i16* @b to i32) to float))
IC: ERASE   %1 = fsub float %conv, bitcast (i32 ptrtoint (i16* @b to i32) to
float)
IC: ADD:   %conv = sitofp i16 %0 to float
IC: Visiting:   %conv = sitofp i16 %0 to float
IC: Visiting:   %sub = fadd float %conv, fsub (float -0.000000e+00, float
bitcast (i32 ptrtoint (i16* @b to i32) to float))
IC: Old =   %sub = fadd float %conv, fsub (float -0.000000e+00, float bitcast
(i32 ptrtoint (i16* @b to i32) to float))
    New =   <badref> = fsub float %conv, bitcast (i32 ptrtoint (i16* @b to i32)
to float)
IC: ADD:   %sub = fsub float %conv, bitcast (i32 ptrtoint (i16* @b to i32) to
float)
IC: ERASE   %1 = fadd float %conv, fsub (float -0.000000e+00, float bitcast
(i32 ptrtoint (i16* @b to i32) to float))
IC: ADD:   %conv = sitofp i16 %0 to float
IC: Visiting:   %conv = sitofp i16 %0 to float
IC: Visiting:   %sub = fsub float %conv, bitcast (i32 ptrtoint (i16* @b to i32)
to float)
IC: Old =   %sub = fsub float %conv, bitcast (i32 ptrtoint (i16* @b to i32) to
float)
    New =   <badref> = fadd float %conv, fsub (float -0.000000e+00, float
bitcast (i32 ptrtoint (i16* @b to i32) to float))
IC: ADD:   %sub = fadd float %conv, fsub (float -0.000000e+00, float bitcast
(i32 ptrtoint (i16* @b to i32) to float))
IC: ERASE   %1 = fsub float %conv, bitcast (i32 ptrtoint (i16* @b to i32) to
float)
IC: ADD:   %conv = sitofp i16 %0 to float
[...] 

this started happening after the commit:

 "r330126 - [InstCombine] simplify fneg+fadd folds; NFC"

-- 
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/20180528/ca83364d/attachment.html>


More information about the llvm-bugs mailing list