Incorrect swap of fptrunc with fast-math instructions #48424
Labels
bugzilla
Issues migrated from bugzilla
floating-point
Floating-point math
llvm:instcombine
miscompilation
Extended Description
See the example below where fptrunc & fabs are swapped. The issue is that fabs has the nninf tag, which becomes poison because its input is inf.
Two solutions come to mind: drop nninf from fabs in the solution, or add fast-math flags to fptrunc.
File: llvm/test/Transforms/InstCombine/double-float-shrink-2.ll
A similar test also fails in Transforms/InstCombine/fpcast.ll (test4-fast)
The text was updated successfully, but these errors were encountered: