Skip to content

Commit b31a7e5

Browse files
committed
Code improvement in the lambda.
1 parent 19aedb9 commit b31a7e5

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -702,15 +702,16 @@ struct AAAMDAttributesFunction : public AAAMDAttributes {
702702
const auto &CB = cast<CallBase>(I);
703703
const Function *Callee = CB.getCalledFunction();
704704

705-
if (Callee && Callee->isIntrinsic())
705+
// Callee == 0 for inline asm or indirect call with known callees.
706+
// In the latter case, updateImpl() already checked the callees and we
707+
// know their FLAT_SCRATCH_INIT bit is set.
708+
// If function has indirect call with unknown callees, the bit is
709+
// already removed in updateImpl() and execution won't reach here.
710+
if (!Callee)
711+
return true;
712+
else
706713
return Callee->getIntrinsicID() !=
707714
Intrinsic::amdgcn_addrspacecast_nonnull;
708-
709-
// Return true for all other cases, including (1)inline asm, (2)direct
710-
// call, and (3)indirect call with known callees. For (2) and (3)
711-
// updateImpl() already checked the callees and we know their
712-
// FLAT_SCRATCH_INIT bit is set.
713-
return true;
714715
};
715716

716717
bool UsedAssumedInformation = false;

0 commit comments

Comments
 (0)