Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4319,8 +4319,10 @@ bool SIInstrInfo::mayAccessScratchThroughFlat(const MachineInstr &MI) const {
if (!isFLAT(MI) || isFLATGlobal(MI))
return false;

// If scratch is not initialized, we can never access it.
if (MI.getMF()->getFunction().hasFnAttribute("amdgpu-no-flat-scratch-init"))
// If scratch is not initialized, we can never access it unless the target has
// the ability to access scratch outside its own thread.
if (!ST.hasGloballyAddressableScratch() &&
MI.getMF()->getFunction().hasFnAttribute("amdgpu-no-flat-scratch-init"))
return false;

// SCRATCH instructions always access scratch.
Expand Down
Loading