llvm-project
07071121 - Class for checking floating-point properties

Commit
125 days ago
Class for checking floating-point properties Applicability of a particular transformation to floating-point expressions may depend on many parameters. Previously these parameters were mainly represented by fast-math flags, and in some cases they were supplemented by rounding mode and exception behavior, and all were passed as separate arguments to the relevant functions. Implementing more elaborated support of floating-point requires access to other properties, including function attributes (such as denormal mode or sNaN support). Passing these parameters as separate arguments is inconvenient. To address this problem a special class that collects all the necessary information is introduced in this commit. The class is a wrapper over an integer value, where various bit fields represent properties, that transformations may depend on. This allows instances of the class to be passed by value. It incorporates fast-math flags and borrows part of the FastMathFlags interface. This change was intended to be NFC, but in some cases, the behavior differs, because the floating-point operation information could previously be lost when traveling throughout function call stack.
Author
Committer
Parents
Loading