[llvm] [RISCV] Check for null LIS before trying to move AVL in canMutatePriorConfig. (PR #196673)
via llvm-commits
llvm-commits at lists.llvm.org
Fri May 8 20:12:32 PDT 2026
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 origin/main HEAD --extensions cpp -- llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
index 9eeadadc9..81ea9a8e6 100644
--- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
@@ -776,8 +776,8 @@ bool RISCVInsertVSETVLI::canMutatePriorConfig(
VNInfo *VNI = getVNInfoFromReg(AVL.getReg(), MI, LIS);
VNInfo *PrevVNI = getVNInfoFromReg(AVL.getReg(), PrevMI, LIS);
if (!VNI || !PrevVNI || VNI != PrevVNI) {
- // If LIS is null, we were not able to get the VNInfo so we don't know if
- // the AVL def needs to be moved.
+ // If LIS is null, we were not able to get the VNInfo so we don't know
+ // if the AVL def needs to be moved.
if (!LIS)
return false;
// If the AVL is defined by a load immediate instruction (ADDI x0, imm),
``````````
</details>
https://github.com/llvm/llvm-project/pull/196673
More information about the llvm-commits
mailing list