[llvm] [RISCV] Swap the order of SEWGreaterThanOrEqualAndLessThan64 and SEWGreaterThanOrEqual. (PR #120649)

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 19 15:39:05 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-risc-v

Author: Craig Topper (topperc)

<details>
<summary>Changes</summary>

SEWGreaterThanOrEqualAndLessThan64 is a stricter constraint so it should have a higher value than SEWGreaterThanOrEqual.

Found by our random test generator. I don't have a test case yet.

---
Full diff: https://github.com/llvm/llvm-project/pull/120649.diff


1 Files Affected:

- (modified) llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp (+3-3) 


``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
index 49c2bc90c085ab..55f2742edf38e3 100644
--- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
@@ -219,12 +219,12 @@ struct DemandedFields {
   // What properties of SEW we need to preserve.
   enum : uint8_t {
     SEWEqual = 3,              // The exact value of SEW needs to be preserved.
-    SEWGreaterThanOrEqual = 2, // SEW can be changed as long as it's greater
-                               // than or equal to the original value.
     SEWGreaterThanOrEqualAndLessThan64 =
-        1,      // SEW can be changed as long as it's greater
+        2,      // SEW can be changed as long as it's greater
                 // than or equal to the original value, but must be less
                 // than 64.
+    SEWGreaterThanOrEqual = 1, // SEW can be changed as long as it's greater
+                               // than or equal to the original value.
     SEWNone = 0 // We don't need to preserve SEW at all.
   } SEW = SEWNone;
   enum : uint8_t {

``````````

</details>


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


More information about the llvm-commits mailing list