@@ -151,11 +151,8 @@ std::string mapLLVMTypeToOCLType(const Type *Ty, bool Signed, Type *PET) {
151
151
// value of some SPIR-V instructions may be represented as pointer to a struct
152
152
// in LLVM IR) we can mangle the type.
153
153
BuiltinFuncMangleInfo MangleInfo;
154
- if (Ty->isPointerTy ()) {
155
- assert (cast<PointerType>(const_cast <Type *>(Ty))
156
- ->isOpaqueOrPointeeTypeMatches (PET));
154
+ if (Ty->isPointerTy ())
157
155
Ty = TypedPointerType::get (PET, Ty->getPointerAddressSpace ());
158
- }
159
156
std::string MangledName =
160
157
mangleBuiltin (" " , const_cast <Type *>(Ty), &MangleInfo);
161
158
// Remove "_Z0"(3 characters) from the front of the name
@@ -998,12 +995,9 @@ CallInst *addCallInstSPIRV(Module *M, StringRef FuncName, Type *RetTy,
998
995
Instruction *Pos, StringRef InstName) {
999
996
BuiltinFuncMangleInfo BtnInfo;
1000
997
for (unsigned I = 0 ; I < PointerElementTypes.size (); I++) {
1001
- if (Args[I]->getType ()->isPointerTy ()) {
1002
- assert (cast<PointerType>(Args[I]->getType ())
1003
- ->isOpaqueOrPointeeTypeMatches (PointerElementTypes[I]));
998
+ if (Args[I]->getType ()->isPointerTy ())
1004
999
BtnInfo.getTypeMangleInfo (I).PointerTy = TypedPointerType::get (
1005
1000
PointerElementTypes[I], Args[I]->getType ()->getPointerAddressSpace ());
1006
- }
1007
1001
}
1008
1002
return addCallInst (M, FuncName, RetTy, Args, Attrs, Pos, &BtnInfo, InstName);
1009
1003
}
@@ -1493,8 +1487,6 @@ Value *getScalarOrArrayConstantInt(Instruction *Pos, Type *T, unsigned Len,
1493
1487
unsigned PointerSize =
1494
1488
Pos->getModule ()->getDataLayout ().getPointerTypeSizeInBits (T);
1495
1489
auto *ET = Type::getIntNTy (T->getContext (), PointerSize);
1496
- assert (cast<PointerType>(T)->isOpaqueOrPointeeTypeMatches (ET) &&
1497
- " Pointer-to-non-size_t arguments are not valid for this call" );
1498
1490
auto AT = ArrayType::get (ET, Len);
1499
1491
std::vector<Constant *> EV (Len, ConstantInt::get (ET, V, IsSigned));
1500
1492
auto CA = ConstantArray::get (AT, EV);
0 commit comments