Skip to content
Merged
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
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3936,7 +3936,7 @@ bool AMDGPUDAGToDAGISel::isUniformLoad(const SDNode *N) const {
const auto *Ld = cast<LoadSDNode>(N);

const MachineMemOperand *MMO = Ld->getMemOperand();
if (N->isDivergent() && !AMDGPUInstrInfo::isUniformMMO(MMO))
if (N->isDivergent() && !AMDGPU::isUniformMMO(MMO))
return false;

return MMO->getSize().hasValue() &&
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ bool AMDGPUTargetLowering::shouldReduceLoadWidth(
AS == AMDGPUAS::CONSTANT_ADDRESS_32BIT ||
(isa<LoadSDNode>(N) && AS == AMDGPUAS::GLOBAL_ADDRESS &&
MN->isInvariant())) &&
AMDGPUInstrInfo::isUniformMMO(MN->getMemOperand()))
AMDGPU::isUniformMMO(MN->getMemOperand()))
return false;

// Don't produce extloads from sub 32-bit types. SI doesn't have scalar
Expand Down
7 changes: 1 addition & 6 deletions llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,12 @@

using namespace llvm;

// Pin the vtable to this file.
//void AMDGPUInstrInfo::anchor() {}

AMDGPUInstrInfo::AMDGPUInstrInfo(const GCNSubtarget &ST) { }

Intrinsic::ID AMDGPU::getIntrinsicID(const MachineInstr &I) {
return I.getOperand(I.getNumExplicitDefs()).getIntrinsicID();
}

// TODO: Should largely merge with AMDGPUTTIImpl::isSourceOfDivergence.
bool AMDGPUInstrInfo::isUniformMMO(const MachineMemOperand *MMO) {
bool AMDGPU::isUniformMMO(const MachineMemOperand *MMO) {
const Value *Ptr = MMO->getValue();
// UndefValue means this is a load of a kernel input. These are uniform.
// Sometimes LDS instructions have constant pointers.
Expand Down
9 changes: 2 additions & 7 deletions llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,10 @@ class GCNSubtarget;
class MachineMemOperand;
class MachineInstr;

class AMDGPUInstrInfo {
public:
explicit AMDGPUInstrInfo(const GCNSubtarget &st);

static bool isUniformMMO(const MachineMemOperand *MMO);
};

namespace AMDGPU {

bool isUniformMMO(const MachineMemOperand *MMO);

/// Return the intrinsic ID for opcodes with the G_AMDGPU_INTRIN_ prefix.
///
/// These opcodes have an Intrinsic::ID operand similar to a GIntrinsic. But
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/AMDGPURegBankLegalizeRules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ RegBankLegalizeRules::RegBankLegalizeRules(const GCNSubtarget &_ST,
});

Predicate isUniMMO([](const MachineInstr &MI) -> bool {
return AMDGPUInstrInfo::isUniformMMO(*MI.memoperands_begin());
return AMDGPU::isUniformMMO(*MI.memoperands_begin());
});

Predicate isConst([](const MachineInstr &MI) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ bool AMDGPURegisterBankInfo::isScalarLoadLegal(const MachineInstr &MI) const {
(IsConst || !MMO->isVolatile()) &&
// Memory must be known constant, or not written before this load.
(IsConst || MMO->isInvariant() || (MMO->getFlags() & MONoClobber)) &&
AMDGPUInstrInfo::isUniformMMO(MMO);
AMDGPU::isUniformMMO(MMO);
}

RegisterBankInfo::InstructionMappings
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/SIISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10866,7 +10866,7 @@ SDValue SITargetLowering::LowerLOAD(SDValue Op, SelectionDAG &DAG) const {
(AS == AMDGPUAS::GLOBAL_ADDRESS &&
Subtarget->getScalarizeGlobalBehavior() && Load->isSimple() &&
isMemOpHasNoClobberedMemOperand(Load))) {
if ((!Op->isDivergent() || AMDGPUInstrInfo::isUniformMMO(MMO)) &&
if ((!Op->isDivergent() || AMDGPU::isUniformMMO(MMO)) &&
Alignment >= Align(4) && NumElements < 32) {
if (MemVT.isPow2VectorType() ||
(Subtarget->hasScalarDwordx3Loads() && NumElements == 3))
Expand Down
Loading