Skip to content

[MLIR][LLVMIR] Always use TargetFolder in IRBuilder #126929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Feb 12, 2025

This is a followup to #126745, generalizing it to always use TargetFolder, including inside function bodies.

This avoids generating non-canonical constant expressions that can be folded away.

This is a followup to llvm#126745,
generalizing it to always use TargetFolder, including inside
function bodies.

This avoids generating constant expressions that can be folded
away, and reduces changes when constant expressions get removed
over time.
@nikic nikic requested a review from gysit February 12, 2025 15:40
@llvmbot llvmbot added mlir:llvm mlir flang Flang issues not falling into any other category flang:fir-hlfir flang:openmp labels Feb 12, 2025
@llvmbot
Copy link
Member

llvmbot commented Feb 12, 2025

@llvm/pr-subscribers-flang-fir-hlfir

@llvm/pr-subscribers-flang-openmp

Author: Nikita Popov (nikic)

Changes

This is a followup to #126745, generalizing it to always use TargetFolder, including inside function bodies.

This avoids generating non-canonical constant expressions that can be folded away.


Patch is 43.54 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/126929.diff

19 Files Affected:

  • (modified) flang/test/Fir/alloc.fir (+18-18)
  • (modified) flang/test/Fir/arrexp.fir (+1-1)
  • (modified) flang/test/Fir/box.fir (+10-10)
  • (modified) flang/test/Fir/embox.fir (+7-8)
  • (modified) flang/test/Fir/ignore-missing-type-descriptor.fir (+1-1)
  • (modified) flang/test/Fir/polymorphic.fir (+3-3)
  • (modified) flang/test/Fir/rebox.fir (+2-2)
  • (modified) flang/test/Integration/OpenMP/map-types-and-sizes.f90 (+2-2)
  • (modified) flang/test/Integration/OpenMP/private-global.f90 (+2-2)
  • (modified) flang/test/Lower/OpenMP/parallel-reduction-mixed.f90 (+1-2)
  • (modified) flang/test/Lower/allocatable-polymorphic.f90 (+1-1)
  • (modified) flang/test/Lower/forall/character-1.f90 (+1-1)
  • (modified) flang/test/Lower/real-descriptors.f90 (+6-6)
  • (modified) mlir/lib/Target/LLVMIR/ModuleTranslation.cpp (+5-3)
  • (modified) mlir/test/Target/LLVMIR/omptarget-array-sectioning-host.mlir (+1-1)
  • (modified) mlir/test/Target/LLVMIR/omptarget-constant-indexing-device-region.mlir (+1-1)
  • (modified) mlir/test/Target/LLVMIR/omptarget-fortran-common-block-host.mlir (+3-3)
  • (modified) mlir/test/Target/LLVMIR/omptarget-record-type-with-ptr-member-host.mlir (+4-4)
  • (modified) mlir/test/Target/LLVMIR/openmp-private.mlir (+2-2)
diff --git a/flang/test/Fir/alloc.fir b/flang/test/Fir/alloc.fir
index e00fc9d6649c4..ba9b08dad7764 100644
--- a/flang/test/Fir/alloc.fir
+++ b/flang/test/Fir/alloc.fir
@@ -19,14 +19,14 @@ func.func @alloca_scalars_nonchar() -> !fir.ref<i32> {
 }
 
 // CHECK-LABEL: define ptr @allocmem_scalar_nonchar(
-// CHECK: call ptr @malloc(i64 ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64))
+// CHECK: call ptr @malloc(i64 4)
 func.func @allocmem_scalar_nonchar() -> !fir.heap<i32> {
   %1 = fir.allocmem i32
   return %1 : !fir.heap<i32>
 }
 
 // CHECK-LABEL: define ptr @allocmem_scalars_nonchar(
