[llvm-branch-commits] [llvm] [AMDGPU][SIFoldOperands] Fold some redundant bitmasks (PR #131311)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Mar 14 04:20:26 PDT 2025


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 b87a9db3b8ab29db3f1bb668a4d3bf312add817b f46e24f0f5f98e5deb7bd13d737ed8c674da75e1 --extensions cpp -- 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 a279a0a973..9069c4d530 100644
--- a/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
@@ -1484,7 +1484,7 @@ static bool getBitsReadByInst(unsigned Opc, unsigned &NumBitsRead,
 }
 
 static bool isAndBitMaskRedundant(MachineInstr &MI, unsigned BitsNeeded,
-                                        unsigned &SrcOp) {
+                                  unsigned &SrcOp) {
   MachineOperand *RegOp = &MI.getOperand(1);
   MachineOperand *ImmOp = &MI.getOperand(2);
 
@@ -1517,9 +1517,10 @@ bool SIFoldOperandsImpl::tryFoldBitMask(MachineInstr &MI) const {
 
   MachineInstr *OpDef = MRI->getVRegDef(OpReg);
   if (!OpDef)
-    return false ;
+    return false;
 
-  LLVM_DEBUG(dbgs() << "tryFoldBitMask: " << MI << "\tOpIdx:" << OpIdx << ", NumBitsRead:" << NumBitsRead << "\n");
+  LLVM_DEBUG(dbgs() << "tryFoldBitMask: " << MI << "\tOpIdx:" << OpIdx
+                    << ", NumBitsRead:" << NumBitsRead << "\n");
 
   unsigned ReplaceWith;
   switch (OpDef->getOpcode()) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/131311


More information about the llvm-branch-commits mailing list