[llvm] [IPSCCP] Variable not visible at Og. (PR #66745)
Carlos Alberto Enciso via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 12 08:58:47 PDT 2023
================
@@ -0,0 +1,184 @@
+; RUN: opt -passes=ipsccp -S -o - < %s | FileCheck %s
+
+; Global variables g_11, g_22, g_33, g_44, g_55, g_66 and g_77
+; are not visible in the debugger.
+
+; 1 int g_1 = -4;
+; 2 float g_2 = 4.44;
+; 3 char g_3 = 'a';
+; 4 unsigned g_4 = 4;
+; 5 bool g_5 = true;
+; 6 int *g_6 = nullptr;
+; 7 float *g_7 = nullptr;
+; 8
+; 9 static int g_11 = -5;
+; 10 static float g_22 = 5.55;
+; 11 static char g_33 = 'b';
+; 12 static unsigned g_44 = 5;
+; 13 static bool g_55 = true;
+; 14 static int *g_66 = nullptr;
+; 15 static float *g_77 = (float *)(55 + 15);
+; 16
+; 17 void bar() {
+; 18 g_1 = g_11;
+; 19 g_2 = g_22;
+; 20 g_3 = g_33;
+; 21 g_4 = g_44;
+; 22 g_5 = g_55;
+; 23 g_6 = g_66;
+; 24 g_7 = g_77;
+; 25 }
+; 26
+; 27 int main() {
+; 28 {
+; 29 bar();
+; 30 }
+; 31 }
+
+; CHECK: ![[G1:[0-9]+]] = !DIGlobalVariableExpression(var: ![[DBG1:[0-9]+]], expr: !DIExpression(DW_OP_constu, 18446744073709551611, DW_OP_stack_value))
+; CHECK-DAG: ![[DBG1]] = distinct !DIGlobalVariable(name: "g_11", {{.*}}
+; CHECK: ![[G2:[0-9]+]] = !DIGlobalVariableExpression(var: ![[DBG2:[0-9]+]], expr: !DIExpression(DW_OP_constu, 1085381018, DW_OP_stack_value))
+; CHECK-DAG: ![[DBG2]] = distinct !DIGlobalVariable(name: "g_22", {{.*}}
+; CHECK: ![[G3:[0-9]+]] = !DIGlobalVariableExpression(var: ![[DBG3:[0-9]+]], expr: !DIExpression(DW_OP_constu, 98, DW_OP_stack_value))
+; CHECK-DAG: ![[DBG3]] = distinct !DIGlobalVariable(name: "g_33", {{.*}}
+; CHECK: ![[G4:[0-9]+]] = !DIGlobalVariableExpression(var: ![[DBG4:[0-9]+]], expr: !DIExpression(DW_OP_constu, 5, DW_OP_stack_value))
+; CHECK-DAG: ![[DBG4]] = distinct !DIGlobalVariable(name: "g_44", {{.*}}
+; CHECK: ![[G5:[0-9]+]] = !DIGlobalVariableExpression(var: ![[DBG5:[0-9]+]], expr: !DIExpression(DW_OP_constu, 1, DW_OP_stack_value))
+; CHECK-DAG: ![[DBG5]] = distinct !DIGlobalVariable(name: "g_55", {{.*}}
+; CHECK: ![[G6:[0-9]+]] = !DIGlobalVariableExpression(var: ![[DBG6:[0-9]+]], expr: !DIExpression(DW_OP_constu, 0, DW_OP_stack_value))
+; CHECK-DAG: ![[DBG6]] = distinct !DIGlobalVariable(name: "g_66", {{.*}}
+; CHECK: ![[G7:[0-9]+]] = !DIGlobalVariableExpression(var: ![[DBG7:[0-9]+]], expr: !DIExpression(DW_OP_constu, 70, DW_OP_stack_value))
+; CHECK-DAG: ![[DBG7]] = distinct !DIGlobalVariable(name: "g_77", {{.*}}
+
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-pc-linux-gnu"
+
+ at g_1 = dso_local global i32 -4, align 4, !dbg !0
+ at g_2 = dso_local global float 0x4011C28F60000000, align 4, !dbg !8
+ at g_3 = dso_local global i8 97, align 1, !dbg !10
+ at g_4 = dso_local global i32 4, align 4, !dbg !13
+ at g_5 = dso_local global i8 1, align 1, !dbg !16
+ at g_6 = dso_local global ptr null, align 8, !dbg !19
+ at g_7 = dso_local global ptr null, align 8, !dbg !23
+ at _ZL4g_11 = internal global i32 -5, align 4, !dbg !25
+ at _ZL4g_22 = internal global float 0x4016333340000000, align 4, !dbg !27
+ at _ZL4g_33 = internal global i8 98, align 1, !dbg !29
+ at _ZL4g_44 = internal global i32 5, align 4, !dbg !31
+ at _ZL4g_55 = internal global i8 1, align 1, !dbg !33
+ at _ZL4g_66 = internal global ptr null, align 8, !dbg !35
+ at _ZL4g_77 = internal global ptr inttoptr (i64 70 to ptr), align 8, !dbg !37
+
+define dso_local void @_Z3barv() !dbg !46 {
+entry:
+ %0 = load i32, ptr @_ZL4g_11, align 4, !dbg !49, !tbaa !50
+ store i32 %0, ptr @g_1, align 4, !dbg !54, !tbaa !50
+ %1 = load float, ptr @_ZL4g_22, align 4, !dbg !55, !tbaa !56
+ store float %1, ptr @g_2, align 4, !dbg !58, !tbaa !56
+ %2 = load i8, ptr @_ZL4g_33, align 1, !dbg !59, !tbaa !60
+ store i8 %2, ptr @g_3, align 1, !dbg !61, !tbaa !60
+ %3 = load i32, ptr @_ZL4g_44, align 4, !dbg !62, !tbaa !50
+ store i32 %3, ptr @g_4, align 4, !dbg !63, !tbaa !50
+ %4 = load i8, ptr @_ZL4g_55, align 1, !dbg !64, !tbaa !65, !range !67, !noundef !68
+ %tobool = trunc i8 %4 to i1, !dbg !64
+ %frombool = zext i1 %tobool to i8, !dbg !69
+ store i8 %frombool, ptr @g_5, align 1, !dbg !69, !tbaa !65
+ %5 = load ptr, ptr @_ZL4g_66, align 8, !dbg !70, !tbaa !71
+ store ptr %5, ptr @g_6, align 8, !dbg !73, !tbaa !71
+ %6 = load ptr, ptr @_ZL4g_77, align 8, !dbg !74, !tbaa !71
+ store ptr %6, ptr @g_7, align 8, !dbg !75, !tbaa !71
+ ret void, !dbg !76
+}
----------------
CarlosAlbertoEnciso wrote:
Removed all the `!tbaa` metadata.
https://github.com/llvm/llvm-project/pull/66745
More information about the llvm-commits
mailing list