[clang] [compiler-rt] [llvm] [ConstantFolding] Canonicalize constexpr GEPs to i8 (PR #89872)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 21:57:33 PDT 2024


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 d26002ac38ee1dea32053e7d12f1bb5dc420ac2d 2fa7299db558c2a953f641ffe760369f31a98b3d -- clang/test/CodeGen/RISCV/riscv-inline-asm.c clang/test/CodeGen/attr-counted-by.c clang/test/CodeGenCXX/atomicinit.cpp clang/test/CodeGenCXX/auto-var-init.cpp clang/test/Profile/c-unreachable-after-switch.c compiler-rt/test/profile/Linux/counter_promo_for.c compiler-rt/test/profile/Linux/counter_promo_while.c llvm/lib/Analysis/ConstantFolding.cpp
``````````

</details>

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

``````````diff
diff --git a/compiler-rt/test/profile/Linux/counter_promo_for.c b/compiler-rt/test/profile/Linux/counter_promo_for.c
index aa77e6084b..d843510697 100644
--- a/compiler-rt/test/profile/Linux/counter_promo_for.c
+++ b/compiler-rt/test/profile/Linux/counter_promo_for.c
@@ -18,30 +18,30 @@ int g;
 __attribute__((noinline)) void bar(int i) { g += i; }
 
 __attribute__((noinline)) void foo(int n, int N) {
-// PROMO-LABEL: @foo
-// PROMO: load{{.*}}@__profc_foo{{.*}} 24){{.*}}
-// PROMO-NEXT: add
-// PROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 24){{.*}}
-// PROMO: load{{.*}}@__profc_foo, align
-// PROMO-NEXT: add
-// PROMO-NEXT: store{{.*}}@__profc_foo, align
-// PROMO-NEXT: load{{.*}}@__profc_foo{{.*}} 8){{.*}}
-// PROMO-NEXT: add
-// PROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 8){{.*}}
-// PROMO: load{{.*}}@__profc_foo{{.*}} 16){{.*}}
-// PROMO-NEXT: add
-// PROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 16){{.*}}
-//
-// NOPROMO-LABEL: @foo
-// NOPROMO: load{{.*}}@__profc_foo, align
-// NOPROMO-NEXT: add
-// NOPROMO-NEXT: store{{.*}}@__profc_foo, align
-// NOPROMO: load{{.*}}@__profc_foo{{.*}} 8){{.*}}
-// NOPROMO-NEXT: add
-// NOPROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 8){{.*}}
-// NOPROMO: load{{.*}}@__profc_foo{{.*}} 16){{.*}}
-// NOPROMO-NEXT: add
-// NOPROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 16){{.*}}
+  // PROMO-LABEL: @foo
+  // PROMO: load{{.*}}@__profc_foo{{.*}} 24){{.*}}
+  // PROMO-NEXT: add
+  // PROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 24){{.*}}
+  // PROMO: load{{.*}}@__profc_foo, align
+  // PROMO-NEXT: add
+  // PROMO-NEXT: store{{.*}}@__profc_foo, align
+  // PROMO-NEXT: load{{.*}}@__profc_foo{{.*}} 8){{.*}}
+  // PROMO-NEXT: add
+  // PROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 8){{.*}}
+  // PROMO: load{{.*}}@__profc_foo{{.*}} 16){{.*}}
+  // PROMO-NEXT: add
+  // PROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 16){{.*}}
+  //
+  // NOPROMO-LABEL: @foo
+  // NOPROMO: load{{.*}}@__profc_foo, align
+  // NOPROMO-NEXT: add
+  // NOPROMO-NEXT: store{{.*}}@__profc_foo, align
+  // NOPROMO: load{{.*}}@__profc_foo{{.*}} 8){{.*}}
+  // NOPROMO-NEXT: add
+  // NOPROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 8){{.*}}
+  // NOPROMO: load{{.*}}@__profc_foo{{.*}} 16){{.*}}
+  // NOPROMO-NEXT: add
+  // NOPROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 16){{.*}}
   int i;
   for (i = 0; i < N; i++) {
     if (i < n + 1)
diff --git a/compiler-rt/test/profile/Linux/counter_promo_while.c b/compiler-rt/test/profile/Linux/counter_promo_while.c
index c6ea3a7282..e0a9ee3c24 100644
--- a/compiler-rt/test/profile/Linux/counter_promo_while.c
+++ b/compiler-rt/test/profile/Linux/counter_promo_while.c
@@ -16,27 +16,27 @@
 int g;
 __attribute__((noinline)) void bar(int i) { g += i; }
 __attribute__((noinline)) void foo(int n, int N) {
-// PROMO-LABEL: @foo
-// PROMO: load{{.*}}@__profc_foo, align
-// PROMO-NEXT: add
-// PROMO-NEXT: store{{.*}}@__profc_foo, align
-// PROMO-NEXT: load{{.*}}@__profc_foo{{.*}} 8){{.*}}
-// PROMO-NEXT: add
-// PROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 8){{.*}}
-// PROMO-NEXT: load{{.*}}@__profc_foo{{.*}} 16){{.*}}
-// PROMO-NEXT: add
-// PROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 16){{.*}}
-//
-// NOPROMO-LABEL: @foo
-// NOPROMO: load{{.*}}@__profc_foo, align
-// NOPROMO-NEXT: add
-// NOPROMO-NEXT: store{{.*}}@__profc_foo, align
-// NOPROMO: load{{.*}}@__profc_foo{{.*}} 8){{.*}}
-// NOPROMO-NEXT: add
-// NOPROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 8){{.*}}
-// NOPROMO: load{{.*}}@__profc_foo{{.*}} 16){{.*}}
-// NOPROMO-NEXT: add
-// NOPROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 16){{.*}}
+  // PROMO-LABEL: @foo
+  // PROMO: load{{.*}}@__profc_foo, align
+  // PROMO-NEXT: add
+  // PROMO-NEXT: store{{.*}}@__profc_foo, align
+  // PROMO-NEXT: load{{.*}}@__profc_foo{{.*}} 8){{.*}}
+  // PROMO-NEXT: add
+  // PROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 8){{.*}}
+  // PROMO-NEXT: load{{.*}}@__profc_foo{{.*}} 16){{.*}}
+  // PROMO-NEXT: add
+  // PROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 16){{.*}}
+  //
+  // NOPROMO-LABEL: @foo
+  // NOPROMO: load{{.*}}@__profc_foo, align
+  // NOPROMO-NEXT: add
+  // NOPROMO-NEXT: store{{.*}}@__profc_foo, align
+  // NOPROMO: load{{.*}}@__profc_foo{{.*}} 8){{.*}}
+  // NOPROMO-NEXT: add
+  // NOPROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 8){{.*}}
+  // NOPROMO: load{{.*}}@__profc_foo{{.*}} 16){{.*}}
+  // NOPROMO-NEXT: add
+  // NOPROMO-NEXT: store{{.*}}@__profc_foo{{.*}} 16){{.*}}
   int i = 0;
   while (i < N) {
     if (i < n + 1)

``````````

</details>


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


More information about the llvm-commits mailing list