Skip to content

Commit 8f8cab6

Browse files
[llvm] Use Instruction::hasMetadata (NFC)
1 parent 5f4c89e commit 8f8cab6

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

llvm/lib/IR/ProfDataUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ bool isTargetMD(const MDNode *ProfData, const char *Name, unsigned MinOps) {
7070
namespace llvm {
7171

7272
bool hasProfMD(const Instruction &I) {
73-
return nullptr != I.getMetadata(LLVMContext::MD_prof);
73+
return I.hasMetadata(LLVMContext::MD_prof);
7474
}
7575

7676
bool isBranchWeightMD(const MDNode *ProfileData) {

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15519,7 +15519,7 @@ unsigned AArch64TargetLowering::getNumInterleavedAccesses(
1551915519
MachineMemOperand::Flags
1552015520
AArch64TargetLowering::getTargetMMOFlags(const Instruction &I) const {
1552115521
if (Subtarget->getProcFamily() == AArch64Subtarget::Falkor &&
15522-
I.getMetadata(FALKOR_STRIDED_ACCESS_MD) != nullptr)
15522+
I.hasMetadata(FALKOR_STRIDED_ACCESS_MD))
1552315523
return MOStridedAccess;
1552415524
return MachineMemOperand::MONone;
1552515525
}

llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ void SIAnnotateControlFlow::initialize(Module &M, const GCNSubtarget &ST) {
147147
/// Is the branch condition uniform or did the StructurizeCFG pass
148148
/// consider it as such?
149149
bool SIAnnotateControlFlow::isUniform(BranchInst *T) {
150-
return UA->isUniform(T) ||
151-
T->getMetadata("structurizecfg.uniform") != nullptr;
150+
return UA->isUniform(T) || T->hasMetadata("structurizecfg.uniform");
152151
}
153152

154153
/// Is BB the last block saved on the stack ?

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ bool RISCVTargetLowering::getTgtMemIntrinsic(IntrinsicInfo &Info,
14881488
return true;
14891489
};
14901490

1491-
if (I.getMetadata(LLVMContext::MD_nontemporal) != nullptr)
1491+
if (I.hasMetadata(LLVMContext::MD_nontemporal))
14921492
Info.flags |= MachineMemOperand::MONonTemporal;
14931493

14941494
Info.flags |= RISCVTargetLowering::getTargetMMOFlags(I);

0 commit comments

Comments
 (0)