[clang] [llvm] [HLSL] Implement the `fwidth` intrinsic for DXIL and SPIR-V target (PR #161378)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 16 09:33:41 PDT 2025
================
@@ -2615,6 +2618,15 @@ bool SPIRVInstructionSelector::selectDiscard(Register ResVReg,
.constrainAllUses(TII, TRI, RBI);
}
+bool SPIRVInstructionSelector::selectFwidth(Register ResVReg,
+ const SPIRVType *ResType,
+ MachineInstr &I) const {
+ return BuildMI(*I.getParent(), I, I.getDebugLoc(), TII.get(SPIRV::OpFwidth))
----------------
farzonl wrote:
the way this is implemented would imply that this should work with opencl? can you write an opencl spirv test to confirm.
https://github.com/llvm/llvm-project/pull/161378
More information about the cfe-commits
mailing list