-// CHECK: call ptr @malloc(i64 mul (i64 ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64), i64 100))
+// CHECK: call ptr @malloc(i64 400)
 func.func @allocmem_scalars_nonchar() -> !fir.heap<i32> {
   %0 = arith.constant 100 : index
   %1 = fir.allocmem i32, %0
@@ -48,14 +48,14 @@ func.func @alloca_scalar_char_kind() -> !fir.ref<!fir.char<2,10>> {
 }
 
 // CHECK-LABEL: define ptr @allocmem_scalar_char(
-// CHECK: call ptr @malloc(i64 ptrtoint (ptr getelementptr ([10 x i8], ptr null, i32 1) to i64))
+// CHECK: call ptr @malloc(i64 10)
 func.func @allocmem_scalar_char() -> !fir.heap<!fir.char<1,10>> {
   %1 = fir.allocmem !fir.char<1,10>
   return %1 : !fir.heap<!fir.char<1,10>>
 }
 
 // CHECK-LABEL: define ptr @allocmem_scalar_char_kind(
-// CHECK: call ptr @malloc(i64 ptrtoint (ptr getelementptr ([10 x i16], ptr null, i32 1) to i64))
+// CHECK: call ptr @malloc(i64 20)
 func.func @allocmem_scalar_char_kind() -> !fir.heap<!fir.char<2,10>> {
   %1 = fir.allocmem !fir.char<2,10>
   return %1 : !fir.heap<!fir.char<2,10>>
@@ -82,7 +82,7 @@ func.func @alloca_scalar_dynchar_kind(%l : i32) -> !fir.ref<!fir.char<2,?>> {
 // CHECK-LABEL: define ptr @allocmem_scalar_dynchar(
 // CHECK-SAME: i32 %[[len:.*]])
 // CHECK: %[[mul1:.*]] = sext i32 %[[len]] to i64
-// CHECK: %[[mul2:.*]] = mul i64 ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64), %[[mul1]]
+// CHECK: %[[mul2:.*]] = mul i64 1, %[[mul1]]
 // CHECK: call ptr @malloc(i64 %[[mul2]])
 func.func @allocmem_scalar_dynchar(%l : i32) -> !fir.heap<!fir.char<1,?>> {
   %1 = fir.allocmem !fir.char<1,?>(%l : i32)
@@ -92,7 +92,7 @@ func.func @allocmem_scalar_dynchar(%l : i32) -> !fir.heap<!fir.char<1,?>> {
 // CHECK-LABEL: define ptr @allocmem_scalar_dynchar_kind(
 // CHECK-SAME: i32 %[[len:.*]])
 // CHECK: %[[mul1:.*]] = sext i32 %[[len]] to i64
-// CHECK: %[[mul2:.*]] = mul i64 ptrtoint (ptr getelementptr (i16, ptr null, i32 1) to i64), %[[mul1]]
+// CHECK: %[[mul2:.*]] = mul i64 2, %[[mul1]]
 // CHECK: call ptr @malloc(i64 %[[mul2]])
 func.func @allocmem_scalar_dynchar_kind(%l : i32) -> !fir.heap<!fir.char<2,?>>{
   %1 = fir.allocmem !fir.char<2,?>(%l : i32)
@@ -131,14 +131,14 @@ func.func @alloca_array_of_dynchar(%l: i32) -> !fir.ref<!fir.array<3x3x!fir.char
 }
 
 // CHECK-LABEL: define ptr @allocmem_array_of_nonchar(
-// CHECK: call ptr @malloc(i64 ptrtoint (ptr getelementptr ([3 x [3 x i32]], ptr null, i32 1) to i64))
+// CHECK: call ptr @malloc(i64 36)
 func.func @allocmem_array_of_nonchar() -> !fir.heap<!fir.array<3x3xi32>> {
   %1 = fir.allocmem !fir.array<3x3xi32>
   return %1 : !fir.heap<!fir.array<3x3xi32>>
 }
 
 // CHECK-LABEL: define ptr @allocmem_array_of_char(
-// CHECK: call ptr @malloc(i64 ptrtoint (ptr getelementptr ([3 x [3 x [10 x i8]]], ptr null, i32 1) to i64))
+// CHECK: call ptr @malloc(i64 90)
 func.func @allocmem_array_of_char() -> !fir.heap<!fir.array<3x3x!fir.char<1,10>>> {
   %1 = fir.allocmem !fir.array<3x3x!fir.char<1,10>>
   return %1 : !fir.heap<!fir.array<3x3x!fir.char<1,10>>>
@@ -147,7 +147,7 @@ func.func @allocmem_array_of_char() -> !fir.heap<!fir.array<3x3x!fir.char<1,10>>
 // CHECK-LABEL: define ptr @allocmem_array_of_dynchar(
 // CHECK-SAME: i32 %[[len:.*]])
 // CHECK: %[[mul1:.*]] = sext i32 %[[len]] to i64
-// CHECK: %[[mul2:.*]] = mul i64 mul (i64 ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64), i64 9), %[[mul1]]
+// CHECK: %[[mul2:.*]] = mul i64 9, %[[mul1]]
 // CHECK: call ptr @malloc(i64 %[[mul2]])
 func.func @allocmem_array_of_dynchar(%l: i32) -> !fir.heap<!fir.array<3x3x!fir.char<1,?>>> {
   %1 = fir.allocmem !fir.array<3x3x!fir.char<1,?>>(%l : i32)
@@ -175,7 +175,7 @@ func.func @alloca_dynarray_of_nonchar2(%e: index) -> !fir.ref<!fir.array<?x?xi32
 
 // CHECK-LABEL: define ptr @allocmem_dynarray_of_nonchar(
 // CHECK-SAME: i64 %[[extent:.*]])
-// CHECK: %[[prod1:.*]] = mul i64 ptrtoint (ptr getelementptr ([3 x i32], ptr null, i32 1) to i64), %[[extent]]
+// CHECK: %[[prod1:.*]] = mul i64 12, %[[extent]]
 // CHECK: call ptr @malloc(i64 %[[prod1]])
 func.func @allocmem_dynarray_of_nonchar(%e: index) -> !fir.heap<!fir.array<3x?xi32>> {
   %1 = fir.allocmem !fir.array<3x?xi32>, %e
@@ -184,7 +184,7 @@ func.func @allocmem_dynarray_of_nonchar(%e: index) -> !fir.heap<!fir.array<3x?xi
 
 // CHECK-LABEL: define ptr @allocmem_dynarray_of_nonchar2(
 // CHECK-SAME: i64 %[[extent:.*]])
-// CHECK: %[[prod1:.*]] = mul i64 ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64), %[[extent]]
+// CHECK: %[[prod1:.*]] = mul i64 4, %[[extent]]
 // CHECK: %[[prod2:.*]] = mul i64 %[[prod1]], %[[extent]]
 // CHECK: call ptr @malloc(i64 %[[prod2]])
 func.func @allocmem_dynarray_of_nonchar2(%e: index) -> !fir.heap<!fir.array<?x?xi32>> {
@@ -213,7 +213,7 @@ func.func @alloca_dynarray_of_char2(%e : index) -> !fir.ref<!fir.array<?x?x!fir.
 
 // CHECK-LABEL: define ptr @allocmem_dynarray_of_char(
 // CHECK-SAME: i64 %[[extent:.*]])
-// CHECK: %[[prod1:.*]] = mul i64 ptrtoint (ptr getelementptr ([3 x [10 x i16]], ptr null, i32 1) to i64), %[[extent]]
+// CHECK: %[[prod1:.*]] = mul i64 60, %[[extent]]
 // CHECK: call ptr @malloc(i64 %[[prod1]])
 func.func @allocmem_dynarray_of_char(%e : index) -> !fir.heap<!fir.array<3x?x!fir.char<2,10>>> {
   %1 = fir.allocmem !fir.array<3x?x!fir.char<2,10>>, %e
@@ -222,7 +222,7 @@ func.func @allocmem_dynarray_of_char(%e : index) -> !fir.heap<!fir.array<3x?x!fi
 
 // CHECK-LABEL: define ptr @allocmem_dynarray_of_char2(
 // CHECK-SAME: i64 %[[extent:.*]])
-// CHECK: %[[prod1:.*]] = mul i64 ptrtoint (ptr getelementptr ([10 x i16], ptr null, i32 1) to i64), %[[extent]]
+// CHECK: %[[prod1:.*]] = mul i64 20, %[[extent]]
 // CHECK: %[[prod2:.*]] = mul i64 %[[prod1]], %[[extent]]
 // CHECK: call ptr @malloc(i64 %[[prod2]])
 func.func @allocmem_dynarray_of_char2(%e : index) -> !fir.heap<!fir.array<?x?x!fir.char<2,10>>> {
@@ -255,7 +255,7 @@ func.func @alloca_dynarray_of_dynchar2(%l: i32, %e : index) -> !fir.ref<!fir.arr
 // CHECK-LABEL: define ptr @allocmem_dynarray_of_dynchar(
 // CHECK-SAME: i32 %[[len:.*]], i64 %[[extent:.*]])
 // CHECK: %[[prod1:.*]] = sext i32 %[[len]] to i64
-// CHECK: %[[prod2:.*]] = mul i64 mul (i64 ptrtoint (ptr getelementptr (i16, ptr null, i32 1) to i64), i64 3), %[[prod1]]
+// CHECK: %[[prod2:.*]] = mul i64 6, %[[prod1]]
 // CHECK: %[[prod3:.*]] = mul i64 %[[prod2]], %[[extent]]
 // CHECK: call ptr @malloc(i64 %[[prod3]])
 func.func @allocmem_dynarray_of_dynchar(%l: i32, %e : index) -> !fir.heap<!fir.array<3x?x!fir.char<2,?>>> {
@@ -266,7 +266,7 @@ func.func @allocmem_dynarray_of_dynchar(%l: i32, %e : index) -> !fir.heap<!fir.a
 // CHECK-LABEL: define ptr @allocmem_dynarray_of_dynchar2(
 // CHECK-SAME: i32 %[[len:.*]], i64 %[[extent:.*]])
 // CHECK: %[[a:.*]] = sext i32 %[[len]] to i64
-// CHECK: %[[prod1:.*]] = mul i64 ptrtoint (ptr getelementptr (i16, ptr null, i32 1) to i64), %[[a]]
+// CHECK: %[[prod1:.*]] = mul i64 2, %[[a]]
 // CHECK: %[[prod2:.*]] = mul i64 %[[prod1]], %[[extent]]
 // CHECK: %[[prod3:.*]] = mul i64 %[[prod2]], %[[extent]]
 // CHECK: call ptr @malloc(i64 %[[prod3]])
@@ -306,7 +306,7 @@ func.func @alloca_array_with_holes_dynchar(%arg0: index, %arg1: index) -> !fir.r
 
 // CHECK-LABEL: define ptr @allocmem_array_with_holes_nonchar(
 // CHECK-SAME: i64 %[[e1:.*]], i64 %[[e2:.*]])
-// CHECK: %[[a:.*]] = mul i64 mul (i64 ptrtoint{{.*}} 15), %[[e1]]
+// CHECK: %[[a:.*]] = mul i64 240, %[[e1]]
 // CHECK: %[[b:.*]] = mul i64 %3, %[[e2]]
 // CHECK: call ptr @malloc(i64 %[[b]])
 func.func @allocmem_array_with_holes_nonchar(%0 : index, %1 : index) -> !fir.heap<!fir.array<4x?x3x?x5xi32>> {
@@ -316,7 +316,7 @@ func.func @allocmem_array_with_holes_nonchar(%0 : index, %1 : index) -> !fir.hea
 
 // CHECK-LABEL: define ptr @allocmem_array_with_holes_char(
 // CHECK-SAME: i64 %[[e:.*]])
-// CHECK: %[[mul:.*]] = mul i64 mul (i64 ptrtoint (ptr getelementptr ([3 x [10 x i16]], ptr null, i32 1) to i64), i64 4), %[[e]]
+// CHECK: %[[mul:.*]] = mul i64 240, %[[e]]
 // CHECK: call ptr @malloc(i64 %[[mul]])
 func.func @allocmem_array_with_holes_char(%e: index) -> !fir.heap<!fir.array<3x?x4x!fir.char<2,10>>> {
   %1 = fir.allocmem !fir.array<3x?x4x!fir.char<2,10>>, %e
@@ -325,7 +325,7 @@ func.func @allocmem_array_with_holes_char(%e: index) -> !fir.heap<!fir.array<3x?
 
 // CHECK-LABEL: define ptr @allocmem_array_with_holes_dynchar(
 // CHECK-SAME: i64 %[[len:.*]], i64 %[[extent:.*]])
-// CHECK: %[[a:.*]] = mul i64 mul (i64 ptrtoint (ptr getelementptr (i16, ptr null, i32 1) to i64), i64 12), %[[len]]
+// CHECK: %[[a:.*]] = mul i64 24, %[[len]]
 // CHECK: %[[b:.*]] = mul i64 %[[a]], %[[extent]]
 // CHECK: call ptr @malloc(i64 %[[b]])
 func.func @allocmem_array_with_holes_dynchar(%arg0: index, %arg1: index) -> !fir.heap<!fir.array<3x?x4x!fir.char<2,?>>> {
diff --git a/flang/test/Fir/arrexp.fir b/flang/test/Fir/arrexp.fir
index 69fc77deb57e3..924c1fab8d84b 100644
--- a/flang/test/Fir/arrexp.fir
+++ b/flang/test/Fir/arrexp.fir
@@ -145,7 +145,7 @@ func.func @f6(%arg0: !fir.box<!fir.array<?xf32>>, %arg1: f32) {
 
   // CHECK: %[[EXT_GEP:.*]] = getelementptr {{.*}} %[[A]], i32 0, i32 7, i64 0, i32 1
   // CHECK: %[[EXTENT:.*]] = load i64, ptr %[[EXT_GEP]]
-  // CHECK: %[[SIZE:.*]] = mul i64 ptrtoint (ptr getelementptr (float, ptr null, i32 1) to i64), %[[EXTENT]]
+  // CHECK: %[[SIZE:.*]] = mul i64 4, %[[EXTENT]]
   // CHECK: %[[MALLOC:.*]] = call ptr @malloc(i64 %[[SIZE]])
   %1 = fir.slice %c2, %c10, %c1 : (index, index, index) -> !fir.slice<1>
   %2 = fir.array_load %arg0 [%1] : (!fir.box<!fir.array<?xf32>>, !fir.slice<1>) -> !fir.array<?xf32>
diff --git a/flang/test/Fir/box.fir b/flang/test/Fir/box.fir
index ef6be4d9b513e..5e931a2e0d9aa 100644
--- a/flang/test/Fir/box.fir
+++ b/flang/test/Fir/box.fir
@@ -27,7 +27,7 @@ func.func private @ga(%b : !fir.box<!fir.array<?xf32>>)
 // CHECK: (ptr captures(none) %[[ARG:.*]])
 func.func @f(%a : !fir.ref<f32>) {
   // CHECK: %[[DESC:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8 }
-  // CHECK: %[[INS0:.*]] = insertvalue {{.*}} { ptr undef, i64 ptrtoint (ptr getelementptr (float, ptr null, i32 1) to i64), i32 20240719, i8 0, i8 27, i8 0, i8 0 }, ptr %[[ARG]], 0
+  // CHECK: %[[INS0:.*]] = insertvalue {{.*}} { ptr undef, i64 4, i32 20240719, i8 0, i8 27, i8 0, i8 0 }, ptr %[[ARG]], 0
   // CHECK: store {{.*}} %[[INS0]], {{.*}} %[[DESC]]
   %b = fir.embox %a : (!fir.ref<f32>) -> !fir.box<f32>
 
@@ -44,7 +44,7 @@ func.func @fa(%a : !fir.ref<!fir.array<100xf32>>) {
   %c1 = arith.constant 1 : index
   %c100 = arith.constant 100 : index
   %d = fir.shape %c100 : (index) -> !fir.shape<1>
-  // CHECK: %[[INS70:.*]] = insertvalue {{.*}} { ptr undef, i64 ptrtoint (ptr getelementptr (float, ptr null, i32 1) to i64), i32 20240719, i8 1, i8 27, i8 0, i8 0, {{.*}} }, ptr %{{.*}}, 0
+  // CHECK: %[[INS70:.*]] = insertvalue {{.*}} { ptr undef, i64 4, i32 20240719, i8 1, i8 27, i8 0, i8 0, {{.*}} }, ptr %{{.*}}, 0
   %b = fir.embox %c(%d) : (!fir.ref<!fir.array<?xf32>>, !fir.shape<1>) -> !fir.box<!fir.array<?xf32>>
   // CHECK: call void @ga(
   fir.call @ga(%b) : (!fir.box<!fir.array<?xf32>>) -> ()
@@ -57,7 +57,7 @@ func.func @fa(%a : !fir.ref<!fir.array<100xf32>>) {
 // CHECK-SAME: ptr captures(none) %[[res:.*]], ptr captures(none) %[[arg0:.*]], i64 %[[arg1:.*]])
 func.func @b1(%arg0 : !fir.ref<!fir.char<1,?>>, %arg1 : index) -> !fir.box<!fir.char<1,?>> {
   // CHECK: %[[alloca:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8 }
-  // CHECK: %[[size:.*]] = mul i64 ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64), %[[arg1]]
+  // CHECK: %[[size:.*]] = mul i64 1, %[[arg1]]
   // CHECK: insertvalue {{.*}} undef, i64 %[[size]], 1
   // CHECK: insertvalue {{.*}} i32 20240719, 2
   // CHECK: insertvalue {{.*}} ptr %[[arg0]], 0
@@ -74,8 +74,8 @@ func.func @b1(%arg0 : !fir.ref<!fir.char<1,?>>, %arg1 : index) -> !fir.box<!fir.
 func.func @b2(%arg0 : !fir.ref<!fir.array<?x!fir.char<1,5>>>, %arg1 : index) -> !fir.box<!fir.array<?x!fir.char<1,5>>> {
   %1 = fir.shape %arg1 : (index) -> !fir.shape<1>
   // CHECK: %[[alloca:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }
-  // CHECK: insertvalue {{.*}} { ptr undef, i64 ptrtoint (ptr getelementptr ([5 x i8], ptr null, i32 1) to i64), i32 20240719, i8 1, i8 40, i8 0, i8 0, {{.*}} }, i64 %[[arg1]], 7, 0, 1
-  // CHECK: insertvalue {{.*}} %{{.*}}, i64 ptrtoint (ptr getelementptr ([5 x i8], ptr null, i32 1) to i64), 7, 0, 2
+  // CHECK: insertvalue {{.*}} { ptr undef, i64 5, i32 20240719, i8 1, i8 40, i8 0, i8 0, {{.*}} }, i64 %[[arg1]], 7, 0, 1
+  // CHECK: insertvalue {{.*}} %{{.*}}, i64 5, 7, 0, 2
   // CHECK: insertvalue {{.*}} ptr %[[arg0]], 0
   %2 = fir.embox %arg0(%1) : (!fir.ref<!fir.array<?x!fir.char<1,5>>>, !fir.shape<1>) -> !fir.box<!fir.array<?x!fir.char<1,5>>>
   // CHECK: store {{.*}}, ptr %[[alloca]]
@@ -89,7 +89,7 @@ func.func @b2(%arg0 : !fir.ref<!fir.array<?x!fir.char<1,5>>>, %arg1 : index) ->
 func.func @b3(%arg0 : !fir.ref<!fir.array<?x!fir.char<1,?>>>, %arg1 : index, %arg2 : index) -> !fir.box<!fir.array<?x!fir.char<1,?>>> {
   %1 = fir.shape %arg2 : (index) -> !fir.shape<1>
   // CHECK: %[[alloca:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }
-  // CHECK: %[[size:.*]] = mul i64 ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64), %[[arg1]]
+  // CHECK: %[[size:.*]] = mul i64 1, %[[arg1]]
   // CHECK: insertvalue {{.*}} i64 %[[size]], 1
   // CHECK: insertvalue {{.*}} i32 20240719, 2
   // CHECK: insertvalue {{.*}} i64 %[[arg2]], 7, 0, 1
@@ -108,7 +108,7 @@ func.func @b4(%arg0 : !fir.ref<!fir.array<7x!fir.char<1,?>>>, %arg1 : index) ->
   %c_7 = arith.constant 7 : index
   %1 = fir.shape %c_7 : (index) -> !fir.shape<1>
   // CHECK: %[[alloca:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }
-  // CHECK:   %[[size:.*]] = mul i64 ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64), %[[arg1]]
+  // CHECK:   %[[size:.*]] = mul i64 1, %[[arg1]]
   // CHECK: insertvalue {{.*}} i64 %[[size]], 1
   // CHECK: insertvalue {{.*}} i32 20240719, 2
   // CHECK: insertvalue {{.*}} i64 7, 7, 0, 1
@@ -154,12 +154,12 @@ func.func @box6(%0 : !fir.ref<!fir.array<?x?x?x?xf32>>, %1 : index, %2 : index)
   // CHECK: %[[sdp2:.*]] = sdiv i64 %[[dp2]], 2
   // CHECK: %[[cmp:.*]] = icmp sgt i64 %[[sdp2]], 0
   // CHECK: %[[extent:.*]] = select i1 %[[cmp]], i64 %[[sdp2]], i64 0
-  // CHECK: insertvalue { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] } { ptr undef, i64 ptrtoint (ptr getelementptr (float, ptr null, i32 1) to i64), i32 20240719, i8 2, i8 27, i8 0, i8 0, [2 x [3 x i64]] [{{\[}}3 x i64] [i64 1, i64 undef, i64 undef], [3 x i64] undef] }, i64 %[[extent]], 7, 0, 1
-  // CHECK: insertvalue { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] } %{{.*}}, i64 mul (i64 ptrtoint (ptr getelementptr (float, ptr null, i32 1) to i64), i64 200), 7, 0, 2
+  // CHECK: insertvalue { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] } { ptr undef, i64 4, i32 20240719, i8 2, i8 27, i8 0, i8 0, [2 x [3 x i64]] [{{\[}}3 x i64] [i64 1, i64 undef, i64 undef], [3 x i64] undef] }, i64 %[[extent]], 7, 0, 1
+  // CHECK: insertvalue { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] } %{{.*}}, i64 800, 7, 0, 2
   // CHECK: %[[op25:.*]] = add i64 25000, %[[i100p40]]
   // CHECK: insertvalue { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] } %{{.*}}, i64 1, 7, 1, 0
   // CHECK: insertvalue { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] } %{{.*}}, i64 4, 7, 1, 1
-  // CHECK: insertvalue { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] } %{{.*}}, i64 mul (i64 ptrtoint (ptr getelementptr (float, ptr null, i32 1) to i64), i64 30000), 7, 1, 2
+  // CHECK: insertvalue { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] } %{{.*}}, i64 120000, 7, 1, 2
   // CHECK: %[[op300:.*]] = add i64 300000, %[[op25]]
   // CHECK: %[[ptr:.*]] = getelementptr float, ptr %[[ARG0]], i64 %[[op300]]
   // CHECK: insertvalue { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] } %{{.*}}, ptr %[[ptr]], 0
diff --git a/flang/test/Fir/embox.fir b/flang/test/Fir/embox.fir
index 0b8bc3fd4be14..18b5efbc6a0e4 100644
--- a/flang/test/Fir/embox.fir
+++ b/flang/test/Fir/embox.fir
@@ -13,8 +13,8 @@ func.func @_QPtest_slice() {
 // CHECK:  %[[a2:.*]] = alloca [20 x i32], i64 1, align 4
 // CHECK:  %[[a3:.*]] = getelementptr [20 x i32], ptr %[[a2]], i64 0, i64 0
 // CHECK:  %[[a4:.*]] = insertvalue { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }
-// CHECK:  { ptr undef, i64 ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64), i32 20240719, i8 1, i8 9, i8 0, i8 0, [1 x [3 x i64]]
-// CHECK: [i64 1, i64 5, i64 mul (i64 ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64), i64 2)]] }, ptr %[[a3]], 0
+// CHECK:  { ptr undef, i64 4, i32 20240719, i8 1, i8 9, i8 0, i8 0, [1 x [3 x i64]]
+// CHECK: [i64 1, i64 5, i64 8]] }, ptr %[[a3]], 0
 // CHECK:  store { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] } %[[a4]], ptr %[[a1]], align 8
 // CHECK:  call void @_QPtest_callee(ptr %[[a1]])
   %c20 = arith.constant 20 : index
@@ -40,9 +40,8 @@ func.func @_QPtest_dt_slice() {
 // CHECK:  %[[a3:.*]] = alloca [20 x %_QFtest_dt_sliceTt], i64 1, align 8
 // CHECK:  %[[a4:.*]] = getelementptr [20 x %_QFtest_dt_sliceTt], ptr %[[a3]], i64 0, i64 0, i32 0
 // CHECK: %[[a5:.*]] = insertvalue { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }
-// CHECK-SAME: { ptr undef, i64 ptrtoint (ptr getelementptr (i32, ptr null, i32 1) to i64), i32 20240719, i8 1, i8 9, i8 0, i8 0, [1 x [3 x i64]]
-// CHECK-SAME: [i64 1, i64 5, i64 mul
-// CHECK-SAME: (i64 ptrtoint (ptr getelementptr (%_QFtest_dt_sliceTt, ptr null, i32 1) to i64), i64 2)]] }
+// CHECK-SAME: { ptr undef, i64 4, i32 20240719, i8 1, i8 9, i8 0, i8 0, [1 x [3 x i64]]
+// CHECK-SAME: [i64 1, i64 5, i64 16
 // CHECK-SAME: , ptr %[[a4]], 0
 
 // CHECK: store { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] } %[[a5]], ptr %[[a1]], align 8
@@ -75,7 +74,7 @@ func.func @emboxSubstring(%arg0: !fir.ref<!fir.array<2x3x!fir.char<1,4>>>) {
   %1 = fir.slice %c1, %c2, %c1, %c1, %c3, %c1 substr %c1_i64, %c2_i64 : (index, index, index, index, index, index, i64, i64) -> !fir.slice<2>
   %2 = fir.embox %arg0(%0) [%1] : (!fir.ref<!fir.array<2x3x!fir.char<1,4>>>, !fir.shape<2>, !fir.slice<2>) -> !fir.box<!fir.array<?x?x!fir.char<1,?>>>
   // CHECK: %[[addr:.*]] = getelementptr [3 x [2 x [4 x i8]]], ptr %[[arg0]], i64 0, i64 0, i64 0, i64 1
-  // CHECK: insertvalue {[[descriptorType:.*]]} { ptr undef, i64 mul (i64 ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64), i64 2), i32 20240719, i8 2, i8 40, i8 0, i8 0
+  // CHECK: insertvalue {[[descriptorType:.*]]} { ptr undef, i64 2, i32 20240719, i8 2, i8 40, i8 0, i8 0
   // CHECK-SAME: [2 x [3 x i64]] [{{\[}}3 x i64] [i64 1, i64 2, i64 4], [3 x i64] [i64 1, i64 3, i64 8]] }
   // CHECK-SAME: ptr %[[addr]], 0
 
@@ -98,7 +97,7 @@ func.func @fir_dev_issue_1416(%arg0: !fir.ref<!fir.array<40x?xf32>>, %low: index
 // CHECK: %[[offset:.*]] = add i64 %[[mul]], 0
 // CHECK: %[[addr:.*]] = getelementptr [40 x float], ptr %0, i64 %[[offset]], i64 0
 // CHECK: %[[box:.*]] = insertvalue { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }
-// CHECK-SAME: { ptr undef, i64 ptrtoint (ptr getelementptr (float, ptr null, i32 1) to i64), i32 20240719, i8 1, i8 27, i8 0, i8 0, [1 x [3 x i64]] [{{.*}} [i64 1, i64 40, i64 ptrtoint (ptr getelementptr (float, ptr null, i32 1) to i64)]] }, ptr %[[addr]], 0
+// CHECK-SAME: { ptr undef, i64 4, i32 20240719, i8 1, i8 27, i8 0, i8 0, [1 x [3 x i64]] [{{.*}} [i64 1, i64 40, i64 4]] }, ptr %[[addr]], 0
     %3 = fir.embox %arg0(%1) [%2] : (!fir.ref<!fir.array<40x?xf32>>, !fir.shapeshift<2>, !fir.slice<2>) -> !fir.box<!fir.array<?xf32>>
     fir.call @do_something(%3) : (!fir.box<!fir.array<?xf32>>) -> ()
     return
@@ -126,4 +125,4 @@ func.func @_QPtest_allocator2() {
   return
 }
 
-// CHECK: %{{.*}} = insertvalue { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] } { ptr undef, i64 ptrtoint (ptr getelementptr (i32, ptr nu...
[truncated]

Copy link
Contributor

@gysit gysit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

LGTM

@nikic nikic merged commit 75c356c into llvm:main Feb 13, 2025
14 checks passed
@nikic nikic deleted the mlir-targetfolder-always branch February 13, 2025 07:54
@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 13, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-libcxx running on linaro-flang-aarch64-libcxx while building flang,mlir at step 6 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/89/builds/16519

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: test (failure)
******************** TEST 'Flang :: Lower/common-block.f90' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: bbc /home/tcwg-buildbot/worker/flang-aarch64-libcxx/llvm-project/flang/test/Lower/common-block.f90 -o - | tco | /home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-libcxx/llvm-project/flang/test/Lower/common-block.f90
+ bbc /home/tcwg-buildbot/worker/flang-aarch64-libcxx/llvm-project/flang/test/Lower/common-block.f90 -o -
+ tco
+ /home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-libcxx/llvm-project/flang/test/Lower/common-block.f90
/home/tcwg-buildbot/worker/flang-aarch64-libcxx/llvm-project/flang/test/Lower/common-block.f90:17:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @__BLNK__, ptr getelementptr (i8, ptr @__BLNK__, i64 4))
          ^
<stdin>:18:19: note: scanning from here
define void @_QPs0() {
                  ^
<stdin>:19:2: note: possible intended match here
 call void @_QPs(ptr @__BLNK__, ptr getelementptr inbounds nuw (i8, ptr @__BLNK__, i64 4))
 ^
/home/tcwg-buildbot/worker/flang-aarch64-libcxx/llvm-project/flang/test/Lower/common-block.f90:26:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @x_, ptr getelementptr (i8, ptr @x_, i64 4))
          ^
<stdin>:23:19: note: scanning from here
define void @_QPs1() {
                  ^
<stdin>:24:2: note: possible intended match here
 call void @_QPs(ptr @x_, ptr getelementptr inbounds nuw (i8, ptr @x_, i64 4))
 ^
/home/tcwg-buildbot/worker/flang-aarch64-libcxx/llvm-project/flang/test/Lower/common-block.f90:34:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @y_, ptr getelementptr (i8, ptr @y_, i64 4))
          ^
<stdin>:28:19: note: scanning from here
define void @_QPs2() {
                  ^
<stdin>:29:2: note: possible intended match here
 call void @_QPs(ptr @y_, ptr getelementptr inbounds nuw (i8, ptr @y_, i64 4))
 ^
/home/tcwg-buildbot/worker/flang-aarch64-libcxx/llvm-project/flang/test/Lower/common-block.f90:61:11: error: CHECK: expected string not found in input
 ! CHECK: load i32, ptr getelementptr (i8, ptr @c_in_mod_, i64 4)
          ^
<stdin>:39:31: note: scanning from here
 %2 = load i32, ptr @c_in_mod_, align 4, !tbaa !2
                              ^
<stdin>:43:21: note: possible intended match here
 %6 = load i32, ptr getelementptr inbounds nuw (i8, ptr @c_in_mod_, i64 4), align 4, !tbaa !2
                    ^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/flang-aarch64-libcxx/llvm-project/flang/test/Lower/common-block.f90

-dump-input=help explains the following input dump.
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 13, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-out-of-tree running on linaro-flang-aarch64-out-of-tree while building flang,mlir at step 8 "test-build-flang-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/53/builds/12268

Here is the relevant piece of the build log for the reference
Step 8 (test-build-flang-unified-tree-check-flang) failure: test (failure)
******************** TEST 'Flang :: Lower/real-descriptors.f90' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: bbc /home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/llvm-project/flang/test/Lower/real-descriptors.f90 -o - | tco | /home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/build_llvm/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/llvm-project/flang/test/Lower/real-descriptors.f90 --check-prefixes=CHECK,CHECK-KIND16
+ bbc /home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/llvm-project/flang/test/Lower/real-descriptors.f90 -o -
+ tco
+ /home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/build_llvm/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/llvm-project/flang/test/Lower/real-descriptors.f90 --check-prefixes=CHECK,CHECK-KIND16
/home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/llvm-project/flang/test/Lower/real-descriptors.f90:81:18: error: CHECK-KIND16: expected string not found in input
 ! CHECK-KIND16: insertvalue { ptr, i64, i32, i8, i8, i8, i8 } { ptr undef, i64 ptrtoint (ptr getelementptr (fp128, ptr null, i32 1) to i64), i32 {{[0-9]*}}, i8 0, i8 31, i8 0, i8 0 }, ptr %{{[0-9]*}}, 0
                 ^
<stdin>:137:28: note: scanning from here
define void @_QPtest_kind16(ptr captures(none) %0, ptr captures(none) %1) {
                           ^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/flang-aarch64-out-of-tree/llvm-project/flang/test/Lower/real-descriptors.f90

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          .
          .
          .
        132:  %17 = call i1 @_FortranAioOutputComplex32(ptr %13, float %15, float %16) 
        133:  %18 = call i32 @_FortranAioEndIoStatement(ptr %13) 
        134:  ret void 
        135: } 
        136:  
        137: define void @_QPtest_kind16(ptr captures(none) %0, ptr captures(none) %1) { 
check:81                                X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
        138:  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        139:  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        140:  %5 = call ptr @_FortranAioBeginInternalListInput(ptr @_QFtest_kind16Ein, i64 10, ptr null, i64 0, ptr @_QQclX23f13ab7eae90f8b2fffa36dd747ab1f, i32 80) 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        141:  %6 = insertvalue { ptr, i64, i32, i8, i8, i8, i8 } { ptr undef, i64 16, i32 20240719, i8 0, i8 31, i8 0, i8 0 }, ptr %0, 0 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        142:  store { ptr, i64, i32, i8, i8, i8, i8 } %6, ptr %4, align 8, !tbaa !24 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
          .
>>>>>>

--

...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 13, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-latest-gcc running on linaro-flang-aarch64-latest-gcc while building flang,mlir at step 6 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/130/builds/9924

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: test (failure)
******************** TEST 'Flang :: Lower/real-descriptors.f90' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: bbc /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/test/Lower/real-descriptors.f90 -o - | tco | /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/test/Lower/real-descriptors.f90 --check-prefixes=CHECK,CHECK-KIND16
+ bbc /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/test/Lower/real-descriptors.f90 -o -
+ tco
+ /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/test/Lower/real-descriptors.f90 --check-prefixes=CHECK,CHECK-KIND16
/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/test/Lower/real-descriptors.f90:81:18: error: CHECK-KIND16: expected string not found in input
 ! CHECK-KIND16: insertvalue { ptr, i64, i32, i8, i8, i8, i8 } { ptr undef, i64 ptrtoint (ptr getelementptr (fp128, ptr null, i32 1) to i64), i32 {{[0-9]*}}, i8 0, i8 31, i8 0, i8 0 }, ptr %{{[0-9]*}}, 0
                 ^
<stdin>:137:28: note: scanning from here
define void @_QPtest_kind16(ptr captures(none) %0, ptr captures(none) %1) {
                           ^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/flang/test/Lower/real-descriptors.f90

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          .
          .
          .
        132:  %17 = call i1 @_FortranAioOutputComplex32(ptr %13, float %15, float %16) 
        133:  %18 = call i32 @_FortranAioEndIoStatement(ptr %13) 
        134:  ret void 
        135: } 
        136:  
        137: define void @_QPtest_kind16(ptr captures(none) %0, ptr captures(none) %1) { 
check:81                                X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
        138:  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        139:  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        140:  %5 = call ptr @_FortranAioBeginInternalListInput(ptr @_QFtest_kind16Ein, i64 10, ptr null, i64 0, ptr @_QQclXd7b717f6b7475e5ac21244e70c6fa56e, i32 80) 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        141:  %6 = insertvalue { ptr, i64, i32, i8, i8, i8, i8 } { ptr undef, i64 16, i32 20240719, i8 0, i8 31, i8 0, i8 0 }, ptr %0, 0 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        142:  store { ptr, i64, i32, i8, i8, i8, i8 } %6, ptr %4, align 8, !tbaa !24 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
          .
>>>>>>

--

...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 13, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-dylib running on linaro-flang-aarch64-dylib while building flang,mlir at step 6 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/50/builds/10072

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: test (failure)
******************** TEST 'Flang :: Lower/common-block.f90' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: bbc /home/tcwg-buildbot/worker/flang-aarch64-dylib/llvm-project/flang/test/Lower/common-block.f90 -o - | tco | /home/tcwg-buildbot/worker/flang-aarch64-dylib/build/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-dylib/llvm-project/flang/test/Lower/common-block.f90
+ bbc /home/tcwg-buildbot/worker/flang-aarch64-dylib/llvm-project/flang/test/Lower/common-block.f90 -o -
+ tco
+ /home/tcwg-buildbot/worker/flang-aarch64-dylib/build/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-dylib/llvm-project/flang/test/Lower/common-block.f90
/home/tcwg-buildbot/worker/flang-aarch64-dylib/llvm-project/flang/test/Lower/common-block.f90:17:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @__BLNK__, ptr getelementptr (i8, ptr @__BLNK__, i64 4))
          ^
<stdin>:18:19: note: scanning from here
define void @_QPs0() {
                  ^
<stdin>:19:2: note: possible intended match here
 call void @_QPs(ptr @__BLNK__, ptr getelementptr inbounds nuw (i8, ptr @__BLNK__, i64 4))
 ^
/home/tcwg-buildbot/worker/flang-aarch64-dylib/llvm-project/flang/test/Lower/common-block.f90:26:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @x_, ptr getelementptr (i8, ptr @x_, i64 4))
          ^
<stdin>:23:19: note: scanning from here
define void @_QPs1() {
                  ^
<stdin>:24:2: note: possible intended match here
 call void @_QPs(ptr @x_, ptr getelementptr inbounds nuw (i8, ptr @x_, i64 4))
 ^
/home/tcwg-buildbot/worker/flang-aarch64-dylib/llvm-project/flang/test/Lower/common-block.f90:34:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @y_, ptr getelementptr (i8, ptr @y_, i64 4))
          ^
<stdin>:28:19: note: scanning from here
define void @_QPs2() {
                  ^
<stdin>:29:2: note: possible intended match here
 call void @_QPs(ptr @y_, ptr getelementptr inbounds nuw (i8, ptr @y_, i64 4))
 ^
/home/tcwg-buildbot/worker/flang-aarch64-dylib/llvm-project/flang/test/Lower/common-block.f90:61:11: error: CHECK: expected string not found in input
 ! CHECK: load i32, ptr getelementptr (i8, ptr @c_in_mod_, i64 4)
          ^
<stdin>:39:31: note: scanning from here
 %2 = load i32, ptr @c_in_mod_, align 4, !tbaa !2
                              ^
<stdin>:43:21: note: possible intended match here
 %6 = load i32, ptr getelementptr inbounds nuw (i8, ptr @c_in_mod_, i64 4), align 4, !tbaa !2
                    ^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/flang-aarch64-dylib/llvm-project/flang/test/Lower/common-block.f90

-dump-input=help explains the following input dump.
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 13, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-sharedlibs running on linaro-flang-aarch64-sharedlibs while building flang,mlir at step 6 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/80/builds/10002

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: test (failure)
******************** TEST 'Flang :: Lower/common-block.f90' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: bbc /home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/flang/test/Lower/common-block.f90 -o - | tco | /home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/flang/test/Lower/common-block.f90
+ bbc /home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/flang/test/Lower/common-block.f90 -o -
+ tco
+ /home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/flang/test/Lower/common-block.f90
/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/flang/test/Lower/common-block.f90:17:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @__BLNK__, ptr getelementptr (i8, ptr @__BLNK__, i64 4))
          ^
<stdin>:18:19: note: scanning from here
define void @_QPs0() {
                  ^
<stdin>:19:2: note: possible intended match here
 call void @_QPs(ptr @__BLNK__, ptr getelementptr inbounds nuw (i8, ptr @__BLNK__, i64 4))
 ^
/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/flang/test/Lower/common-block.f90:26:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @x_, ptr getelementptr (i8, ptr @x_, i64 4))
          ^
<stdin>:23:19: note: scanning from here
define void @_QPs1() {
                  ^
<stdin>:24:2: note: possible intended match here
 call void @_QPs(ptr @x_, ptr getelementptr inbounds nuw (i8, ptr @x_, i64 4))
 ^
/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/flang/test/Lower/common-block.f90:34:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @y_, ptr getelementptr (i8, ptr @y_, i64 4))
          ^
<stdin>:28:19: note: scanning from here
define void @_QPs2() {
                  ^
<stdin>:29:2: note: possible intended match here
 call void @_QPs(ptr @y_, ptr getelementptr inbounds nuw (i8, ptr @y_, i64 4))
 ^
/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/flang/test/Lower/common-block.f90:61:11: error: CHECK: expected string not found in input
 ! CHECK: load i32, ptr getelementptr (i8, ptr @c_in_mod_, i64 4)
          ^
<stdin>:39:31: note: scanning from here
 %2 = load i32, ptr @c_in_mod_, align 4, !tbaa !2
                              ^
<stdin>:43:21: note: possible intended match here
 %6 = load i32, ptr getelementptr inbounds nuw (i8, ptr @c_in_mod_, i64 4), align 4, !tbaa !2
                    ^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/flang/test/Lower/common-block.f90

-dump-input=help explains the following input dump.
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 13, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-rel-assert running on linaro-flang-aarch64-rel-assert while building flang,mlir at step 6 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/29/builds/10345

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: test (failure)
******************** TEST 'Flang :: Lower/common-block.f90' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: bbc /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/flang/test/Lower/common-block.f90 -o - | tco | /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/build/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/flang/test/Lower/common-block.f90
+ bbc /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/flang/test/Lower/common-block.f90 -o -
+ tco
+ /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/build/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/flang/test/Lower/common-block.f90
/home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/flang/test/Lower/common-block.f90:17:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @__BLNK__, ptr getelementptr (i8, ptr @__BLNK__, i64 4))
          ^
<stdin>:18:19: note: scanning from here
define void @_QPs0() {
                  ^
<stdin>:19:2: note: possible intended match here
 call void @_QPs(ptr @__BLNK__, ptr getelementptr inbounds nuw (i8, ptr @__BLNK__, i64 4))
 ^
/home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/flang/test/Lower/common-block.f90:26:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @x_, ptr getelementptr (i8, ptr @x_, i64 4))
          ^
<stdin>:23:19: note: scanning from here
define void @_QPs1() {
                  ^
<stdin>:24:2: note: possible intended match here
 call void @_QPs(ptr @x_, ptr getelementptr inbounds nuw (i8, ptr @x_, i64 4))
 ^
/home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/flang/test/Lower/common-block.f90:34:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @y_, ptr getelementptr (i8, ptr @y_, i64 4))
          ^
<stdin>:28:19: note: scanning from here
define void @_QPs2() {
                  ^
<stdin>:29:2: note: possible intended match here
 call void @_QPs(ptr @y_, ptr getelementptr inbounds nuw (i8, ptr @y_, i64 4))
 ^
/home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/flang/test/Lower/common-block.f90:61:11: error: CHECK: expected string not found in input
 ! CHECK: load i32, ptr getelementptr (i8, ptr @c_in_mod_, i64 4)
          ^
<stdin>:39:31: note: scanning from here
 %2 = load i32, ptr @c_in_mod_, align 4, !tbaa !2
                              ^
<stdin>:43:21: note: possible intended match here
 %6 = load i32, ptr getelementptr inbounds nuw (i8, ptr @c_in_mod_, i64 4), align 4, !tbaa !2
                    ^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/flang/test/Lower/common-block.f90

-dump-input=help explains the following input dump.
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 13, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-release running on linaro-flang-aarch64-release while building flang,mlir at step 6 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/172/builds/9584

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: test (failure)
******************** TEST 'Flang :: Lower/real-descriptors.f90' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: bbc /home/tcwg-buildbot/worker/flang-aarch64-release/llvm-project/flang/test/Lower/real-descriptors.f90 -o - | tco | /home/tcwg-buildbot/worker/flang-aarch64-release/build/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-release/llvm-project/flang/test/Lower/real-descriptors.f90 --check-prefixes=CHECK,CHECK-KIND16
+ tco
+ /home/tcwg-buildbot/worker/flang-aarch64-release/build/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-release/llvm-project/flang/test/Lower/real-descriptors.f90 --check-prefixes=CHECK,CHECK-KIND16
+ bbc /home/tcwg-buildbot/worker/flang-aarch64-release/llvm-project/flang/test/Lower/real-descriptors.f90 -o -
/home/tcwg-buildbot/worker/flang-aarch64-release/llvm-project/flang/test/Lower/real-descriptors.f90:81:18: error: CHECK-KIND16: expected string not found in input
 ! CHECK-KIND16: insertvalue { ptr, i64, i32, i8, i8, i8, i8 } { ptr undef, i64 ptrtoint (ptr getelementptr (fp128, ptr null, i32 1) to i64), i32 {{[0-9]*}}, i8 0, i8 31, i8 0, i8 0 }, ptr %{{[0-9]*}}, 0
                 ^
<stdin>:137:28: note: scanning from here
define void @_QPtest_kind16(ptr captures(none) %0, ptr captures(none) %1) {
                           ^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/flang-aarch64-release/llvm-project/flang/test/Lower/real-descriptors.f90

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          .
          .
          .
        132:  %17 = call i1 @_FortranAioOutputComplex32(ptr %13, float %15, float %16) 
        133:  %18 = call i32 @_FortranAioEndIoStatement(ptr %13) 
        134:  ret void 
        135: } 
        136:  
        137: define void @_QPtest_kind16(ptr captures(none) %0, ptr captures(none) %1) { 
check:81                                X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
        138:  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        139:  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        140:  %5 = call ptr @_FortranAioBeginInternalListInput(ptr @_QFtest_kind16Ein, i64 10, ptr null, i64 0, ptr @_QQclX85be7d0cef07830d05df4a6fe50e0cc4, i32 80) 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        141:  %6 = insertvalue { ptr, i64, i32, i8, i8, i8, i8 } { ptr undef, i64 16, i32 20240719, i8 0, i8 31, i8 0, i8 0 }, ptr %0, 0 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        142:  store { ptr, i64, i32, i8, i8, i8, i8 } %6, ptr %4, align 8, !tbaa !24 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
          .
>>>>>>

--

...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 13, 2025

LLVM Buildbot has detected a new failure on builder flang-aarch64-debug-reverse-iteration running on linaro-flang-aarch64-debug-reverse-iteration while building flang,mlir at step 6 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/20/builds/8840

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: test (failure)
******************** TEST 'Flang :: Lower/real-descriptors.f90' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: bbc /home/tcwg-buildbot/worker/flang-aarch64-debug-reverse-iteration/llvm-project/flang/test/Lower/real-descriptors.f90 -o - | tco | /home/tcwg-buildbot/worker/flang-aarch64-debug-reverse-iteration/build/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-debug-reverse-iteration/llvm-project/flang/test/Lower/real-descriptors.f90 --check-prefixes=CHECK,CHECK-KIND16
+ tco
+ bbc /home/tcwg-buildbot/worker/flang-aarch64-debug-reverse-iteration/llvm-project/flang/test/Lower/real-descriptors.f90 -o -
+ /home/tcwg-buildbot/worker/flang-aarch64-debug-reverse-iteration/build/bin/FileCheck /home/tcwg-buildbot/worker/flang-aarch64-debug-reverse-iteration/llvm-project/flang/test/Lower/real-descriptors.f90 --check-prefixes=CHECK,CHECK-KIND16
/home/tcwg-buildbot/worker/flang-aarch64-debug-reverse-iteration/llvm-project/flang/test/Lower/real-descriptors.f90:81:18: error: CHECK-KIND16: expected string not found in input
 ! CHECK-KIND16: insertvalue { ptr, i64, i32, i8, i8, i8, i8 } { ptr undef, i64 ptrtoint (ptr getelementptr (fp128, ptr null, i32 1) to i64), i32 {{[0-9]*}}, i8 0, i8 31, i8 0, i8 0 }, ptr %{{[0-9]*}}, 0
                 ^
<stdin>:137:28: note: scanning from here
define void @_QPtest_kind16(ptr captures(none) %0, ptr captures(none) %1) {
                           ^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/flang-aarch64-debug-reverse-iteration/llvm-project/flang/test/Lower/real-descriptors.f90

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          .
          .
          .
        132:  %17 = call i1 @_FortranAioOutputComplex32(ptr %13, float %15, float %16) 
        133:  %18 = call i32 @_FortranAioEndIoStatement(ptr %13) 
        134:  ret void 
        135: } 
        136:  
        137: define void @_QPtest_kind16(ptr captures(none) %0, ptr captures(none) %1) { 
check:81                                X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
        138:  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        139:  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        140:  %5 = call ptr @_FortranAioBeginInternalListInput(ptr @_QFtest_kind16Ein, i64 10, ptr null, i64 0, ptr @_QQclX5e39093aae6d79ed3b855d449b407dd3, i32 80) 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        141:  %6 = insertvalue { ptr, i64, i32, i8, i8, i8, i8 } { ptr undef, i64 16, i32 20240719, i8 0, i8 31, i8 0, i8 0 }, ptr %0, 0 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        142:  store { ptr, i64, i32, i8, i8, i8, i8 } %6, ptr %4, align 8, !tbaa !24 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
          .
>>>>>>

--

...

nikic added a commit that referenced this pull request Feb 13, 2025
Update test that require flang-supports-f128-math after #126929.
@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 13, 2025

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve-vla running on linaro-g3-01 while building flang,mlir at step 7 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/17/builds/5787

Here is the relevant piece of the build log for the reference
Step 7 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'Flang :: Lower/common-block.f90' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: bbc /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/flang/test/Lower/common-block.f90 -o - | tco | /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/flang/test/Lower/common-block.f90
+ bbc /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/flang/test/Lower/common-block.f90 -o -
+ tco
+ /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/flang/test/Lower/common-block.f90
/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/flang/test/Lower/common-block.f90:17:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @__BLNK__, ptr getelementptr (i8, ptr @__BLNK__, i64 4))
          ^
<stdin>:18:19: note: scanning from here
define void @_QPs0() {
                  ^
<stdin>:19:2: note: possible intended match here
 call void @_QPs(ptr @__BLNK__, ptr getelementptr inbounds nuw (i8, ptr @__BLNK__, i64 4))
 ^
/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/flang/test/Lower/common-block.f90:26:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @x_, ptr getelementptr (i8, ptr @x_, i64 4))
          ^
<stdin>:23:19: note: scanning from here
define void @_QPs1() {
                  ^
<stdin>:24:2: note: possible intended match here
 call void @_QPs(ptr @x_, ptr getelementptr inbounds nuw (i8, ptr @x_, i64 4))
 ^
/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/flang/test/Lower/common-block.f90:34:11: error: CHECK: expected string not found in input
 ! CHECK: call void @_QPs(ptr @y_, ptr getelementptr (i8, ptr @y_, i64 4))
          ^
<stdin>:28:19: note: scanning from here
define void @_QPs2() {
                  ^
<stdin>:29:2: note: possible intended match here
 call void @_QPs(ptr @y_, ptr getelementptr inbounds nuw (i8, ptr @y_, i64 4))
 ^
/home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/flang/test/Lower/common-block.f90:61:11: error: CHECK: expected string not found in input
 ! CHECK: load i32, ptr getelementptr (i8, ptr @c_in_mod_, i64 4)
          ^
<stdin>:39:31: note: scanning from here
 %2 = load i32, ptr @c_in_mod_, align 4, !tbaa !2
                              ^
<stdin>:43:21: note: possible intended match here
 %6 = load i32, ptr getelementptr inbounds nuw (i8, ptr @c_in_mod_, i64 4), align 4, !tbaa !2
                    ^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/clang-aarch64-sve-vla/llvm/flang/test/Lower/common-block.f90

-dump-input=help explains the following input dump.
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 13, 2025

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve-vls running on linaro-g3-03 while building flang,mlir at step 7 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/143/builds/5420

Here is the relevant piece of the build log for the reference
Step 7 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'Flang :: Lower/real-descriptors.f90' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: bbc /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/flang/test/Lower/real-descriptors.f90 -o - | tco | /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/flang/test/Lower/real-descriptors.f90 --check-prefixes=CHECK,CHECK-KIND16
+ bbc /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/flang/test/Lower/real-descriptors.f90 -o -
+ tco
+ /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/flang/test/Lower/real-descriptors.f90 --check-prefixes=CHECK,CHECK-KIND16
/home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/flang/test/Lower/real-descriptors.f90:81:18: error: CHECK-KIND16: expected string not found in input
 ! CHECK-KIND16: insertvalue { ptr, i64, i32, i8, i8, i8, i8 } { ptr undef, i64 ptrtoint (ptr getelementptr (fp128, ptr null, i32 1) to i64), i32 {{[0-9]*}}, i8 0, i8 31, i8 0, i8 0 }, ptr %{{[0-9]*}}, 0
                 ^
<stdin>:137:28: note: scanning from here
define void @_QPtest_kind16(ptr captures(none) %0, ptr captures(none) %1) {
                           ^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/clang-aarch64-sve-vls/llvm/flang/test/Lower/real-descriptors.f90

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          .
          .
          .
        132:  %17 = call i1 @_FortranAioOutputComplex32(ptr %13, float %15, float %16) 
        133:  %18 = call i32 @_FortranAioEndIoStatement(ptr %13) 
        134:  ret void 
        135: } 
        136:  
        137: define void @_QPtest_kind16(ptr captures(none) %0, ptr captures(none) %1) { 
check:81                                X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
        138:  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        139:  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        140:  %5 = call ptr @_FortranAioBeginInternalListInput(ptr @_QFtest_kind16Ein, i64 10, ptr null, i64 0, ptr @_QQclX1390071b7d49df10c4e30d65e2ac7327, i32 80) 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        141:  %6 = insertvalue { ptr, i64, i32, i8, i8, i8, i8 } { ptr undef, i64 16, i32 20240719, i8 0, i8 31, i8 0, i8 0 }, ptr %0, 0 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        142:  store { ptr, i64, i32, i8, i8, i8, i8 } %6, ptr %4, align 8, !tbaa !24 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
          .
>>>>>>

--

...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Feb 13, 2025

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve2-vla-2stage running on linaro-g4-01 while building flang,mlir at step 12 "ninja check 2".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/199/builds/1597

Here is the relevant piece of the build log for the reference
Step 12 (ninja check 2) failure: stage 2 checked (failure)
******************** TEST 'Flang :: Lower/real-descriptors.f90' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: bbc /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/flang/test/Lower/real-descriptors.f90 -o - | tco | /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/flang/test/Lower/real-descriptors.f90 --check-prefixes=CHECK,CHECK-KIND16
+ bbc /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/flang/test/Lower/real-descriptors.f90 -o -
+ tco
+ /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/flang/test/Lower/real-descriptors.f90 --check-prefixes=CHECK,CHECK-KIND16
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/flang/test/Lower/real-descriptors.f90:81:18: error: CHECK-KIND16: expected string not found in input
 ! CHECK-KIND16: insertvalue { ptr, i64, i32, i8, i8, i8, i8 } { ptr undef, i64 ptrtoint (ptr getelementptr (fp128, ptr null, i32 1) to i64), i32 {{[0-9]*}}, i8 0, i8 31, i8 0, i8 0 }, ptr %{{[0-9]*}}, 0
                 ^
<stdin>:137:28: note: scanning from here
define void @_QPtest_kind16(ptr captures(none) %0, ptr captures(none) %1) {
                           ^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/flang/test/Lower/real-descriptors.f90

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          .
          .
          .
        132:  %17 = call i1 @_FortranAioOutputComplex32(ptr %13, float %15, float %16) 
        133:  %18 = call i32 @_FortranAioEndIoStatement(ptr %13) 
        134:  ret void 
        135: } 
        136:  
        137: define void @_QPtest_kind16(ptr captures(none) %0, ptr captures(none) %1) { 
check:81                                X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
        138:  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        139:  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        140:  %5 = call ptr @_FortranAioBeginInternalListInput(ptr @_QFtest_kind16Ein, i64 10, ptr null, i64 0, ptr @_QQclXa1a1bdd1dace1333ec03ec40bbee311b, i32 80) 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        141:  %6 = insertvalue { ptr, i64, i32, i8, i8, i8, i8 } { ptr undef, i64 16, i32 20240719, i8 0, i8 31, i8 0, i8 0 }, ptr %0, 0 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        142:  store { ptr, i64, i32, i8, i8, i8, i8 } %6, ptr %4, align 8, !tbaa !24 
check:81     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
          .
>>>>>>

--

...

nikic added a commit that referenced this pull request Feb 13, 2025
Fix an issue introduced in #126929: The LLVM module is moved into
the ModuleTranslator, so query the DataLayout from there.
flovent pushed a commit to flovent/llvm-project that referenced this pull request Feb 13, 2025
This is a followup to llvm#126745,
generalizing it to always use TargetFolder, including inside function
bodies.

This avoids generating non-canonical constant expressions that can be
folded away.
flovent pushed a commit to flovent/llvm-project that referenced this pull request Feb 13, 2025
Update test that require flang-supports-f128-math after llvm#126929.
flovent pushed a commit to flovent/llvm-project that referenced this pull request Feb 13, 2025
Fix an issue introduced in llvm#126929: The LLVM module is moved into
the ModuleTranslator, so query the DataLayout from there.
joaosaffran pushed a commit to joaosaffran/llvm-project that referenced this pull request Feb 14, 2025
This is a followup to llvm#126745,
generalizing it to always use TargetFolder, including inside function
bodies.

This avoids generating non-canonical constant expressions that can be
folded away.
joaosaffran pushed a commit to joaosaffran/llvm-project that referenced this pull request Feb 14, 2025
Update test that require flang-supports-f128-math after llvm#126929.
joaosaffran pushed a commit to joaosaffran/llvm-project that referenced this pull request Feb 14, 2025
Fix an issue introduced in llvm#126929: The LLVM module is moved into
the ModuleTranslator, so query the DataLayout from there.
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 2025
This is a followup to llvm#126745,
generalizing it to always use TargetFolder, including inside function
bodies.

This avoids generating non-canonical constant expressions that can be
folded away.
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 2025
Update test that require flang-supports-f128-math after llvm#126929.
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 2025
Fix an issue introduced in llvm#126929: The LLVM module is moved into
the ModuleTranslator, so query the DataLayout from there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:fir-hlfir flang:openmp flang Flang issues not falling into any other category mlir:llvm mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants