[llvm] [RISCV] Don't use MachineInstr::isIdenticalTo in hasSameAVL (PR #90431)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 28 22:59:03 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-risc-v
Author: Luke Lau (lukel97)
<details>
<summary>Changes</summary>
MachineInstr::isIdenticalTo compares that the operands and flags are the same IIUC, but I think we actually want to check that it's the same MachineInstr * with respect to position in the block etc.
---
Full diff: https://github.com/llvm/llvm-project/pull/90431.diff
1 Files Affected:
- (modified) llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp (+2-2)
``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
index b5fd508fa77de2..b27e1dd258ebd0 100644
--- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
@@ -568,8 +568,8 @@ class VSETVLIInfo {
bool hasSameAVL(const VSETVLIInfo &Other) const {
if (hasAVLReg() && Other.hasAVLReg())
- return getAVLDefMI().isIdenticalTo(Other.getAVLDefMI()) &&
- getAVLReg() == Other.getAVLReg();
+ return AVLRegDef.DefMI == Other.AVLRegDef.DefMI &&
+ AVLRegDef.DefReg == Other.AVLRegDef.DefReg;
if (hasAVLImm() && Other.hasAVLImm())
return getAVLImm() == Other.getAVLImm();
``````````
</details>
https://github.com/llvm/llvm-project/pull/90431
More information about the llvm-commits
mailing list