File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
llvm/tools/sycl-post-link Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,8 @@ bool CompileTimePropertiesPass::transformSYCLPropertiesAnnotation(
187
187
188
188
// Get the global variable with the annotation string.
189
189
const GlobalVariable *AnnotStrArgGV = nullptr ;
190
- if (auto *GEP = dyn_cast<GEPOperator>(IntrInst->getArgOperand (1 )))
190
+ const Value *IntrAnnotStringArg = IntrInst->getArgOperand (1 );
191
+ if (auto *GEP = dyn_cast<GEPOperator>(IntrAnnotStringArg))
191
192
if (auto *C = dyn_cast<Constant>(GEP->getOperand (0 )))
192
193
AnnotStrArgGV = dyn_cast<GlobalVariable>(C);
193
194
if (!AnnotStrArgGV)
@@ -266,13 +267,14 @@ bool CompileTimePropertiesPass::transformSYCLPropertiesAnnotation(
266
267
}
267
268
268
269
// Replace the annotation string with a bitcast of the new global variable.
269
- Type *Int8Ty = IntegerType::getInt8Ty (M.getContext ());
270
270
IntrInst->setArgOperand (
271
- 1 , ConstantExpr::getBitCast (NewAnnotStringGV, Int8Ty->getPointerTo (0 )));
271
+ 1 , ConstantExpr::getBitCast (NewAnnotStringGV,
272
+ IntrAnnotStringArg->getType ()));
272
273
273
274
// The values are not in the annotation string, so we can remove the original
274
275
// annotation value.
275
276
unsigned DefaultAS = M.getDataLayout ().getDefaultGlobalsAddressSpace ();
277
+ Type *Int8Ty = IntegerType::getInt8Ty (M.getContext ());
276
278
PointerType *Int8DefaultASPtrTy = Int8Ty->getPointerTo (DefaultAS);
277
279
IntrInst->setArgOperand (4 , ConstantPointerNull::get (Int8DefaultASPtrTy));
278
280
return true ;
You can’t perform that action at this time.
0 commit comments