Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrkusanin committed Mar 4, 2024
1 parent b585a1b commit 39b5411
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,20 @@ class SIMemOpInfo final {
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 &&
Expand Down Expand Up @@ -206,9 +203,7 @@ class SIMemOpInfo final {

/// \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.
Expand Down Expand Up @@ -638,8 +633,7 @@ class SIGfx12CacheControl : public SIGfx11CacheControl {

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 {
Expand Down Expand Up @@ -2453,7 +2447,7 @@ 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;
}
Expand Down

0 comments on commit 39b5411

Please sign in to comment.