================ @@ -0,0 +1,74 @@ +;; Test RISC-V 64 bit: +; RUN: llc -emit-call-site-info -stop-after=livedebugvalues -mtriple=riscv64-linux-gnu -o - %s | FileCheck %s --check-prefix=CHECK64 +; RUN: llc -force-instr-ref-livedebugvalues=1 -emit-call-site-info -stop-after=livedebugvalues -mtriple=riscv64-linux-gnu -o - %s | FileCheck %s --check-prefix=CHECK64 + +;; Built from source: +;; extern long fn1(long,long,long); +;; long fn2(long a, long b, long c) { +;; long local = fn1(a+b, c, b+10); +;; if (local > 10) +;; return local + 10; +;; return b; +;; } +;; Using command: +;; clang -g -O2 -target riscv64-linux-gnu m.c -c -S -emit-llvm +;; Confirm that info from callSites attribute is used as entry_value in DIExpression. + +;; Test riscv64: +; CHECK64: renamable $x10 = nsw ADD $x11, killed renamable $x10 +; CHECK64-NEXT: DBG_VALUE $x10, $noreg, !{{.*}}, !DIExpression(DW_OP_LLVM_entry_value, 1) + +; ModuleID = 'm.c' +source_filename = "m.c" +target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128" +target triple = "riscv64-unknown-linux-gnu" + +; Function Attrs: nounwind uwtable +define dso_local i64 @fn2(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #0 !dbg !14 { +entry: + #dbg_value(i64 %a, !19, !DIExpression(), !23) + #dbg_value(i64 %b, !20, !DIExpression(), !23) + #dbg_value(i64 %c, !21, !DIExpression(), !23) + %add = add nsw i64 %b, %a, !dbg !24 + %add1 = add nsw i64 %b, 10, !dbg !25 + %call = tail call i64 @fn1(i64 noundef %add, i64 noundef %c, i64 noundef %add1) #2, !dbg !26 + #dbg_value(i64 %call, !22, !DIExpression(), !23) + %cmp = icmp sgt i64 %call, 10, !dbg !27 + %add2 = add nuw nsw i64 %call, 10, !dbg !27 + %retval.0 = select i1 %cmp, i64 %add2, i64 %b, !dbg !27 + ret i64 %retval.0, !dbg !29 +} + +declare !dbg !30 i64 @fn1(i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1 + +attributes #0 = { nounwind uwtable "target-cpu"="generic-rv64" "target-features"="+64bit,+c,+m,+relax,+zicsr,+zmmul" } +attributes #1 = { "target-cpu"="generic-rv64" "target-features"="+64bit,+c,+m,+relax,+zicsr,+zmmul" } +attributes #2 = { nounwind } ---------------- sga-sc wrote:
I agree with you, addressed https://github.com/llvm/llvm-project/pull/157703 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits