[llvm] [DirectX] Add support to lower LLVM intrinsics ceil, cos, fabs, floor and smax to DXIL Ops. (PR #78767)
S. Bharadwaj Yadavalli via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 19 11:58:50 PST 2024
================
@@ -28,6 +28,12 @@ void initializeDXILPrepareModulePass(PassRegistry &);
/// Pass to convert modules into DXIL-compatable modules
ModulePass *createDXILPrepareModulePass();
+/// Initializer for DXIL strength reduce
+void initializeDXILStrengthReducePass(PassRegistry &);
+
+/// Pass to reduce strength during lowering into DXIL-compatable modules
+ModulePass *createDXILStrengthReducePass();
----------------
bharadwajy wrote:
This pass is introduced to rewrite intrinsics such as `llvm.abs.*` (integer abs) with no corresponding DXIL intrinsic (AFAIK). For example, `llvm.abs` is rewritten in this pass as a combination of `sub` (LLVM instruction) and `smax` (LLVM intrinsic) - as done in DXC.
https://github.com/llvm/llvm-project/pull/78767
More information about the llvm-commits
mailing list