diff options
author | Nikita Popov <npopov@redhat.com> | 2025-03-20 09:20:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-20 09:20:39 +0100 |
commit | 0738f706151b41063d09b2dc349cabd471b2476e (patch) | |
tree | 9419aab222235a33d282fc715629f7e260509243 /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | d4b586ad95d7a2d13e49c5e9cee8c5d6611efccb (diff) | |
download | llvm-0738f706151b41063d09b2dc349cabd471b2476e.zip llvm-0738f706151b41063d09b2dc349cabd471b2476e.tar.gz llvm-0738f706151b41063d09b2dc349cabd471b2476e.tar.bz2 |
[Intrinsics] Add Intrinsic::getFnAttributes() (NFC) (#132029)
Most places that call Intrinsic::getAttributes() are only interested in
the function attributes, so add a separate function for that.
The motivation for this is that I'd like to add the ability to specify
range attributes on intrinsics, which requires knowing the function
type. This avoids needing to know the type for most attribute queries.
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index b806790..735e1f5 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -1070,7 +1070,7 @@ bool MachineVerifier::verifyGIntrinsicSideEffects(const MachineInstr *MI) { Opcode == TargetOpcode::G_INTRINSIC_CONVERGENT; unsigned IntrID = cast<GIntrinsic>(MI)->getIntrinsicID(); if (IntrID != 0 && IntrID < Intrinsic::num_intrinsics) { - AttributeList Attrs = Intrinsic::getAttributes( + AttributeSet Attrs = Intrinsic::getFnAttributes( MF->getFunction().getContext(), static_cast<Intrinsic::ID>(IntrID)); bool DeclHasSideEffects = !Attrs.getMemoryEffects().doesNotAccessMemory(); if (NoSideEffects && DeclHasSideEffects) { @@ -1094,9 +1094,9 @@ bool MachineVerifier::verifyGIntrinsicConvergence(const MachineInstr *MI) { Opcode == TargetOpcode::G_INTRINSIC_W_SIDE_EFFECTS; unsigned IntrID = cast<GIntrinsic>(MI)->getIntrinsicID(); if (IntrID != 0 && IntrID < Intrinsic::num_intrinsics) { - AttributeList Attrs = Intrinsic::getAttributes( + AttributeSet Attrs = Intrinsic::getFnAttributes( MF->getFunction().getContext(), static_cast<Intrinsic::ID>(IntrID)); - bool DeclIsConvergent = Attrs.hasFnAttr(Attribute::Convergent); + bool DeclIsConvergent = Attrs.hasAttribute(Attribute::Convergent); if (NotConvergent && DeclIsConvergent) { report(Twine(TII->getName(Opcode), " used with a convergent intrinsic"), MI); |