[llvm] [Spirv][HLSL] Add OpAll lowering and float vec support (PR #87952)
Nathan Gauër via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 8 11:18:08 PDT 2024
================
@@ -270,20 +357,70 @@ Register SPIRVGlobalRegistry::buildConstantFP(APFloat Val,
return Res;
}
+Register SPIRVGlobalRegistry::getOrCreateFloatCompositeOrNull(
+ Constant *Val, MachineInstr &I, SPIRVType *SpvType,
+ const SPIRVInstrInfo &TII, Constant *CA, unsigned BitWidth,
+ unsigned ElemCnt, bool ZeroAsNull) {
+ // Find a constant vector in DT or build a new one.
+ Register Res = DT.find(CA, CurMF);
+ bool IsNull = Val->isNullValue() && ZeroAsNull;
+ if (!Res.isValid()) {
+ // SpvScalConst should be created before SpvVecConst to avoid undefined ID
+ // error on validation.
+ // TODO: can moved below once sorting of types/consts/defs is implemented.
+ Register SpvScalConst;
----------------
Keenuts wrote:
Ok, was curious because moving it a bit down and running tests didn't seem to fail, so was wondering if you had a repro.
Since it's from an old code, it might actually be out of date.
https://github.com/llvm/llvm-project/pull/87952
More information about the llvm-commits
mailing list