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

            Bug ID: 46115
           Summary: -instcombine with fast flag moves div outside of loop
                    into loop, dramatically regressing performance
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: elr...@gmail.com
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org

Godbolt:
https://godbolt.org/z/3vuZbN

The code divides one vector by a scalar.
The unoptimized IR has

inverse = fdiv 1, scalar

and then multiplies one vector by the inverse in the loop.

With -instcombine, the division is moved into the loop.
Seems like a failure of cost modeling not to realize that divisions are far
more expensive.

With vectors of length 128, this leads to about a 5.6-fold regression in
performance on my 10980xe.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to