; RUN: opt -mem2reg -instcombine %s -o - -S | FileCheck %s ; ; Test that a dbg.declare describing am alloca with volatile ; load/stores is not lowered into a dbg.value, since the alloca won't ; be elided anyway. ; ; Generated from: ; ; unsigned long long g(); ; void h(unsigned long long); ; void f() { ; volatile unsigned long long v = g(); ; if (v == 0) ; g(); ; h(v); ; } ; CHECK: alloca i64 ; CHECK-NOT: call void @llvm.dbg.value ; CHECK: call void @llvm.dbg.declare ; CHECK-NOT: call void @llvm.dbg.value source_filename = "volatile.c" ; Function Attrs: nounwind optsize ssp uwtable define void @f() local_unnamed_addr #0 !dbg !8 { %1 = alloca i64, align 8 %2 = bitcast i64* %1 to i8*, !dbg !15 call void @llvm.lifetime.start.p0i8(i64 8, i8* %2), !dbg !15 call void @llvm.dbg.declare(metadata i64* %1, metadata !12, metadata !DIExpression()), !dbg !15 %3 = call i64 (...) @g() #4, !dbg !15 store volatile i64 %3, i64* %1, align 8, !dbg !15 %4 = load volatile i64, i64* %1, align 8, !dbg !15 %5 = icmp eq i64 %4, 0, !dbg !15 br i1 %5, label %6, label %8, !dbg !15 ;