[llvm] [AMDGPU] Prevent cyclic behaviour in SIFoldOperands (PR #82099)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 16 23:43:27 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 b366643ca3d780931afed6bff7148a4822e51119 6cc801800fef4bbc0f0f5711145d4097a5381ad9 -- llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
index 808412809c..8ad94ee1de 100644
--- a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
@@ -75,7 +75,7 @@ public:
const SIRegisterInfo *TRI;
const GCNSubtarget *ST;
const SIMachineFunctionInfo *MFI;
-
+
bool frameIndexMayFold(const MachineInstr &UseMI, int OpNo,
const MachineOperand &OpToFold) const;
@@ -773,7 +773,7 @@ void SIFoldOperands::foldOperand(
if (UseMI->isRegSequence()) {
Register RegSeqDstReg = UseMI->getOperand(0).getReg();
unsigned RegSeqDstSubReg = UseMI->getOperand(UseOpIdx + 1).getImm();
- static std::unordered_set<MachineInstr*> seenMI;
+ static std::unordered_set<MachineInstr *> seenMI;
for (auto &RSUse : make_early_inc_range(MRI->use_nodbg_operands(RegSeqDstReg))) {
MachineInstr *RSUseMI = RSUse.getParent();
@@ -783,11 +783,11 @@ void SIFoldOperands::foldOperand(
if (RSUse.getSubReg() != RegSeqDstSubReg)
continue;
-
+
if (seenMI.count(RSUseMI) != 0)
continue;
seenMI.insert(RSUseMI);
-
+
foldOperand(OpToFold, RSUseMI, RSUseMI->getOperandNo(&RSUse), FoldList,
CopiesToReplace);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/82099
More information about the llvm-commits
mailing list