Skip to content

Commit

Permalink
Merge from 'master' to 'xmain-web' (KhronosGroup#29)
Browse files Browse the repository at this point in the history
  CONFLICT (add/add): Merge conflict in test/transcoding/SPV_INTEL_variable_length_array/basic.ll
  CONFLICT (content): Merge conflict in lib/SPIRV/libSPIRV/spirv.hpp
  CONFLICT (content): Merge conflict in lib/SPIRV/libSPIRV/SPIRVOpCodeEnum.h
  CONFLICT (content): Merge conflict in lib/SPIRV/libSPIRV/SPIRVInstruction.h
  CONFLICT (content): Merge conflict in lib/SPIRV/SPIRVWriter.cpp
  CONFLICT (content): Merge conflict in lib/SPIRV/SPIRVReader.cpp
  CONFLICT (content): Merge conflict in include/LLVMSPIRVExtensions.inc
  • Loading branch information
iclsrc committed Sep 1, 2020
2 parents 1de9739 + 7cd1a3b commit 8fd16b2
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/LLVMSPIRVExtensions.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,9 @@ EXT(SPV_INTEL_variable_length_array)
#endif // INTEL_COLLAB
EXT(SPV_INTEL_arbitrary_precision_fixed_point)
EXT(SPV_INTEL_arbitrary_precision_floating_point)
<<<<<<< HEAD
EXT(SPV_INTEL_usm_storage_classes)
EXT(SPV_INTEL_fpga_buffer_location)
=======
EXT(SPV_INTEL_variable_length_array)
>>>>>>> 7cd1a3bb95646d0c7b9375ca3bd1277657d61b60
6 changes: 6 additions & 0 deletions lib/SPIRV/SPIRVReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1792,7 +1792,10 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
return mapValue(BV, LVar);
}

<<<<<<< HEAD
#if INTEL_COLLAB
=======
>>>>>>> 7cd1a3bb95646d0c7b9375ca3bd1277657d61b60
case OpVariableLengthArrayINTEL: {
auto *VLA = static_cast<SPIRVVariableLengthArrayINTEL *>(BV);
llvm::Type *Ty = transType(BV->getType()->getPointerElementType());
Expand All @@ -1811,7 +1814,10 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
Intrinsic::getDeclaration(M, Intrinsic::stackrestore);
return mapValue(BV, CallInst::Create(StackRestore, {Ptr}, "", BB));
}
<<<<<<< HEAD
#endif // INTEL_COLLAB
=======
>>>>>>> 7cd1a3bb95646d0c7b9375ca3bd1277657d61b60

case OpFunctionParameter: {
auto BA = static_cast<SPIRVFunctionParameter *>(BV);
Expand Down
12 changes: 12 additions & 0 deletions lib/SPIRV/SPIRVWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,10 @@ SPIRVValue *LLVMToSPIRV::transValueWithoutDecoration(Value *V,
BB));

