Skip to content

Commit b721941

Browse files
committed
[SYCL] Recover removed AddressSpaceCast in 3cfd1de (#28411)
Addressspace cast is needed and added in #8222 Recently in during the CGBuiltin refactoring, we discarded the addressspace together in the conflict resolution in 3cfd1de
1 parent 5114ebd commit b721941

File tree

1 file changed

+4
-13
lines changed
  • clang/lib/CodeGen/TargetBuiltins

1 file changed

+4
-13
lines changed

clang/lib/CodeGen/TargetBuiltins/X86.cpp

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,10 @@ static Value *getMaskVecValue(CodeGenFunction &CGF, Value *Mask,
7474
}
7575
return MaskVec;
7676
}
77-
// static Value *EmitX86MaskedStore(CodeGenFunction &CGF, ArrayRef<Value *> Ops,
78-
// Align Alignment) {
79-
// Value *Ptr = CGF.Builder.CreateAddrSpaceCast(
80-
// Ops[0], llvm::PointerType::getUnqual(Ops[1]->getType()));
81-
82-
// Value *MaskVec = getMaskVecValue(
83-
// CGF, Ops[2],
84-
// cast<llvm::FixedVectorType>(Ops[1]->getType())->getNumElements());
85-
86-
// return CGF.Builder.CreateMaskedStore(Ops[1], Ptr, Alignment, MaskVec);
87-
// }
8877
static Value *EmitX86MaskedStore(CodeGenFunction &CGF, ArrayRef<Value *> Ops,
8978
Align Alignment) {
90-
Value *Ptr = Ops[0];
79+
Value *Ptr = CGF.Builder.CreateAddrSpaceCast(
80+
Ops[0], llvm::PointerType::getUnqual(Ops[1]->getType()));
9181

9282
Value *MaskVec = getMaskVecValue(
9383
CGF, Ops[2],
@@ -99,7 +89,8 @@ static Value *EmitX86MaskedStore(CodeGenFunction &CGF, ArrayRef<Value *> Ops,
9989
static Value *EmitX86MaskedLoad(CodeGenFunction &CGF, ArrayRef<Value *> Ops,
10090
Align Alignment) {
10191
llvm::Type *Ty = Ops[1]->getType();
102-
Value *Ptr = Ops[0];
92+
Value *Ptr = CGF.Builder.CreateAddrSpaceCast(
93+
Ops[0], llvm::PointerType::getUnqual(Ops[1]->getType()));
10394

10495
Value *MaskVec = getMaskVecValue(
10596
CGF, Ops[2], cast<llvm::FixedVectorType>(Ty)->getNumElements());

0 commit comments

Comments
 (0)