[llvm] [RISCV][GISel] Rename XLenVT sXLen to be consistent with other LLTs. (PR #70288)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 21:18:03 PDT 2023


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 fa18827754ebdd144f41fd4a889016c8ae1caf0c c199d7ede02b2552f38c00e675982675bae11c13 -- llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
index 066fa8511..1b0dbd85c 100644
--- a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
+++ b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
@@ -65,12 +65,9 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) {
         .maxScalar(0, sXLen)
         .lower();
   } else {
-    getActionDefinitionsBuilder({G_ZEXT, G_SEXT, G_ANYEXT})
-        .maxScalar(0, sXLen);
+    getActionDefinitionsBuilder({G_ZEXT, G_SEXT, G_ANYEXT}).maxScalar(0, sXLen);
 
-    getActionDefinitionsBuilder(G_SEXT_INREG)
-        .maxScalar(0, sXLen)
-        .lower();
+    getActionDefinitionsBuilder(G_SEXT_INREG).maxScalar(0, sXLen).lower();
   }
 
   // Merge/Unmerge
@@ -113,21 +110,16 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) {
       .clampScalar(0, s32, sXLen)
       .lower();
 
-  auto &ExtLoadActions =
-      getActionDefinitionsBuilder({G_SEXTLOAD, G_ZEXTLOAD})
-          .legalForTypesWithMemDesc({{s32, p0, s8, 8},
-                                     {s32, p0, s16, 16},
-                                     {sXLen, p0, s8, 8},
-                                     {sXLen, p0, s16, 16}});
+  auto &ExtLoadActions = getActionDefinitionsBuilder({G_SEXTLOAD, G_ZEXTLOAD})
+                             .legalForTypesWithMemDesc({{s32, p0, s8, 8},
+                                                        {s32, p0, s16, 16},
+                                                        {sXLen, p0, s8, 8},
+                                                        {sXLen, p0, s16, 16}});
   if (XLen == 64)
     ExtLoadActions.legalForTypesWithMemDesc({{sXLen, p0, s32, 32}});
-  ExtLoadActions
-    .widenScalarToNextPow2(0)
-    .clampScalar(0, s32, sXLen)
-    .lower();
+  ExtLoadActions.widenScalarToNextPow2(0).clampScalar(0, s32, sXLen).lower();
 
-  getActionDefinitionsBuilder(G_PTR_ADD)
-      .legalFor({{p0, sXLen}});
+  getActionDefinitionsBuilder(G_PTR_ADD).legalFor({{p0, sXLen}});
 
   getActionDefinitionsBuilder(G_PTRTOINT)
       .legalFor({{sXLen, p0}})
@@ -137,9 +129,7 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) {
       .legalFor({{p0, sXLen}})
       .clampScalar(1, sXLen, sXLen);
 
-  getActionDefinitionsBuilder(G_BRCOND)
-      .legalFor({sXLen})
-      .minScalar(0, sXLen);
+  getActionDefinitionsBuilder(G_BRCOND).legalFor({sXLen}).minScalar(0, sXLen);
 
   getActionDefinitionsBuilder(G_PHI)
       .legalFor({p0, sXLen})
@@ -161,9 +151,7 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) {
         .lower();
     // clang-format on
 
-    getActionDefinitionsBuilder({G_SMULO, G_UMULO})
-        .minScalar(0, sXLen)
-        .lower();
+    getActionDefinitionsBuilder({G_SMULO, G_UMULO}).minScalar(0, sXLen).lower();
   } else {
     getActionDefinitionsBuilder(G_MUL)
         .libcallFor({sXLen, s2xXLen})
@@ -178,9 +166,7 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) {
         // the low bits for the mul result and high bits to do the overflow
         // check.
         .widenScalarIf(
-            [=](const LegalityQuery &Query) {
-              return Query.Types[0] == sXLen;
-            },
+            [=](const LegalityQuery &Query) { return Query.Types[0] == sXLen; },
             [=](const LegalityQuery &Query) {
               return std::make_pair(0, s2xXLen);
             })

``````````

</details>


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


More information about the llvm-commits mailing list