[clang] [llvm] Add WaveReadLaneFirst HLSL function (PR #220373)
Farzon Lotfi via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 22 09:48:46 PDT 2026
================
@@ -187,12 +187,12 @@ static SPIRVTypeInst deduceTypeFromUses(Register Reg, MachineFunction &MF,
ResType = deduceTypeFromPointerOperand(&Use, Reg, GR, MIB);
break;
case TargetOpcode::G_INTRINSIC_W_SIDE_EFFECTS:
+ case TargetOpcode::G_INTRINSIC_CONVERGENT:
case TargetOpcode::G_INTRINSIC: {
auto IntrinsicID = cast<GIntrinsic>(Use).getIntrinsicID();
- if (IntrinsicID == Intrinsic::spv_insertelt) {
- if (Reg == Use.getOperand(2).getReg())
- ResType = deduceTypeFromResultRegister(&Use, Reg, GR, MIB);
- } else if (IntrinsicID == Intrinsic::spv_extractelt) {
+ if (IntrinsicID == Intrinsic::spv_wave_readlane_first ||
+ IntrinsicID == Intrinsic::spv_insertelt ||
+ IntrinsicID == Intrinsic::spv_extractelt) {
----------------
farzonl wrote:
Hmm I dunno about how we are going about the intrinsic legalization but here and in legalizerInfo. I see there is kind of already at least one intrinsic there, but it feels like this is going to get unruly really quick because we have many intrinsics in spirv that will need to support matrix types.
These are the right files I just think we may need to come up with a more sustainable pattern. We have over 60 intrinsics we have added for HLSL in IntrinsicsSPIRV.td if each of those 60 need matrix support this if expression of ors is going to be crazy long and the expression will take a bit to compute.
https://github.com/llvm/llvm-project/pull/220373
More information about the llvm-commits
mailing list