if (AllocaInst *Alc = dyn_cast<AllocaInst>(V)) {
<<<<<<< HEAD
#if INTEL_COLLAB
=======
>>>>>>> 7cd1a3bb95646d0c7b9375ca3bd1277657d61b60
if (Alc->isArrayAllocation()) {
if (!BM->checkExtension(ExtensionID::SPV_INTEL_variable_length_array,
SPIRVEC_InvalidInstruction,
Expand All @@ -1392,7 +1395,10 @@ SPIRVValue *LLVMToSPIRV::transValueWithoutDecoration(Value *V,
{Length->getId()}, BB,
transType(Alc->getType())));
}
<<<<<<< HEAD
#endif // INTEL_COLLAB
=======
>>>>>>> 7cd1a3bb95646d0c7b9375ca3bd1277657d61b60
return mapValue(
V, BM->addVariable(transType(Alc->getType()), false,
SPIRVLinkageTypeKind::LinkageTypeInternal, nullptr,
Expand Down Expand Up @@ -2362,7 +2368,10 @@ SPIRVValue *LLVMToSPIRV::transIntrinsicInst(IntrinsicInst *II,
}
return nullptr;
}
<<<<<<< HEAD
#if INTEL_COLLAB
=======
>>>>>>> 7cd1a3bb95646d0c7b9375ca3bd1277657d61b60
case Intrinsic::stacksave: {
if (BM->isAllowedToUseExtension(
ExtensionID::SPV_INTEL_variable_length_array)) {
Expand Down Expand Up @@ -2390,7 +2399,10 @@ SPIRVValue *LLVMToSPIRV::transIntrinsicInst(IntrinsicInst *II,
"-spirv-allow-unknown-intrinsics option.");
break;
}
<<<<<<< HEAD
#endif // INTEL_COLLAB
=======
>>>>>>> 7cd1a3bb95646d0c7b9375ca3bd1277657d61b60
// We can just ignore/drop some intrinsics, like optimizations hint.
case Intrinsic::invariant_start:
case Intrinsic::invariant_end:
Expand Down
6 changes: 6 additions & 0 deletions lib/SPIRV/libSPIRV/SPIRVInstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -3143,7 +3143,10 @@ _SPIRV_OP(SicGetIpeChromaMode, true, 4)
SPIRVSpecConstantOp *createSpecConstantOpInst(SPIRVInstruction *Inst);
SPIRVInstruction *createInstFromSpecConstantOp(SPIRVSpecConstantOp *C);

<<<<<<< HEAD
#if INTEL_COLLAB
=======
>>>>>>> 7cd1a3bb95646d0c7b9375ca3bd1277657d61b60
class SPIRVVariableLengthArrayINTELInstBase : public SPIRVInstTemplateBase {
protected:
SPIRVCapVec getRequiredCapability() const override {
Expand All @@ -3161,7 +3164,10 @@ _SPIRV_OP(VariableLengthArray, true, 4)
_SPIRV_OP(SaveMemory, true, 3)
_SPIRV_OP(RestoreMemory, false, 2)
#undef _SPIRV_OP
<<<<<<< HEAD
#endif // INTEL_COLLAB
=======
>>>>>>> 7cd1a3bb95646d0c7b9375ca3bd1277657d61b60
} // namespace SPIRV

#endif // SPIRV_LIBSPIRV_SPIRVINSTRUCTION_H
1 change: 1 addition & 0 deletions lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ template <> inline void SPIRVMap<Capability, std::string>::init() {
"SubgroupAvcMotionEstimationIntraINTEL");
add(CapabilitySubgroupAvcMotionEstimationChromaINTEL,
"SubgroupAvcMotionEstimationChromaINTEL");
add(CapabilityVariableLengthArrayINTEL, "VariableLengthArrayINTEL");
add(CapabilityRoundToInfinityINTEL, "RoundToInfinityINTEL");
add(CapabilityFloatingPointModeINTEL, "FloatingPointModeINTEL");
add(CapabilityFPGAMemoryAttributesINTEL, "FPGAMemoryAttributesINTEL");
Expand Down
6 changes: 6 additions & 0 deletions lib/SPIRV/libSPIRV/SPIRVOpCodeEnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,17 @@ _SPIRV_OP(SubgroupAvcSicGetIpeChromaModeINTEL, 5813)
_SPIRV_OP(SubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL, 5814)
_SPIRV_OP(SubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL, 5815)
_SPIRV_OP(SubgroupAvcSicGetInterRawSadsINTEL, 5816)
<<<<<<< HEAD
#if INTEL_COLLAB
_SPIRV_OP(VariableLengthArrayINTEL, 5818)
_SPIRV_OP(SaveMemoryINTEL, 5819)
_SPIRV_OP(RestoreMemoryINTEL, 5820)
#endif // INTEL_COLLAB
=======
_SPIRV_OP(VariableLengthArrayINTEL, 5818)
_SPIRV_OP(SaveMemoryINTEL, 5819)
_SPIRV_OP(RestoreMemoryINTEL, 5820)
>>>>>>> 7cd1a3bb95646d0c7b9375ca3bd1277657d61b60
_SPIRV_OP(ArbitraryFloatSinCosPiINTEL, 5840)
_SPIRV_OP(ArbitraryFloatCastINTEL, 5841)
_SPIRV_OP(ArbitraryFloatCastFromIntINTEL, 5842)
Expand Down
12 changes: 12 additions & 0 deletions lib/SPIRV/libSPIRV/spirv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,8 @@ enum Capability {
CapabilitySubgroupBufferBlockIOINTEL = 5569,
CapabilitySubgroupImageBlockIOINTEL = 5570,
CapabilitySubgroupImageMediaBlockIOINTEL = 5579,
CapabilityRoundToInfinityINTEL = 5582,
CapabilityFloatingPointModeINTEL = 5583,
CapabilityIntegerFunctions2INTEL = 5584,
CapabilityFunctionPointersINTEL = 5603,
CapabilityIndirectReferencesINTEL = 5604,
Expand All @@ -986,11 +988,15 @@ enum Capability {
CapabilitySubgroupAvcMotionEstimationINTEL = 5696,
CapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697,
CapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698,
<<<<<<< HEAD
CapabilityRoundToInfinityINTEL = 5582,
CapabilityFloatingPointModeINTEL = 5583,
#if INTEL_COLLAB
CapabilityVariableLengthArrayINTEL = 5817,
#endif // INTEL_COLLAB
=======
CapabilityVariableLengthArrayINTEL = 5817,
>>>>>>> 7cd1a3bb95646d0c7b9375ca3bd1277657d61b60
CapabilityFunctionFloatControlINTEL = 5821,
CapabilityFPGAMemoryAttributesINTEL = 5824,
CapabilityArbitraryPrecisionIntegersINTEL = 5844,
Expand Down Expand Up @@ -1547,11 +1553,17 @@ enum Op {
OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814,
OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815,
OpSubgroupAvcSicGetInterRawSadsINTEL = 5816,
<<<<<<< HEAD
#if INTEL_COLLAB
OpVariableLengthArrayINTEL = 5818,
OpSaveMemoryINTEL = 5819,
OpRestoreMemoryINTEL = 5820,
#endif // INTEL_COLLAB
=======
OpVariableLengthArrayINTEL = 5818,
OpSaveMemoryINTEL = 5819,
OpRestoreMemoryINTEL = 5820,
>>>>>>> 7cd1a3bb95646d0c7b9375ca3bd1277657d61b60
OpArbitraryFloatSinCosPiINTEL = 5840,
OpArbitraryFloatCastINTEL = 5841,
OpArbitraryFloatCastFromIntINTEL = 5842,
Expand Down
3 changes: 3 additions & 0 deletions test/transcoding/SPV_INTEL_variable_length_array/basic.ll
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@
; CHECK-SPIRV: VariableLengthArrayINTEL [[#IntPtr]] [[#]] [[#A]]
; CHECK-SPIRV: RestoreMemoryINTEL [[#SavedMem]]

<<<<<<< HEAD
; CHECK-ERROR: InvalidWordCount: Can't encode instruction with word count greater than 65535:

source_filename = "./example.c"
=======
>>>>>>> 7cd1a3bb95646d0c7b9375ca3bd1277657d61b60
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
target triple = "spir"

Expand Down

0 comments on commit 8fd16b2

Please sign in to comment.