[PATCH] D93685: [MIRPrinter] Fix incorrect output of unnamed stack names
Mikael Holmén via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 28 09:02:22 PST 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb9a7c89d4322: [MIRPrinter] Fix incorrect output of unnamed stack names (authored by ehjogab, committed by uabelho).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93685/new/
https://reviews.llvm.org/D93685
Files:
llvm/lib/CodeGen/MIRPrinter.cpp
llvm/test/CodeGen/MIR/AArch64/unnamed-stack.ll
llvm/test/CodeGen/PowerPC/alloca-crspill.ll
Index: llvm/test/CodeGen/PowerPC/alloca-crspill.ll
===================================================================
--- llvm/test/CodeGen/PowerPC/alloca-crspill.ll
+++ llvm/test/CodeGen/PowerPC/alloca-crspill.ll
@@ -49,8 +49,8 @@
; CHECK64-NEXT: debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
; CHECK64-NEXT: stack:
-; CHECK64-NEXT: - { id: 0, name: '<unnamed alloca>', type: variable-sized, offset: -8,
-; CHECK64-NEXT: alignment: 1, stack-id: default, callee-saved-register: '', callee-saved-restored: true,
+; CHECK64-NEXT: - { id: 0, name: '', type: variable-sized, offset: -8, alignment: 1,
+; CHECK64-NEXT: stack-id: default, callee-saved-register: '', callee-saved-restored: true,
; CHECK64-NEXT: local-offset: 0, debug-info-variable: '', debug-info-expression: '',
; CHECK64-NEXT: debug-info-location: '' }
; CHECK64-NEXT: - { id: 1, name: '', type: default, offset: -16, size: 8, alignment: 8,
@@ -68,8 +68,8 @@
; CHECK32-NEXT: debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
; CHECK32-NEXT: stack:
-; CHECK32-NEXT: - { id: 0, name: '<unnamed alloca>', type: variable-sized, offset: -4,
-; CHECK32-NEXT: alignment: 1, stack-id: default, callee-saved-register: '', callee-saved-restored: true,
+; CHECK32-NEXT: - { id: 0, name: '', type: variable-sized, offset: -4, alignment: 1,
+; CHECK32-NEXT: stack-id: default, callee-saved-register: '', callee-saved-restored: true,
; CHECK32-NEXT: local-offset: 0, debug-info-variable: '', debug-info-expression: '',
; CHECK32-NEXT: debug-info-location: '' }
; CHECK32-NEXT: - { id: 1, name: '', type: default, offset: -8, size: 4, alignment: 4,
Index: llvm/test/CodeGen/MIR/AArch64/unnamed-stack.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/MIR/AArch64/unnamed-stack.ll
@@ -0,0 +1,23 @@
+; RUN: llc -O0 -march aarch64 -global-isel -stop-after=irtranslator -o - %s | llc -x mir -march aarch64 -run-pass=none -o - | FileCheck %s
+
+define i16 @unnamed_stack() {
+entry:
+ ; CHECK-NAME: unnamed_stack
+ ; CHECK: stack:
+ ; CHECK-NEXT: - { id: 0, name: '',
+ ; CHECK: %0:_(p0) = G_FRAME_INDEX %stack.0
+ %0 = alloca i16
+ %1 = load i16, i16* %0
+ ret i16 %1
+}
+
+define i16 @named_stack() {
+entry:
+ ; CHECK-NAME: named_stack
+ ; CHECK: stack:
+ ; CHECK-NEXT: - { id: 0, name: ptr,
+ ; CHECK: %0:_(p0) = G_FRAME_INDEX %stack.0.ptr
+ %ptr = alloca i16
+ %0 = load i16, i16* %ptr
+ ret i16 %0
+}
Index: llvm/lib/CodeGen/MIRPrinter.cpp
===================================================================
--- llvm/lib/CodeGen/MIRPrinter.cpp
+++ llvm/lib/CodeGen/MIRPrinter.cpp
@@ -415,7 +415,7 @@
YamlObject.ID = ID;
if (const auto *Alloca = MFI.getObjectAllocation(I))
YamlObject.Name.Value = std::string(
- Alloca->hasName() ? Alloca->getName() : "<unnamed alloca>");
+ Alloca->hasName() ? Alloca->getName() : "");
YamlObject.Type = MFI.isSpillSlotObjectIndex(I)
? yaml::MachineStackObject::SpillSlot
: MFI.isVariableSizedObjectIndex(I)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93685.313862.patch
Type: text/x-patch
Size: 3228 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201228/c09ad15c/attachment.bin>
More information about the llvm-commits
mailing list