Skip to content
Open
Show file tree
Hide file tree
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
18 changes: 8 additions & 10 deletions llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4422,16 +4422,14 @@ bool AMDGPUDAGToDAGISel::isUniformLoad(const SDNode *N) const {
const auto *Ld = cast<LoadSDNode>(N);
const MachineMemOperand *MMO = Ld->getMemOperand();

if (Ld->isDivergent()) {
// FIXME: We ought to able able to take the direct isDivergent result. We
// cannot rely on the MMO for a uniformity check, and should stop using
// it. This is a hack for 2 ways that the IR divergence analysis is superior
// to the DAG divergence: Recognizing shift-of-workitem-id as always
// uniform, and isSingleLaneExecution. These should be handled in the DAG
// version, and then this can be dropped.
if (!MMO->getValue() || !AMDGPU::isUniformMMO(MMO))
return false;
}
// FIXME: We ought to able able to take the direct isDivergent result. We
// cannot rely on the MMO for a uniformity check, and should stop using
// it. This is a hack for 2 ways that the IR divergence analysis is superior
// to the DAG divergence: Recognizing shift-of-workitem-id as always
// uniform, and isSingleLaneExecution. These should be handled in the DAG
// version, and then this can be dropped.
if (Ld->isDivergent() && !AMDGPU::isUniformMMO(MMO))
return false;

return MMO->getSize().hasValue() &&
Ld->getAlign() >=
Expand Down
8 changes: 3 additions & 5 deletions llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ bool AMDGPU::isUniformMMO(const MachineMemOperand *MMO) {
PSV->isJumpTable();
}

// FIXME: null value is should be treated as unknown, not as uniform.
return true;
// Unknown value.
return false;
}

// UndefValue means this is a load of a kernel input. These are uniform.
// Sometimes LDS instructions have constant pointers.
// If Ptr is null, then that means this mem operand contains a
// PseudoSourceValue like GOT.
if (!Ptr || isa<UndefValue, Constant, GlobalValue>(Ptr))
if (isa<UndefValue, Constant, GlobalValue>(Ptr))
return true;

if (MMO->getAddrSpace() == AMDGPUAS::CONSTANT_ADDRESS_32BIT)
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2363,7 +2363,7 @@ Register AMDGPULegalizerInfo::getSegmentAperture(
if (!loadInputValue(QueuePtr, B, AMDGPUFunctionArgInfo::QUEUE_PTR))
return Register();

// TODO: can we be smarter about machine pointer info?
// TODO: Use custom PseudoSourceValue
MachinePointerInfo PtrInfo(AMDGPUAS::CONSTANT_ADDRESS);

// Offset into amd_queue_t for group_segment_aperture_base_hi /
Expand Down
Loading