diff --git a/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp b/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp --- a/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp +++ b/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp @@ -305,7 +305,7 @@ if (ReturnType->getOpcode() == SPIRV::OpTypeVector) { unsigned Bits = GR->getScalarOrVectorBitWidth(ReturnType); - uint64_t AllOnes = APInt::getAllOnesValue(Bits).getZExtValue(); + uint64_t AllOnes = APInt::getAllOnes(Bits).getZExtValue(); TrueConst = GR->getOrCreateConsIntVector(AllOnes, MIRBuilder, ReturnType); FalseConst = GR->getOrCreateConsIntVector(0, MIRBuilder, ReturnType); } else { diff --git a/llvm/lib/Target/SPIRV/SPIRVInstrInfo.td b/llvm/lib/Target/SPIRV/SPIRVInstrInfo.td --- a/llvm/lib/Target/SPIRV/SPIRVInstrInfo.td +++ b/llvm/lib/Target/SPIRV/SPIRVInstrInfo.td @@ -213,7 +213,7 @@ def PseudoConstF: FPImmLeaf; def ConstPseudoTrue: IntImmLeaf; def ConstPseudoFalse: IntImmLeaf; -def ConstPseudoNull: IntImmLeaf; +def ConstPseudoNull: IntImmLeaf; multiclass IntFPImm opCode, string name> { def I: OpgetOpcode() == SPIRV::OpTypeVector) return GR.getOrCreateConsIntVector(One.getZExtValue(), I, ResType, TII); return GR.getOrCreateConstInt(One.getZExtValue(), I, ResType, TII); @@ -1180,10 +1180,10 @@ const APInt &Imm, MachineInstr &I) const { unsigned TyOpcode = ResType->getOpcode(); - assert(TyOpcode != SPIRV::OpTypePointer || Imm.isNullValue()); + assert(TyOpcode != SPIRV::OpTypePointer || Imm.isZero()); MachineBasicBlock &BB = *I.getParent(); if ((TyOpcode == SPIRV::OpTypePointer || TyOpcode == SPIRV::OpTypeEvent) && - Imm.isNullValue()) + Imm.isZero()) return BuildMI(BB, I, I.getDebugLoc(), TII.get(SPIRV::OpConstantNull)) .addDef(ResVReg) .addUse(GR.getSPIRVTypeID(ResType))