[DirectX backend] Add pass to lower llvm intrinsic into dxil op function.
authorXiang Li <python3kgae@outlook.com>
Mon, 2 May 2022 20:59:37 +0000 (13:59 -0700)
committerXiang Li <python3kgae@outlook.com>
Wed, 11 May 2022 07:03:05 +0000 (00:03 -0700)
commit85285be9c37ad0b6e3dabe82248d8917a6ebd5ec
tree59db55ffb28dd1394ad7ba1103ed10709f0b745f
parent4537aae0d57e17c217c192d8977012ba475b130c
[DirectX backend] Add pass to lower llvm intrinsic into dxil op function.

A new pass DXILOpLowering was added.
It will scan all llvm intrinsics, create dxil op function if it can map to dxil op function.
Then translate call instructions on the intrinsic into call on dxil op function.
dxil op function will add i32 argument to the begining of args for dxil opcode.
So cannot use setCalledFunction to update the call instruction on intrinsic.

This commit only support sin to start the work.

Reviewed By: kuhar, beanz

Differential Revision: https://reviews.llvm.org/D124805
llvm/lib/Target/DirectX/CMakeLists.txt
llvm/lib/Target/DirectX/DXILConstants.h [new file with mode: 0644]
llvm/lib/Target/DirectX/DXILOpLowering.cpp [new file with mode: 0644]
llvm/lib/Target/DirectX/DirectX.h
llvm/lib/Target/DirectX/DirectXTargetMachine.cpp
llvm/test/CodeGen/DirectX/sin.ll [new file with mode: 0644]
llvm/tools/opt/opt.cpp