[llvm] 982695c - [SystemZ] Create brcl 0, 0 instead of brcl 0, 3 in EmitNop for 6 bytes.
Jonas Paulsson via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 2 13:22:46 PST 2020
Author: Jonas Paulsson
Date: 2020-01-02T13:21:04-08:00
New Revision: 982695c0693fe576fb9daa34ecbf81808efdaa2f
URL: https://github.com/llvm/llvm-project/commit/982695c0693fe576fb9daa34ecbf81808efdaa2f
DIFF: https://github.com/llvm/llvm-project/commit/982695c0693fe576fb9daa34ecbf81808efdaa2f.diff
LOG: [SystemZ] Create brcl 0,0 instead of brcl 0,3 in EmitNop for 6 bytes.
For consistency with GCC, the target label is moved to the brcl itself
instead of the next instruction.
Review: Ulrich Weigand
Added:
Modified:
llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
llvm/test/CodeGen/SystemZ/mrecord-mcount-01.ll
llvm/test/CodeGen/SystemZ/stackmap-nops.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp b/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
index 45a8a878305c..f3c038446ed6 100644
--- a/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
@@ -545,9 +545,9 @@ static unsigned EmitNop(MCContext &OutContext, MCStreamer &OutStreamer,
else {
MCSymbol *DotSym = OutContext.createTempSymbol();
const MCSymbolRefExpr *Dot = MCSymbolRefExpr::create(DotSym, OutContext);
+ OutStreamer.EmitLabel(DotSym);
OutStreamer.EmitInstruction(MCInstBuilder(SystemZ::BRCLAsm)
.addImm(0).addExpr(Dot), STI);
- OutStreamer.EmitLabel(DotSym);
return 6;
}
}
diff --git a/llvm/test/CodeGen/SystemZ/mrecord-mcount-01.ll b/llvm/test/CodeGen/SystemZ/mrecord-mcount-01.ll
index f4f17fd31def..20dd387fbd01 100644
--- a/llvm/test/CodeGen/SystemZ/mrecord-mcount-01.ll
+++ b/llvm/test/CodeGen/SystemZ/mrecord-mcount-01.ll
@@ -23,8 +23,8 @@ entry:
; CHECK: .quad .Ltmp1
; CHECK: .text
; CHECK: .Ltmp1:
-; CHECK: brcl 0, .Ltmp2
; CHECK: .Ltmp2:
+; CHECK: brcl 0, .Ltmp2
; CHECK: br %r14
}
diff --git a/llvm/test/CodeGen/SystemZ/stackmap-nops.ll b/llvm/test/CodeGen/SystemZ/stackmap-nops.ll
index 066d7f613241..f92248e22074 100644
--- a/llvm/test/CodeGen/SystemZ/stackmap-nops.ll
+++ b/llvm/test/CodeGen/SystemZ/stackmap-nops.ll
@@ -11,108 +11,121 @@ entry:
; CHECK: bc 0, 0
; 6
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
+; CHECK: .Ltmp
+; CHECK-NEXT: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
; 8
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
+; CHECK: .Ltmp
+; CHECK-NEXT: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
; CHECK: bcr 0, %r0
; 10
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
+; CHECK: .Ltmp
+; CHECK-NEXT: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
; CHECK: bc 0, 0
; 12
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
+; CHECK: .Ltmp
+; CHECK-NEXT: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
; 14
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
+; CHECK: .Ltmp
+; CHECK-NEXT: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
; CHECK: bcr 0, %r0
; 16
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
+; CHECK: .Ltmp
+; CHECK-NEXT: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
; CHECK: bc 0, 0
; 18
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
+; CHECK: .Ltmp
+; CHECK-NEXT: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
; 20
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
+; CHECK: .Ltmp
+; CHECK-NEXT: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
; CHECK: bcr 0, %r0
; 22
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
+; CHECK: .Ltmp
+; CHECK-NEXT: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
; CHECK: bc 0, 0
; 24
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
+; CHECK: .Ltmp
+; CHECK-NEXT: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
; 26
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
+; CHECK: .Ltmp
+; CHECK-NEXT: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
; CHECK: bcr 0, %r0
; 28
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
+; CHECK: .Ltmp
+; CHECK-NEXT: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
; CHECK: bc 0, 0
; 30
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
-; CHECK: brcl 0, [[LAB:.Ltmp[0-9]+]]
-; CHECK-NEXT: [[LAB]]:
+; CHECK: .Ltmp
+; CHECK-NEXT: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
+; CHECK: [[LAB:.Ltmp[0-9]+]]:
+; CHECK-NEXT: brcl 0, [[LAB]]
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 0, i32 0)
tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 2, i32 2)
More information about the llvm-commits
mailing list