[PATCH] D27028: Add intrinsics for constrained floating point operations
Andy Kaylor via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 22 17:32:57 PST 2016
andrew.w.kaylor created this revision.
andrew.w.kaylor added reviewers: mehdi_amini, aemerson, DavidKreitzer, hfinkel.
andrew.w.kaylor added a subscriber: llvm-commits.
andrew.w.kaylor set the repository for this revision to rL LLVM.
This adds intrinsics that can be used to constrain optimizations that assume the default rounding mode and ignore FP exceptions.
I am starting with a simple lowering that translates the intrinsics directly to the corresponding target-independent FP operations when the selection DAG is built. I think this is necessary because the existing target-specific pattern matching for FP operations is fairly complex and I think attempting to duplicate all of that infrastructure is likely to result in errors and will certainly result in more work each time new wrinkles are introduced in the future.
I intend to model the implicit uses and defs of FP control and status registers in a future revision, which should be sufficient to prevent unwanted optimizations at the MachineInstr level. There is also a potential for incorrect code motion in during instruction selection. My tentative plan to handle that is to introduce pseudo-instruction nodes that wrap the inputs and outputs of the FP operations created based on the new intrinsics and effectively model the implicit FP control and status register behavior and use a chain. These nodes would then be eliminated during instruction selection.
I believe that this patch is sufficient as presented here and can be committed without any solution to the potential problems with code motion at the ISel and MachineInstr levels.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 40775 bytes
Desc: not available
More information about the llvm-commits