Skip to content

Commit 6296be1

Browse files
committed
Some minor code changes.
1 parent 944dfc3 commit 6296be1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ class AMDGPUInformationCache : public InformationCache {
262262
return !HasAperture && (Access & ADDR_SPACE_CAST);
263263
}
264264

265-
bool constHasASCastFromPrivate(const Constant *C, Function &Fn) {
265+
bool checkConstForAddrSpaceCastFromPrivate(const Constant *C) {
266266
SmallPtrSet<const Constant *, 8> Visited;
267267
uint8_t Access = getConstantAccess(C, Visited);
268268

@@ -706,8 +706,8 @@ struct AAAMDAttributesFunction : public AAAMDAttributes {
706706

707707
// Check all AddrSpaceCast instructions. FlatScratchInit is needed if
708708
// there is a cast from PRIVATE_ADDRESS.
709-
auto AddrSpaceCastNotFromPrivate = [&](Instruction &I) {
710-
return static_cast<AddrSpaceCastInst &>(I).getSrcAddressSpace() !=
709+
auto AddrSpaceCastNotFromPrivate = [](Instruction &I) {
710+
return cast<AddrSpaceCastInst>(I).getSrcAddressSpace() !=
711711
AMDGPUAS::PRIVATE_ADDRESS;
712712
};
713713

@@ -724,7 +724,7 @@ struct AAAMDAttributesFunction : public AAAMDAttributes {
724724
for (Instruction &I : instructions(F)) {
725725
for (const Use &U : I.operands()) {
726726
if (const auto *C = dyn_cast<Constant>(U)) {
727-
if (InfoCache.constHasASCastFromPrivate(C, *F))
727+
if (InfoCache.checkConstForAddrSpaceCastFromPrivate(C))
728728
return true;
729729
}
730730
}

0 commit comments

Comments
 (0)