Skip to content
Snippets Groups Projects
Commit d2b212ef authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Completed the fix in 32b6188a

parent 32b6188a
No related branches found
No related tags found
No related merge requests found
......@@ -1400,9 +1400,10 @@ void CGT_NVPTX::codeGen(DFLeafNode* N) {
assert(Ptr->getType()->isPointerTy()
&& "First argument of supported atomics is expected to be a pointer");
PointerType* PtrTy = cast<PointerType>(Ptr->getType());
if(PtrTy != Type::getInt32PtrTy(II->getContext(), PtrTy->getAddressSpace())) {
Ptr = CastInst::CreatePointerCast(Ptr, Type::getInt32PtrTy(II->getContext(), PtrTy->getAddressSpace()), "", II);
PointerType* TargetTy = Type::getInt32PtrTy(II->getContext(), PtrTy->getAddressSpace());
if (PtrTy != TargetTy) {
Ptr = CastInst::CreatePointerCast(Ptr, TargetTy, "", II);
PtrTy = TargetTy;
}
std::string name;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment