[llvm] [AMDGPU] Handle amdgpu.last.use metadata (PR #83816)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 4 02:13:04 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 5dc9e87c8cae7842edcaa4dd01308873109208da b5b25657650f6800cd6e59eaf6d4b8ba6458d2de -- llvm/lib/Target/AMDGPU/SIISelLowering.cpp llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp b/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp
index ff3e6bc9f8..52d0a480b7 100644
--- a/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp
+++ b/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp
@@ -100,23 +100,20 @@ private:
bool IsNonTemporal = false;
bool IsLastUse = false;
- SIMemOpInfo(AtomicOrdering Ordering = AtomicOrdering::SequentiallyConsistent,
- SIAtomicScope Scope = SIAtomicScope::SYSTEM,
- SIAtomicAddrSpace OrderingAddrSpace = SIAtomicAddrSpace::ATOMIC,
- SIAtomicAddrSpace InstrAddrSpace = SIAtomicAddrSpace::ALL,
- bool IsCrossAddressSpaceOrdering = true,
- AtomicOrdering FailureOrdering =
- AtomicOrdering::SequentiallyConsistent,
- bool IsVolatile = false,
- bool IsNonTemporal = false,
- bool IsLastUse = false)
- : Ordering(Ordering), FailureOrdering(FailureOrdering),
- Scope(Scope), OrderingAddrSpace(OrderingAddrSpace),
- InstrAddrSpace(InstrAddrSpace),
- IsCrossAddressSpaceOrdering(IsCrossAddressSpaceOrdering),
- IsVolatile(IsVolatile),
- IsNonTemporal(IsNonTemporal),
- IsLastUse(IsLastUse) {
+ SIMemOpInfo(
+ AtomicOrdering Ordering = AtomicOrdering::SequentiallyConsistent,
+ SIAtomicScope Scope = SIAtomicScope::SYSTEM,
+ SIAtomicAddrSpace OrderingAddrSpace = SIAtomicAddrSpace::ATOMIC,
+ SIAtomicAddrSpace InstrAddrSpace = SIAtomicAddrSpace::ALL,
+ bool IsCrossAddressSpaceOrdering = true,
+ AtomicOrdering FailureOrdering = AtomicOrdering::SequentiallyConsistent,
+ bool IsVolatile = false, bool IsNonTemporal = false,
+ bool IsLastUse = false)
+ : Ordering(Ordering), FailureOrdering(FailureOrdering), Scope(Scope),
+ OrderingAddrSpace(OrderingAddrSpace), InstrAddrSpace(InstrAddrSpace),
+ IsCrossAddressSpaceOrdering(IsCrossAddressSpaceOrdering),
+ IsVolatile(IsVolatile), IsNonTemporal(IsNonTemporal),
+ IsLastUse(IsLastUse) {
if (Ordering == AtomicOrdering::NotAtomic) {
assert(Scope == SIAtomicScope::NONE &&
@@ -206,9 +203,7 @@ public:
/// \returns True if memory access of the machine instruction used to
/// create this SIMemOpInfo is last use, false otherwise.
- bool isLastUse() const {
- return IsLastUse;
- }
+ bool isLastUse() const { return IsLastUse; }
/// \returns True if ordering constraint of the machine instruction used to
/// create this SIMemOpInfo is unordered or higher, false otherwise.
@@ -638,8 +633,7 @@ public:
bool expandSystemScopeStore(MachineBasicBlock::iterator &MI) const override;
- bool enableLastUse(MachineInstr &MI,
- bool IsLastUse) const override;
+ bool enableLastUse(MachineInstr &MI, bool IsLastUse) const override;
};
class SIMemoryLegalizer final : public MachineFunctionPass {
@@ -2453,7 +2447,8 @@ bool SIGfx12CacheControl::enableLastUse(MachineInstr &MI,
assert(MI.mayLoad() && !MI.mayStore());
if (IsLastUse && !isScope(MI, AMDGPU::CPol::SCOPE_SYS))
- return setTH(MI, AMDGPU::CPol::TH_LU);;
+ return setTH(MI, AMDGPU::CPol::TH_LU);
+ ;
return false;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/83816
More information about the llvm-commits
mailing list