[llvm] 7f3afd4 - Emit register names in cfi assembly directives
Scott Linder via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 25 11:01:24 PST 2020
Author: Scott Linder
Date: 2020-02-25T14:00:01-05:00
New Revision: 7f3afd480d95e77fb89565455b65b3ebd716aba1
URL: https://github.com/llvm/llvm-project/commit/7f3afd480d95e77fb89565455b65b3ebd716aba1
DIFF: https://github.com/llvm/llvm-project/commit/7f3afd480d95e77fb89565455b65b3ebd716aba1.diff
LOG: Emit register names in cfi assembly directives
Update .cfi_undefined, .cfi_register, and .cfi_return_column to
print symbolic register arguments.
Differential Revision: https://reviews.llvm.org/D74914
Added:
Modified:
llvm/lib/MC/MCAsmStreamer.cpp
llvm/test/CodeGen/SPARC/2013-05-17-CallFrame.ll
llvm/test/CodeGen/SPARC/exception.ll
llvm/test/CodeGen/SPARC/reserved-regs.ll
llvm/test/CodeGen/SPARC/umulo-128-legalisation-lowering.ll
llvm/test/MC/X86/return-column.s
Removed:
################################################################################
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index b528a6ebac99..92815844e0cb 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/lib/MC/MCAsmStreamer.cpp
@@ -1682,13 +1682,17 @@ void MCAsmStreamer::emitCFISignalFrame() {
void MCAsmStreamer::emitCFIUndefined(int64_t Register) {
MCStreamer::emitCFIUndefined(Register);
- OS << "\t.cfi_undefined " << Register;
+ OS << "\t.cfi_undefined ";
+ EmitRegisterName(Register);
EmitEOL();
}
void MCAsmStreamer::emitCFIRegister(int64_t Register1, int64_t Register2) {
MCStreamer::emitCFIRegister(Register1, Register2);
- OS << "\t.cfi_register " << Register1 << ", " << Register2;
+ OS << "\t.cfi_register ";
+ EmitRegisterName(Register1);
+ OS << ", ";
+ EmitRegisterName(Register2);
EmitEOL();
}
@@ -1706,7 +1710,8 @@ void MCAsmStreamer::emitCFINegateRAState() {
void MCAsmStreamer::emitCFIReturnColumn(int64_t Register) {
MCStreamer::emitCFIReturnColumn(Register);
- OS << "\t.cfi_return_column " << Register;
+ OS << "\t.cfi_return_column ";
+ EmitRegisterName(Register);
EmitEOL();
}
diff --git a/llvm/test/CodeGen/SPARC/2013-05-17-CallFrame.ll b/llvm/test/CodeGen/SPARC/2013-05-17-CallFrame.ll
index 274e99b114c3..8d6e9ca0a1b5 100644
--- a/llvm/test/CodeGen/SPARC/2013-05-17-CallFrame.ll
+++ b/llvm/test/CodeGen/SPARC/2013-05-17-CallFrame.ll
@@ -12,7 +12,7 @@ define void @variable_alloca_with_adj_call_stack(i32 %num) {
; V8-NEXT: save %sp, -96, %sp
; V8-NEXT: .cfi_def_cfa_register %fp
; V8-NEXT: .cfi_window_save
-; V8-NEXT: .cfi_register 15, 31
+; V8-NEXT: .cfi_register %o7, %i7
; V8-NEXT: add %i0, 7, %i0
; V8-NEXT: and %i0, -8, %i0
; V8-NEXT: sub %sp, %i0, %i0
@@ -39,7 +39,7 @@ define void @variable_alloca_with_adj_call_stack(i32 %num) {
; SPARC64-NEXT: save %sp, -128, %sp
; SPARC64-NEXT: .cfi_def_cfa_register %fp
; SPARC64-NEXT: .cfi_window_save
-; SPARC64-NEXT: .cfi_register 15, 31
+; SPARC64-NEXT: .cfi_register %o7, %i7
; SPARC64-NEXT: srl %i0, 0, %i0
; SPARC64-NEXT: add %i0, 15, %i0
; SPARC64-NEXT: sethi 4194303, %i1
diff --git a/llvm/test/CodeGen/SPARC/exception.ll b/llvm/test/CodeGen/SPARC/exception.ll
index 42a9c1fdd8b5..3783cbdf4b14 100644
--- a/llvm/test/CodeGen/SPARC/exception.ll
+++ b/llvm/test/CodeGen/SPARC/exception.ll
@@ -18,7 +18,7 @@
; V8ABS: .cfi_lsda 0,
; V8ABS: .cfi_def_cfa_register {{30|%fp}}
; V8ABS: .cfi_window_save
-; V8ABS: .cfi_register 15, 31
+; V8ABS: .cfi_register %o7, %i7
; V8ABS: call __cxa_throw
; V8ABS: call __cxa_throw
@@ -37,7 +37,7 @@
; V8PIC: .cfi_lsda 27,
; V8PIC: .cfi_def_cfa_register {{30|%fp}}
; V8PIC: .cfi_window_save
-; V8PIC: .cfi_register 15, 31
+; V8PIC: .cfi_register %o7, %i7
; V8PIC: .section .gcc_except_table
; V8PIC-NOT: .section
; V8PIC: .word %r_disp32(.L_ZTIi.DW.stub)
@@ -52,7 +52,7 @@
; V9ABS: .cfi_lsda 27,
; V9ABS: .cfi_def_cfa_register {{30|%fp}}
; V9ABS: .cfi_window_save
-; V9ABS: .cfi_register 15, 31
+; V9ABS: .cfi_register %o7, %i7
; V9ABS: .section .gcc_except_table
; V9ABS-NOT: .section
; V9ABS: .xword _ZTIi
@@ -63,7 +63,7 @@
; V9PIC: .cfi_lsda 27,
; V9PIC: .cfi_def_cfa_register {{30|%fp}}
; V9PIC: .cfi_window_save
-; V9PIC: .cfi_register 15, 31
+; V9PIC: .cfi_register %o7, %i7
; V9PIC: .section .gcc_except_table
; V9PIC-NOT: .section
; V9PIC: .word %r_disp32(.L_ZTIi.DW.stub)
diff --git a/llvm/test/CodeGen/SPARC/reserved-regs.ll b/llvm/test/CodeGen/SPARC/reserved-regs.ll
index c5a124f538f9..ec6290586eee 100644
--- a/llvm/test/CodeGen/SPARC/reserved-regs.ll
+++ b/llvm/test/CodeGen/SPARC/reserved-regs.ll
@@ -7,6 +7,7 @@
; CHECK-LABEL: use_all_i32_regs:
; CHECK: save %sp
+; CHECK: .cfi_register %o7, %i7
; CHECK-NOT: %g0
; CHECK-NOT: %g1
; CHECK-NOT: %g5
@@ -88,6 +89,7 @@ entry:
; CHECK-LABEL: use_all_i64_regs:
; CHECK: save %sp
+; CHECK: .cfi_register %o7, %i7
; CHECK-NOT: %g0
; CHECK-NOT: %g1
; CHECK-NOT: %g4
diff --git a/llvm/test/CodeGen/SPARC/umulo-128-legalisation-lowering.ll b/llvm/test/CodeGen/SPARC/umulo-128-legalisation-lowering.ll
index c1577ae452d7..66fcc4564f3c 100644
--- a/llvm/test/CodeGen/SPARC/umulo-128-legalisation-lowering.ll
+++ b/llvm/test/CodeGen/SPARC/umulo-128-legalisation-lowering.ll
@@ -9,7 +9,7 @@ define { i128, i8 } @muloti_test(i128 %l, i128 %r) unnamed_addr #0 {
; SPARC-NEXT: save %sp, -128, %sp
; SPARC-NEXT: .cfi_def_cfa_register %fp
; SPARC-NEXT: .cfi_window_save
-; SPARC-NEXT: .cfi_register 15, 31
+; SPARC-NEXT: .cfi_register %o7, %i7
; SPARC-NEXT: ld [%fp+92], %l3
; SPARC-NEXT: ld [%fp+96], %g2
; SPARC-NEXT: umul %i2, %i5, %g3
@@ -195,7 +195,7 @@ define { i128, i8 } @muloti_test(i128 %l, i128 %r) unnamed_addr #0 {
; SPARC64-NEXT: save %sp, -176, %sp
; SPARC64-NEXT: .cfi_def_cfa_register %fp
; SPARC64-NEXT: .cfi_window_save
-; SPARC64-NEXT: .cfi_register 15, 31
+; SPARC64-NEXT: .cfi_register %o7, %i7
; SPARC64-NEXT: srax %i2, 63, %o0
; SPARC64-NEXT: srax %i1, 63, %o2
; SPARC64-NEXT: mov %i2, %o1
diff --git a/llvm/test/MC/X86/return-column.s b/llvm/test/MC/X86/return-column.s
index eec886ac64f7..37c51343a9f9 100644
--- a/llvm/test/MC/X86/return-column.s
+++ b/llvm/test/MC/X86/return-column.s
@@ -30,7 +30,7 @@ h:
// CHECK-ASM-ROUNDTRIP-LABEL: f:
// CHECK-ASM-ROUNDTRIP: .cfi_startproc
-// CHECK-ASM-ROUNDTRIP-NEXT: .cfi_return_column 0
+// CHECK-ASM-ROUNDTRIP-NEXT: .cfi_return_column %eax
// CHECK-ASM-ROUNDTRIP: .cfi_endproc
// CHECK-EH_FRAME: 00000000 00000014 00000000 CIE
More information about the llvm-commits
mailing list