[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 30 10:13:14 PDT 2024
================
@@ -449,6 +449,15 @@ Register SPIRVGlobalRegistry::getOrCreateCompositeOrNull(
return Res;
}
+Register SPIRVGlobalRegistry::getOrCreateConstScalarOrVector(
+ uint64_t Val, MachineInstr &I, SPIRVType *SpvType,
+ const SPIRVInstrInfo &TII, bool ZeroAsNull) {
+ if (SpvType->getOpcode() == SPIRV::OpTypeVector)
+ return getOrCreateConstVector(Val, I, SpvType, TII, ZeroAsNull);
+ else
+ return getOrCreateConstInt(Val, I, SpvType, TII, ZeroAsNull);
----------------
farzonl wrote:
Should we be checking `SpvType` if it is float or int like you did for vector before deciding to create a const int?
https://github.com/llvm/llvm-project/pull/111082
More information about the cfe-commits
mailing list