@@ -755,8 +755,8 @@ SPIRVType *LLVMToSPIRVBase::transPointerType(SPIRVType *ET, unsigned AddrSpc) {
755755
756756  SPIRVType *TranslatedTy = nullptr ;
757757  if  (BM->isAllowedToUseExtension (ExtensionID::SPV_KHR_untyped_pointers) &&
758-       !(ET->isTypeArray () || ET->isTypeVector () || ET->isTypeStruct () ||
759-         ET->isTypeImage () || ET-> isTypeSampler () || ET->isTypePipe ())) {
758+       !(ET->isTypeArray () || ET->isTypeVector () || ET->isTypeImage () ||
759+         ET->isTypeSampler () || ET->isTypePipe ())) {
760760    TranslatedTy = BM->addUntypedPointerKHRType (
761761        SPIRSPIRVAddrSpaceMap::map (static_cast <SPIRAddressSpace>(AddrSpc)));
762762  } else  {
@@ -1329,8 +1329,7 @@ SPIRVValue *LLVMToSPIRVBase::transConstantUse(Constant *C,
13291329  if  (Trans->getType () == ExpectedType || Trans->getType ()->isTypePipeStorage ())
13301330    return  Trans;
13311331
1332-   assert ((C->getType ()->isPointerTy () ||
1333-           ExpectedType->isTypeUntypedPointerKHR ()) &&
1332+   assert (C->getType ()->isPointerTy () &&
13341333         " Only pointer type mismatches should be possible"  );
13351334  //  In the common case of strings ([N x i8] GVs), see if we can emit a GEP
13361335  //  instruction.
@@ -2068,12 +2067,8 @@ LLVMToSPIRVBase::transValueWithoutDecoration(Value *V, SPIRVBasicBlock *BB,
20682067          }
20692068        }
20702069      }
2071-       if  (BM->isAllowedToUseExtension (ExtensionID::SPV_KHR_untyped_pointers)) {
2072-         BVarInit = transConstantUse (Init, transType (Init->getType ()));
2073-       } else  {
2074-         SPIRVType *TransTy = transType (Ty);
2075-         BVarInit = transConstantUse (Init, TransTy->getPointerElementType ());
2076-       }
2070+       SPIRVType *TransTy = transType (Ty);
2071+       BVarInit = transConstantUse (Init, TransTy->getPointerElementType ());
20772072    }
20782073
20792074    SPIRVStorageClassKind StorageClass;
@@ -2106,12 +2101,9 @@ LLVMToSPIRVBase::transValueWithoutDecoration(Value *V, SPIRVBasicBlock *BB,
21062101    }
21072102
21082103    SPIRVType *TranslatedTy = transType (Ty);
2109-     auto  *BVar = static_cast <SPIRVVariableBase *>(BM->addVariable (
2110-         TranslatedTy,
2111-         TranslatedTy->isTypeUntypedPointerKHR () ? transType (GV->getValueType ())
2112-                                                 : nullptr ,
2113-         GV->isConstant (), transLinkageType (GV), BVarInit, GV->getName ().str (),
2114-         StorageClass, nullptr ));
2104+     auto  *BVar = static_cast <SPIRVVariable *>(
2105+         BM->addVariable (TranslatedTy, GV->isConstant (), transLinkageType (GV),
2106+                         BVarInit, GV->getName ().str (), StorageClass, nullptr ));
21152107
21162108    if  (IsVectorCompute) {
21172109      BVar->addDecorate (DecorationVectorComputeVariableINTEL);
@@ -2300,9 +2292,8 @@ LLVMToSPIRVBase::transValueWithoutDecoration(Value *V, SPIRVBasicBlock *BB,
23002292            StorageClassFunction,
23012293            BM->addArrayType (transType (Alc->getAllocatedType ()), Length));
23022294        SPIRVValue *Arr = BM->addVariable (
2303-             AllocationType, nullptr , false , spv::internal::LinkageTypeInternal,
2304-             nullptr , Alc->getName ().str () + " _alloca"  , StorageClassFunction,
2305-             BB);
2295+             AllocationType, false , spv::internal::LinkageTypeInternal, nullptr ,
2296+             Alc->getName ().str () + " _alloca"  , StorageClassFunction, BB);
23062297        //  Manually set alignment. OpBitcast created below will be decorated as
23072298        //  that's the SPIR-V value mapped to the original LLVM one.
23082299        transAlign (Alc, Arr);
@@ -2326,10 +2317,7 @@ LLVMToSPIRVBase::transValueWithoutDecoration(Value *V, SPIRVBasicBlock *BB,
23262317                                 TranslatedTy->getPointerElementType ())
23272318            : TranslatedTy;
23282319    SPIRVValue *Var = BM->addVariable (
2329-         VarTy,
2330-         VarTy->isTypeUntypedPointerKHR () ? transType (Alc->getAllocatedType ())
2331-                                          : nullptr ,
2332-         false , spv::internal::LinkageTypeInternal, nullptr ,
2320+         VarTy, false , spv::internal::LinkageTypeInternal, nullptr ,
23332321        Alc->getName ().str (), StorageClassFunction, BB);
23342322    if  (V->getType ()->getPointerAddressSpace () == SPIRAS_Generic) {
23352323      SPIRVValue *Cast =
@@ -2774,7 +2762,7 @@ void checkIsGlobalVar(SPIRVEntry *E, Decoration Dec) {
27742762  E->getErrorLog ().checkError (E->isVariable (), SPIRVEC_InvalidModule, ErrStr);
27752763
27762764  auto  AddrSpace = SPIRSPIRVAddrSpaceMap::rmap (
2777-       static_cast <SPIRVVariableBase  *>(E)->getStorageClass ());
2765+       static_cast <SPIRVVariable  *>(E)->getStorageClass ());
27782766  ErrStr += "  in a global (module) scope"  ;
27792767  E->getErrorLog ().checkError (AddrSpace == SPIRAS_Global, SPIRVEC_InvalidModule,
27802768                              ErrStr);
@@ -2922,11 +2910,10 @@ static void transMetadataDecorations(Metadata *MD, SPIRVValue *Target) {
29222910    case  spv::internal::DecorationInitModeINTEL:
29232911    case  DecorationInitModeINTEL: {
29242912      checkIsGlobalVar (Target, DecoKind);
2925-       ErrLog.checkError (
2926-           static_cast <SPIRVVariableBase *>(Target)->getInitializer (),
2927-           SPIRVEC_InvalidLlvmModule,
2928-           " InitModeINTEL only be applied to a global (module " 
2929-           " scope) variable which has an Initializer operand"  );
2913+       ErrLog.checkError (static_cast <SPIRVVariable *>(Target)->getInitializer (),
2914+                         SPIRVEC_InvalidLlvmModule,
2915+                         " InitModeINTEL only be applied to a global (module " 
2916+                         " scope) variable which has an Initializer operand"  );
29302917
29312918      ErrLog.checkError (NumOperands == 2 , SPIRVEC_InvalidLlvmModule,
29322919                        " InitModeINTEL requires exactly 1 extra operand"  );
@@ -4168,18 +4155,14 @@ SPIRVValue *LLVMToSPIRVBase::transIntrinsicInst(IntrinsicInst *II,
41684155    SPIRVType *FTy = transType (II->getType ()->getStructElementType (0 ));
41694156    SPIRVTypePointer *ITy = static_cast <SPIRVTypePointer *>(transPointerType (
41704157        II->getType ()->getStructElementType (1 ), SPIRAS_Private));
4171-      if  (!ITy-> isTypeUntypedPointerKHR ()) { 
4172-        unsigned  BitWidth = ITy->getElementType ()->getBitWidth ();
4173-        BM->getErrorLog ().checkError (BitWidth == 32 , SPIRVEC_InvalidBitWidth,
4174-                                     std::to_string (BitWidth));
4175-     } 
4158+ 
4159+     unsigned  BitWidth = ITy->getElementType ()->getBitWidth ();
4160+     BM->getErrorLog ().checkError (BitWidth == 32 , SPIRVEC_InvalidBitWidth,
4161+                                  std::to_string (BitWidth));
4162+ 
41764163    SPIRVValue *IntVal =
4177-         BM->addVariable (ITy,
4178-                         ITy->isTypeUntypedPointerKHR ()
4179-                             ? transType (II->getType ()->getStructElementType (1 ))
4180-                             : nullptr ,
4181-                         false , spv::internal::LinkageTypeInternal, nullptr , " "  ,
4182-                         ITy->getStorageClass (), BB);
4164+         BM->addVariable (ITy, false , spv::internal::LinkageTypeInternal, nullptr ,
4165+                         " "  , ITy->getStorageClass (), BB);
41834166
41844167    std::vector<SPIRVValue *> Ops{transValue (II->getArgOperand (0 ), BB), IntVal};
41854168
@@ -4601,7 +4584,7 @@ SPIRVValue *LLVMToSPIRVBase::transIntrinsicInst(IntrinsicInst *II,
46014584      Init = BM->addCompositeConstant (CompositeTy, Elts);
46024585    }
46034586    SPIRVType *VarTy = transPointerType (AT, SPIRV::SPIRAS_Constant);
4604-     SPIRVValue *Var = BM->addVariable (VarTy, nullptr ,  /* isConstant*/   true ,
4587+     SPIRVValue *Var = BM->addVariable (VarTy, /* isConstant*/   true ,
46054588                                      spv::internal::LinkageTypeInternal, Init,
46064589                                      " "  , StorageClassUniformConstant, nullptr );
46074590    SPIRVType *SourceTy =
0 commit comments