[llvm] [RISCV] Check that VLMAX is the same when demanding exact VL (PR #89080)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 17 07:40:36 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-risc-v
Author: Luke Lau (lukel97)
<details>
<summary>Changes</summary>
Currently we just check the AVL is the same, but if the AVL is larger than VLMAX then the VL may differ. We need to also check that the VLMAX (a.k.a the SEW/LMUL ratio) is also the same.
This doesn't seem to be a problem in practice beacause coincidentally we only demanded VLAny whenever we also demand SEWLMULRatio, see getDemanded. So I don't think it's possible to create a test case.
---
Full diff: https://github.com/llvm/llvm-project/pull/89080.diff
1 Files Affected:
- (modified) llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp (+1-1)
``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
index fa37d1ccccd737..331253e39c0acb 100644
--- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
@@ -616,7 +616,7 @@ class VSETVLIInfo {
if (SEWLMULRatioOnly)
return false;
- if (Used.VLAny && !hasSameAVL(Require))
+ if (Used.VLAny && !(hasSameAVL(Require) && hasSameVLMAX(Require)))
return false;
if (Used.VLZeroness && !hasEquallyZeroAVL(Require, MRI))
``````````
</details>
https://github.com/llvm/llvm-project/pull/89080
More information about the llvm-commits
mailing list