[llvm] 6b0e2fa - [SelectionDAG] make INLINEASM_BR use MachineBasicBlocks instead of BlockAddresses
Nick Desaulniers via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 17 09:34:43 PDT 2022
Author: Nick Desaulniers
Date: 2022-08-17T09:34:31-07:00
New Revision: 6b0e2fa6f0b1045ed616e263c75ee59768e9f7f8
URL: https://github.com/llvm/llvm-project/commit/6b0e2fa6f0b1045ed616e263c75ee59768e9f7f8
DIFF: https://github.com/llvm/llvm-project/commit/6b0e2fa6f0b1045ed616e263c75ee59768e9f7f8.diff
LOG: [SelectionDAG] make INLINEASM_BR use MachineBasicBlocks instead of BlockAddresses
As part of re-architecting callbr to no longer use blockaddresses
(https://reviews.llvm.org/D129288), we don't really need them in MIR.
They make comparing MachineBasicBlocks of indirect targets during
MachineVerifier a PITA.
Suggested by @efriedma from the discussion:
https://reviews.llvm.org/D130290#3669531
Reviewed By: efriedma, void
Differential Revision: https://reviews.llvm.org/D130316
Added:
Modified:
llvm/include/llvm/IR/Instructions.h
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/lib/IR/Instructions.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/AArch64/callbr-asm-label.ll
llvm/test/CodeGen/PowerPC/ppc64-inlineasm-clobber.ll
llvm/test/CodeGen/X86/callbr-asm-bb-exports.ll
llvm/test/CodeGen/X86/callbr-asm-blockplacement.ll
llvm/test/CodeGen/X86/callbr-asm-branch-folding.ll
llvm/test/CodeGen/X86/callbr-asm-destinations.ll
llvm/test/CodeGen/X86/callbr-asm-instr-scheduling.ll
llvm/test/CodeGen/X86/callbr-asm-label-addr.ll
llvm/test/CodeGen/X86/callbr-asm-outputs-pred-succ.ll
llvm/test/CodeGen/X86/callbr-asm-outputs.ll
llvm/test/CodeGen/X86/callbr-asm-phi-placement.ll
llvm/test/CodeGen/X86/callbr-asm-sink.ll
llvm/test/CodeGen/X86/callbr-asm.ll
llvm/test/CodeGen/X86/inline-asm-pic.ll
llvm/test/CodeGen/X86/shrinkwrap-callbr.ll
llvm/test/CodeGen/X86/tail-dup-asm-goto.ll
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/Instructions.h b/llvm/include/llvm/IR/Instructions.h
index 480a559e22269..056016d1ea44b 100644
--- a/llvm/include/llvm/IR/Instructions.h
+++ b/llvm/include/llvm/IR/Instructions.h
@@ -4171,8 +4171,6 @@ class CallBrInst : public CallBase {
unsigned getNumSuccessors() const { return getNumIndirectDests() + 1; }
- BlockAddress *getBlockAddressForIndirectDest(unsigned DestNo) const;
-
// Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Instruction *I) {
return (I->getOpcode() == Instruction::CallBr);
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 61849b0b816d4..0d203f50e5890 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -3008,6 +3008,7 @@ void SelectionDAGBuilder::visitCallBr(const CallBrInst &I) {
MachineBasicBlock *Target = FuncInfo.MBBMap[Dest];
Target->setIsInlineAsmBrIndirectTarget();
Target->setMachineBlockAddressTaken();
+ Target->setLabelMustBeEmitted();
// Don't add duplicate machine successors.
if (Dests.insert(Dest).second)
addSuccessorWithProb(CallBrMBB, Target, BranchProbability::getZero());
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index a6244cd71720b..77a3578b23196 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -5369,11 +5369,7 @@ TargetLowering::ParseConstraints(const DataLayout &DL,
OpInfo.CallOperandVal = Call.getArgOperand(ArgNo);
break;
case InlineAsm::isLabel:
- OpInfo.CallOperandVal =
- cast<CallBrInst>(&Call)->getBlockAddressForIndirectDest(LabelNo);
- OpInfo.ConstraintVT =
- getAsmOperandValueType(DL, OpInfo.CallOperandVal->getType())
- .getSimpleVT();
+ OpInfo.CallOperandVal = cast<CallBrInst>(&Call)->getIndirectDest(LabelNo);
++LabelNo;
continue;
case InlineAsm::isClobber:
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index a5e0e1bb609f9..43518c436e3e2 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -960,12 +960,6 @@ void CallBrInst::init(FunctionType *FTy, Value *Fn, BasicBlock *Fallthrough,
setName(NameStr);
}
-BlockAddress *
-CallBrInst::getBlockAddressForIndirectDest(unsigned DestNo) const {
- return BlockAddress::get(const_cast<Function *>(getFunction()),
- getIndirectDest(DestNo));
-}
-
CallBrInst::CallBrInst(const CallBrInst &CBI)
: CallBase(CBI.Attrs, CBI.FTy, CBI.getType(), Instruction::CallBr,
OperandTraits<CallBase>::op_end(this) - CBI.getNumOperands(),
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 49832ac0b4941..6f9491ef26831 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -55995,9 +55995,9 @@ void X86TargetLowering::LowerAsmOperandForConstraint(SDValue Op,
// In any sort of PIC mode addresses need to be computed at runtime by
// adding in a register or some sort of table lookup. These can't
- // be used as immediates. BlockAddresses are fine though.
+ // be used as immediates. BlockAddresses and BasicBlocks are fine though.
if ((Subtarget.isPICStyleGOT() || Subtarget.isPICStyleStubPIC()) &&
- !isa<BlockAddressSDNode>(Op))
+ !(isa<BlockAddressSDNode>(Op) || isa<BasicBlockSDNode>(Op)))
return;
// If we are in non-pic codegen mode, we allow the address of a global (with
diff --git a/llvm/test/CodeGen/AArch64/callbr-asm-label.ll b/llvm/test/CodeGen/AArch64/callbr-asm-label.ll
index 3e16d746214d4..7b066a02e0387 100644
--- a/llvm/test/CodeGen/AArch64/callbr-asm-label.ll
+++ b/llvm/test/CodeGen/AArch64/callbr-asm-label.ll
@@ -5,10 +5,9 @@
define i32 @test1() {
; CHECK-LABEL: test1:
; CHECK: .word b
-; CHECK-NEXT: .word .Ltmp0
+; CHECK-NEXT: .word .LBB0_2
; CHECK: // %bb.1:
-; CHECK: .Ltmp0:
-; CHECK: .LBB0_2: // %indirect
+; CHECK: .LBB0_2: // Block address taken
entry:
callbr void asm sideeffect "1:\0A\09.word b, ${0:l}\0A\09", "!i"()
to label %cleanup [label %indirect]
@@ -31,9 +30,8 @@ entry:
if.then:
; CHECK: .word b
-; CHECK-NEXT: .word .Ltmp2
-; CHECK: .Ltmp2:
-; CHECK-NEXT: .LBB1_3: // %if.end6
+; CHECK-NEXT: .word .LBB1_3
+; CHECK: .LBB1_3: // Block address taken
callbr void asm sideeffect "1:\0A\09.word b, ${0:l}\0A\09", "!i"()
to label %if.then4 [label %if.end6]
@@ -48,8 +46,7 @@ if.end6:
br i1 %phitmp, label %if.end10, label %if.then9
if.then9:
-; CHECK: .Ltmp4:
-; CHECK-NEXT: .LBB1_5: // %l_yes
+; CHECK: .LBB1_5: // Block address taken
callbr void asm sideeffect "", "!i"()
to label %if.end10 [label %l_yes]
diff --git a/llvm/test/CodeGen/PowerPC/ppc64-inlineasm-clobber.ll b/llvm/test/CodeGen/PowerPC/ppc64-inlineasm-clobber.ll
index fe0fae0dd51db..604a39ec8367e 100644
--- a/llvm/test/CodeGen/PowerPC/ppc64-inlineasm-clobber.ll
+++ b/llvm/test/CodeGen/PowerPC/ppc64-inlineasm-clobber.ll
@@ -87,8 +87,9 @@ define dso_local signext i32 @ClobberLR_BR(i32 signext %in) #0 {
; PPC64LE-NEXT: ld r0, 16(r1)
; PPC64LE-NEXT: mtlr r0
; PPC64LE-NEXT: blr
-; PPC64LE-NEXT: .Ltmp0: # Block address taken
-; PPC64LE-NEXT: .LBB3_2: # %return_early
+; PPC64LE-NEXT: .LBB3_2: # Block address taken
+; PPC64LE-NEXT: # %return_early
+; PPC64LE-NEXT: # Label of block must be emitted
; PPC64LE-NEXT: li r3, 0
; PPC64LE-NEXT: b .LBB3_1
;
@@ -106,8 +107,9 @@ define dso_local signext i32 @ClobberLR_BR(i32 signext %in) #0 {
; PPC64BE-NEXT: ld r0, 16(r1)
; PPC64BE-NEXT: mtlr r0
; PPC64BE-NEXT: blr
-; PPC64BE-NEXT: .Ltmp0: # Block address taken
-; PPC64BE-NEXT: .LBB3_2: # %return_early
+; PPC64BE-NEXT: .LBB3_2: # Block address taken
+; PPC64BE-NEXT: # %return_early
+; PPC64BE-NEXT: # Label of block must be emitted
; PPC64BE-NEXT: li r3, 0
; PPC64BE-NEXT: b .LBB3_1
entry:
@@ -131,8 +133,9 @@ define dso_local signext i32 @ClobberR5_BR(i32 signext %in) #0 {
; PPC64LE-NEXT: # %bb.1: # %return
; PPC64LE-NEXT: extsw r3, r3
; PPC64LE-NEXT: blr
-; PPC64LE-NEXT: .Ltmp1: # Block address taken
-; PPC64LE-NEXT: .LBB4_2: # %return_early
+; PPC64LE-NEXT: .LBB4_2: # Block address taken
+; PPC64LE-NEXT: # %return_early
+; PPC64LE-NEXT: # Label of block must be emitted
; PPC64LE-NEXT: li r3, 0
; PPC64LE-NEXT: extsw r3, r3
; PPC64LE-NEXT: blr
@@ -145,8 +148,9 @@ define dso_local signext i32 @ClobberR5_BR(i32 signext %in) #0 {
; PPC64BE-NEXT: # %bb.1: # %return
; PPC64BE-NEXT: extsw r3, r3
; PPC64BE-NEXT: blr
-; PPC64BE-NEXT: .Ltmp1: # Block address taken
-; PPC64BE-NEXT: .LBB4_2: # %return_early
+; PPC64BE-NEXT: .LBB4_2: # Block address taken
+; PPC64BE-NEXT: # %return_early
+; PPC64BE-NEXT: # Label of block must be emitted
; PPC64BE-NEXT: li r3, 0
; PPC64BE-NEXT: extsw r3, r3
; PPC64BE-NEXT: blr
diff --git a/llvm/test/CodeGen/X86/callbr-asm-bb-exports.ll b/llvm/test/CodeGen/X86/callbr-asm-bb-exports.ll
index 61e712f2024a3..4e8bd2fd37de0 100644
--- a/llvm/test/CodeGen/X86/callbr-asm-bb-exports.ll
+++ b/llvm/test/CodeGen/X86/callbr-asm-bb-exports.ll
@@ -6,7 +6,6 @@
; output from SelectionDAG.
; CHECK: t0: ch = EntryToken
-; CHECK-NEXT: t16: i64 = BlockAddress<@test, %fail> 0
; CHECK-NEXT: t4: i32,ch = CopyFromReg t0, Register:i32 %3
; CHECK-NEXT: t10: i32 = add t4, Constant:i32<1>
; CHECK-NEXT: t12: ch = CopyToReg t0, Register:i32 %0, t10
@@ -17,7 +16,7 @@
; CHECK-NEXT: t2: i32,ch = CopyFromReg t0, Register:i32 %2
; CHECK-NEXT: t8: i32 = add t2, Constant:i32<4>
; CHECK-NEXT: t22: ch,glue = CopyToReg t17, Register:i32 %5, t8
-; CHECK-NEXT: t30: ch,glue = inlineasm_br t22, TargetExternalSymbol:i64'xorl $0, $0; jmp ${1:l}', MDNode:ch<null>, TargetConstant:i64<0>, TargetConstant:i32<2359305>, Register:i32 %5, TargetConstant:i64<13>, TargetBlockAddress:i64<@test, %fail> 0, TargetConstant:i32<12>, Register:i32 $df, TargetConstant:i32<12>, Register:i16 $fpsw, TargetConstant:i32<12>, Register:i32 $eflags, t22:1
+; CHECK-NEXT: t29: ch,glue = inlineasm_br t22, TargetExternalSymbol:i64'xorl $0, $0; jmp ${1:l}', MDNode:ch<null>, TargetConstant:i64<0>, TargetConstant:i32<2359305>, Register:i32 %5, TargetConstant:i64<13>, BasicBlock:ch<fail 0x{{[0-9a-f]+}}>, TargetConstant:i32<12>, Register:i32 $df, TargetConstant:i32<12>, Register:i16 $fpsw, TargetConstant:i32<12>, Register:i32 $eflags, t22:1
define i32 @test(i32 %a, i32 %b, i32 %c) {
entry:
diff --git a/llvm/test/CodeGen/X86/callbr-asm-blockplacement.ll b/llvm/test/CodeGen/X86/callbr-asm-blockplacement.ll
index 41fb8b57ae61c..04604316160df 100644
--- a/llvm/test/CodeGen/X86/callbr-asm-blockplacement.ll
+++ b/llvm/test/CodeGen/X86/callbr-asm-blockplacement.ll
@@ -50,8 +50,9 @@ define i32 @foo(i32 %arg, ptr %arg3) nounwind {
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: # %bb.4: # %bb17
; CHECK-NEXT: callq widget at PLT
-; CHECK-NEXT: .Ltmp0: # Block address taken
-; CHECK-NEXT: .LBB0_5: # %bb18
+; CHECK-NEXT: .LBB0_5: # Block address taken
+; CHECK-NEXT: # %bb18
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: movw $0, 14(%rbx)
; CHECK-NEXT: addq $8, %rsp
; CHECK-NEXT: popq %rbx
diff --git a/llvm/test/CodeGen/X86/callbr-asm-branch-folding.ll b/llvm/test/CodeGen/X86/callbr-asm-branch-folding.ll
index d1b17e4238086..6afde98d1508d 100644
--- a/llvm/test/CodeGen/X86/callbr-asm-branch-folding.ll
+++ b/llvm/test/CodeGen/X86/callbr-asm-branch-folding.ll
@@ -55,8 +55,9 @@ define dso_local void @n(ptr %o, i32 %p, i32 %u) nounwind {
; CHECK-NEXT: #APP
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: jmp .LBB0_9
-; CHECK-NEXT: .Ltmp0: # Block address taken
-; CHECK-NEXT: # %bb.7: # %if.then20.critedge
+; CHECK-NEXT: .LBB0_7: # Block address taken
+; CHECK-NEXT: # %if.then20.critedge
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: movl j(%rip), %edi
; CHECK-NEXT: movslq %eax, %rcx
; CHECK-NEXT: movl $1, %esi
diff --git a/llvm/test/CodeGen/X86/callbr-asm-destinations.ll b/llvm/test/CodeGen/X86/callbr-asm-destinations.ll
index c84847a0cddea..38238d7b254ad 100644
--- a/llvm/test/CodeGen/X86/callbr-asm-destinations.ll
+++ b/llvm/test/CodeGen/X86/callbr-asm-destinations.ll
@@ -8,10 +8,11 @@ define i32 @duplicate_normal_and_indirect_dest(i32 %a) {
; CHECK-NEXT: addl $4, %eax
; CHECK-NEXT: #APP
; CHECK-NEXT: xorl %eax, %eax
-; CHECK-NEXT: jmp .Ltmp0
+; CHECK-NEXT: jmp .LBB0_1
; CHECK-NEXT: #NO_APP
-; CHECK-NEXT: .Ltmp0: # Block address taken
-; CHECK-NEXT: # %bb.1: # %fail
+; CHECK-NEXT: .LBB0_1: # Block address taken
+; CHECK-NEXT: # %fail
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: movl $1, %eax
; CHECK-NEXT: retl
entry:
@@ -29,13 +30,14 @@ define i32 @duplicate_indirect_dest(i32 %a) {
; CHECK-NEXT: addl $4, %eax
; CHECK-NEXT: #APP
; CHECK-NEXT: xorl %eax, %eax
-; CHECK-NEXT: jmp .Ltmp1
-; CHECK-NEXT: jmp .Ltmp1
+; CHECK-NEXT: jmp .LBB1_2
+; CHECK-NEXT: jmp .LBB1_2
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: # %bb.1: # %normal
; CHECK-NEXT: retl
-; CHECK-NEXT: .Ltmp1: # Block address taken
-; CHECK-NEXT: .LBB1_2: # %fail
+; CHECK-NEXT: .LBB1_2: # Block address taken
+; CHECK-NEXT: # %fail
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: movl $1, %eax
; CHECK-NEXT: retl
entry:
diff --git a/llvm/test/CodeGen/X86/callbr-asm-instr-scheduling.ll b/llvm/test/CodeGen/X86/callbr-asm-instr-scheduling.ll
index dea3d04eb74d5..01f3a6fcab1fb 100644
--- a/llvm/test/CodeGen/X86/callbr-asm-instr-scheduling.ll
+++ b/llvm/test/CodeGen/X86/callbr-asm-instr-scheduling.ll
@@ -33,11 +33,11 @@ define i64 @early_ioremap_pmd(i64 %addr) {
; CHECK-NEXT: andl $511, %eax # imm = 0x1FF
; CHECK-NEXT: leaq (%rdx,%rax,8), %rax
; CHECK-NEXT: #APP
+; CHECK-NEXT: .Ltmp0:
+; CHECK-NEXT: jmp .Ltmp1
; CHECK-NEXT: .Ltmp2:
-; CHECK-NEXT: jmp .Ltmp3
-; CHECK-NEXT: .Ltmp4:
-; CHECK-NEXT: .zero (-(((.Ltmp5-.Ltmp6)-(.Ltmp4-.Ltmp2))>0))*((.Ltmp5-.Ltmp6)-(.Ltmp4-.Ltmp2)),144
-; CHECK-NEXT: .Ltmp7:
+; CHECK-NEXT: .zero (-(((.Ltmp3-.Ltmp4)-(.Ltmp2-.Ltmp0))>0))*((.Ltmp3-.Ltmp4)-(.Ltmp2-.Ltmp0)),144
+; CHECK-NEXT: .Ltmp5:
entry:
%0 = tail call i64 asm sideeffect "mov %cr3,$0\0A\09", "=r,=*m,~{dirflag},~{fpsr},~{flags}"(ptr elementtype(i64) nonnull @__force_order)
%and.i = and i64 %0, 9223372036854771712
diff --git a/llvm/test/CodeGen/X86/callbr-asm-label-addr.ll b/llvm/test/CodeGen/X86/callbr-asm-label-addr.ll
index 73d8d7fa446fc..2af038db74bfd 100644
--- a/llvm/test/CodeGen/X86/callbr-asm-label-addr.ll
+++ b/llvm/test/CodeGen/X86/callbr-asm-label-addr.ll
@@ -3,9 +3,10 @@
define i32 @test1(i32 %x) {
; CHECK-LABEL: test1:
; CHECK: .quad .Ltmp0
-; CHECK-NEXT: .quad .Ltmp1
-; CHECK: .Ltmp1:
-; CHECK-NEXT: # %bb.1: # %bar
+; CHECK-NEXT: .quad .LBB0_1
+; CHECK: .LBB0_1: # Block address taken
+; CHECK-NEXT: # %bar
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: callq foo
; CHECK-NEXT: .Ltmp0:
; CHECK-NEXT: # %bb.2: # %baz
diff --git a/llvm/test/CodeGen/X86/callbr-asm-outputs-pred-succ.ll b/llvm/test/CodeGen/X86/callbr-asm-outputs-pred-succ.ll
index 46a1f0534a5b2..363a3739c0d84 100644
--- a/llvm/test/CodeGen/X86/callbr-asm-outputs-pred-succ.ll
+++ b/llvm/test/CodeGen/X86/callbr-asm-outputs-pred-succ.ll
@@ -17,12 +17,12 @@
; Check the second INLINEASM_BR target block is preceded by the block with the
; second INLINEASM_BR.
-; CHECK: bb.2 (%ir-block.7, machine-block-address-taken, ir-block-address-taken %ir-block.7, inlineasm-br-indirect-target):
+; CHECK: bb.2 (%ir-block.7, machine-block-address-taken, inlineasm-br-indirect-target):
; CHECK-NEXT: predecessors: %bb.1
; Check the first INLINEASM_BR target block is predecessed by the block with
; the first INLINEASM_BR.
-; CHECK: bb.4 (%ir-block.11, machine-block-address-taken, ir-block-address-taken %ir-block.11, inlineasm-br-indirect-target):
+; CHECK: bb.4 (%ir-block.11, machine-block-address-taken, inlineasm-br-indirect-target):
; CHECK-NEXT: predecessors: %bb.0
@.str = private unnamed_addr constant [26 x i8] c"inline asm#1 returned %d\0A\00", align 1
diff --git a/llvm/test/CodeGen/X86/callbr-asm-outputs.ll b/llvm/test/CodeGen/X86/callbr-asm-outputs.ll
index 2b45f3267a8d8..77b7b3362cc0f 100644
--- a/llvm/test/CodeGen/X86/callbr-asm-outputs.ll
+++ b/llvm/test/CodeGen/X86/callbr-asm-outputs.ll
@@ -10,12 +10,13 @@ define i32 @test1(i32 %x) {
; CHECK-NEXT: addl $4, %eax
; CHECK-NEXT: #APP
; CHECK-NEXT: xorl %eax, %eax
-; CHECK-NEXT: jmp .Ltmp0
+; CHECK-NEXT: jmp .LBB0_2
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: # %bb.1: # %normal
; CHECK-NEXT: retl
-; CHECK-NEXT: .Ltmp0: # Block address taken
-; CHECK-NEXT: .LBB0_2: # %abnormal
+; CHECK-NEXT: .LBB0_2: # Block address taken
+; CHECK-NEXT: # %abnormal
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: movl $1, %eax
; CHECK-NEXT: retl
entry:
@@ -48,27 +49,29 @@ define i32 @test2(i32 %out1, i32 %out2) {
; CHECK-NEXT: #APP
; CHECK-NEXT: testl %esi, %esi
; CHECK-NEXT: testl %edi, %esi
-; CHECK-NEXT: jne .Ltmp1
+; CHECK-NEXT: jne .LBB1_4
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: jmp .LBB1_3
; CHECK-NEXT: .LBB1_2: # %if.else
; CHECK-NEXT: #APP
; CHECK-NEXT: testl %esi, %edi
; CHECK-NEXT: testl %esi, %edi
-; CHECK-NEXT: jne .Ltmp2
+; CHECK-NEXT: jne .LBB1_5
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: .LBB1_3:
; CHECK-NEXT: movl %esi, %eax
; CHECK-NEXT: addl %edi, %eax
-; CHECK-NEXT: .Ltmp2: # Block address taken
-; CHECK-NEXT: .LBB1_5: # %return
+; CHECK-NEXT: .LBB1_5: # Block address taken
+; CHECK-NEXT: # %return
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: popl %esi
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: popl %edi
; CHECK-NEXT: .cfi_def_cfa_offset 4
; CHECK-NEXT: retl
-; CHECK-NEXT: .Ltmp1: # Block address taken
-; CHECK-NEXT: .LBB1_4: # %label_true
+; CHECK-NEXT: .LBB1_4: # Block address taken
+; CHECK-NEXT: # %label_true
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: .cfi_def_cfa_offset 12
; CHECK-NEXT: movl $-2, %eax
; CHECK-NEXT: jmp .LBB1_5
@@ -131,8 +134,9 @@ define i32 @test3(i1 %cmp) {
; CHECK-NEXT: popl %edi
; CHECK-NEXT: .cfi_def_cfa_offset 4
; CHECK-NEXT: retl
-; CHECK-NEXT: .Ltmp3: # Block address taken
-; CHECK-NEXT: .LBB2_6: # %indirect
+; CHECK-NEXT: .LBB2_6: # Block address taken
+; CHECK-NEXT: # %indirect
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: .cfi_def_cfa_offset 12
; CHECK-NEXT: movl $42, %eax
; CHECK-NEXT: jmp .LBB2_5
@@ -163,23 +167,25 @@ define i32 @test4(i32 %out1, i32 %out2) {
; CHECK-NEXT: #APP
; CHECK-NEXT: testl %ecx, %ecx
; CHECK-NEXT: testl %edx, %ecx
-; CHECK-NEXT: jne .Ltmp4
+; CHECK-NEXT: jne .LBB3_3
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: # %bb.1: # %asm.fallthrough
; CHECK-NEXT: #APP
; CHECK-NEXT: testl %ecx, %edx
; CHECK-NEXT: testl %ecx, %edx
-; CHECK-NEXT: jne .Ltmp5
+; CHECK-NEXT: jne .LBB3_4
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: # %bb.2: # %asm.fallthrough2
; CHECK-NEXT: addl %edx, %ecx
; CHECK-NEXT: movl %ecx, %eax
; CHECK-NEXT: retl
-; CHECK-NEXT: .Ltmp4: # Block address taken
-; CHECK-NEXT: .LBB3_3: # %label_true
+; CHECK-NEXT: .LBB3_3: # Block address taken
+; CHECK-NEXT: # %label_true
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: movl $-2, %eax
-; CHECK-NEXT: .Ltmp5: # Block address taken
-; CHECK-NEXT: .LBB3_4: # %return
+; CHECK-NEXT: .LBB3_4: # Block address taken
+; CHECK-NEXT: # %return
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: retl
entry:
%0 = callbr { i32, i32 } asm sideeffect "testl $0, $0; testl $1, $2; jne ${3:l}", "=r,=r,r,!i,!i,~{dirflag},~{fpsr},~{flags}"(i32 %out1)
@@ -214,8 +220,8 @@ define dso_local void @test5() {
; CHECK: # %bb.0:
; CHECK-NEXT: #APP
; CHECK-NEXT: #NO_APP
-; CHECK-NEXT: .Ltmp6: # Block address taken
-; CHECK-NEXT: # %bb.1:
+; CHECK-NEXT: .LBB4_1: # Block address taken
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: retl
%1 = call i32 @llvm.read_register.i32(metadata !3)
%2 = callbr i32 asm "", "={esp},!i,{esp},~{dirflag},~{fpsr},~{flags}"(i32 %1)
diff --git a/llvm/test/CodeGen/X86/callbr-asm-phi-placement.ll b/llvm/test/CodeGen/X86/callbr-asm-phi-placement.ll
index 4375ffb63cecc..a8c2db5f1c4c4 100644
--- a/llvm/test/CodeGen/X86/callbr-asm-phi-placement.ll
+++ b/llvm/test/CodeGen/X86/callbr-asm-phi-placement.ll
@@ -16,9 +16,10 @@ define void @test1(ptr %arg, ptr %mem) nounwind {
; CHECK-NEXT: pushq %rbx
; CHECK-NEXT: pushq %rax
; CHECK-NEXT: movq %rsi, %r14
-; CHECK-NEXT: .Ltmp0: # Block address taken
-; CHECK-NEXT: .LBB0_1: # %loop
+; CHECK-NEXT: .LBB0_1: # Block address taken
+; CHECK-NEXT: # %loop
; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: movq (%r14), %rbx
; CHECK-NEXT: callq foo at PLT
; CHECK-NEXT: movq %rbx, %rdi
diff --git a/llvm/test/CodeGen/X86/callbr-asm-sink.ll b/llvm/test/CodeGen/X86/callbr-asm-sink.ll
index 51d01cb078a0f..e8fd9268fb618 100644
--- a/llvm/test/CodeGen/X86/callbr-asm-sink.ll
+++ b/llvm/test/CodeGen/X86/callbr-asm-sink.ll
@@ -12,12 +12,12 @@ define void @klist_dec_and_del(%struct1*) {
; CHECK: # %bb.0:
; CHECK-NEXT: leaq 8(%rdi), %rax
; CHECK-NEXT: #APP
-; CHECK-NEXT: # 8(%rdi) .Ltmp0
+; CHECK-NEXT: # 8(%rdi) .LBB0_1
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: # %bb.2:
; CHECK-NEXT: retq
-; CHECK-NEXT: .Ltmp0: # Block address taken
-; CHECK-NEXT: .LBB0_1:
+; CHECK-NEXT: .LBB0_1: # Block address taken
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: movq $0, -8(%rax)
; CHECK-NEXT: retq
%2 = getelementptr inbounds %struct1, %struct1* %0, i64 0, i32 1
diff --git a/llvm/test/CodeGen/X86/callbr-asm.ll b/llvm/test/CodeGen/X86/callbr-asm.ll
index 5bc9643ab37bd..65dc635e43cdf 100644
--- a/llvm/test/CodeGen/X86/callbr-asm.ll
+++ b/llvm/test/CodeGen/X86/callbr-asm.ll
@@ -12,13 +12,14 @@ define i32 @test1(i32 %a) {
; CHECK-NEXT: addl $4, %eax
; CHECK-NEXT: #APP
; CHECK-NEXT: xorl %eax, %eax
-; CHECK-NEXT: jmp .Ltmp0
+; CHECK-NEXT: jmp .LBB0_2
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: # %bb.1: # %normal
; CHECK-NEXT: xorl %eax, %eax
; CHECK-NEXT: retl
-; CHECK-NEXT: .Ltmp0: # Block address taken
-; CHECK-NEXT: .LBB0_2: # %fail
+; CHECK-NEXT: .LBB0_2: # Block address taken
+; CHECK-NEXT: # %fail
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: movl $1, %eax
; CHECK-NEXT: retl
entry:
@@ -41,14 +42,15 @@ define i32 @test1b(i32 %a) {
; CHECK-NEXT: #APP
; CHECK-EMPTY:
; CHECK-NEXT: xorl %eax, %eax
-; CHECK-NEXT: jmp .Ltmp1
+; CHECK-NEXT: jmp .LBB1_2
; CHECK-EMPTY:
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: # %bb.1: # %normal
; CHECK-NEXT: xorl %eax, %eax
; CHECK-NEXT: retl
-; CHECK-NEXT: .Ltmp1: # Block address taken
-; CHECK-NEXT: .LBB1_2: # %fail
+; CHECK-NEXT: .LBB1_2: # Block address taken
+; CHECK-NEXT: # %fail
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: movl $1, %eax
; CHECK-NEXT: retl
entry:
@@ -89,43 +91,47 @@ fail:
define i32 @test3(i32 %a) {
; CHECK-LABEL: test3:
; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: .Ltmp2: # Block address taken
-; CHECK-NEXT: .LBB3_1: # %label01
+; CHECK-NEXT: .LBB3_1: # Block address taken
+; CHECK-NEXT: # %label01
; CHECK-NEXT: # =>This Loop Header: Depth=1
; CHECK-NEXT: # Child Loop BB3_2 Depth 2
; CHECK-NEXT: # Child Loop BB3_3 Depth 3
; CHECK-NEXT: # Child Loop BB3_4 Depth 4
-; CHECK-NEXT: .Ltmp3: # Block address taken
-; CHECK-NEXT: .LBB3_2: # %label02
+; CHECK-NEXT: # Label of block must be emitted
+; CHECK-NEXT: .LBB3_2: # Block address taken
+; CHECK-NEXT: # %label02
; CHECK-NEXT: # Parent Loop BB3_1 Depth=1
; CHECK-NEXT: # => This Loop Header: Depth=2
; CHECK-NEXT: # Child Loop BB3_3 Depth 3
; CHECK-NEXT: # Child Loop BB3_4 Depth 4
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: addl $4, {{[0-9]+}}(%esp)
-; CHECK-NEXT: .Ltmp4: # Block address taken
-; CHECK-NEXT: .LBB3_3: # %label03
+; CHECK-NEXT: .LBB3_3: # Block address taken
+; CHECK-NEXT: # %label03
; CHECK-NEXT: # Parent Loop BB3_1 Depth=1
; CHECK-NEXT: # Parent Loop BB3_2 Depth=2
; CHECK-NEXT: # => This Loop Header: Depth=3
; CHECK-NEXT: # Child Loop BB3_4 Depth 4
-; CHECK-NEXT: .Ltmp5: # Block address taken
-; CHECK-NEXT: .LBB3_4: # %label04
+; CHECK-NEXT: # Label of block must be emitted
+; CHECK-NEXT: .LBB3_4: # Block address taken
+; CHECK-NEXT: # %label04
; CHECK-NEXT: # Parent Loop BB3_1 Depth=1
; CHECK-NEXT: # Parent Loop BB3_2 Depth=2
; CHECK-NEXT: # Parent Loop BB3_3 Depth=3
; CHECK-NEXT: # => This Inner Loop Header: Depth=4
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: #APP
-; CHECK-NEXT: jmp .Ltmp2
-; CHECK-NEXT: jmp .Ltmp3
-; CHECK-NEXT: jmp .Ltmp4
+; CHECK-NEXT: jmp .LBB3_1
+; CHECK-NEXT: jmp .LBB3_2
+; CHECK-NEXT: jmp .LBB3_3
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: # %bb.5: # %normal0
; CHECK-NEXT: # in Loop: Header=BB3_4 Depth=4
; CHECK-NEXT: #APP
-; CHECK-NEXT: jmp .Ltmp2
-; CHECK-NEXT: jmp .Ltmp3
-; CHECK-NEXT: jmp .Ltmp4
-; CHECK-NEXT: jmp .Ltmp5
+; CHECK-NEXT: jmp .LBB3_1
+; CHECK-NEXT: jmp .LBB3_2
+; CHECK-NEXT: jmp .LBB3_3
+; CHECK-NEXT: jmp .LBB3_4
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: # %bb.6: # %normal1
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
@@ -165,14 +171,15 @@ define void @test4() {
; CHECK-LABEL: test4:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: #APP
-; CHECK-NEXT: ja .Ltmp6
+; CHECK-NEXT: ja .LBB4_3
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: # %bb.1: # %asm.fallthrough
; CHECK-NEXT: #APP
-; CHECK-NEXT: ja .Ltmp6
+; CHECK-NEXT: ja .LBB4_3
; CHECK-NEXT: #NO_APP
-; CHECK-NEXT: .Ltmp6: # Block address taken
-; CHECK-NEXT: .LBB4_3: # %quux
+; CHECK-NEXT: .LBB4_3: # Block address taken
+; CHECK-NEXT: # %quux
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: retl
entry:
callbr void asm sideeffect "ja $0", "!i,~{dirflag},~{fpsr},~{flags}"()
diff --git a/llvm/test/CodeGen/X86/inline-asm-pic.ll b/llvm/test/CodeGen/X86/inline-asm-pic.ll
index 95c8d51273701..54300a946ec3d 100644
--- a/llvm/test/CodeGen/X86/inline-asm-pic.ll
+++ b/llvm/test/CodeGen/X86/inline-asm-pic.ll
@@ -26,13 +26,14 @@ define void @x() {
; CHECK-LABEL: x:
; CHECK: ## %bb.0:
; CHECK-NEXT: ## InlineAsm Start
-; CHECK-NEXT: ## Ltmp0
+; CHECK-NEXT: ## LBB1_1
; CHECK-EMPTY:
; CHECK-NEXT: ## InlineAsm End
; CHECK-NEXT: ## %bb.2: ## %return
; CHECK-NEXT: retl
; CHECK-NEXT: Ltmp0: ## Block address taken
; CHECK-NEXT: LBB1_1: ## %overflow
+; CHECK-NEXT: ## Label of block must be emitted
; CHECK-NEXT: retl
callbr void asm "# ${0:l}\0A", "!i"()
to label %return [label %overflow]
diff --git a/llvm/test/CodeGen/X86/shrinkwrap-callbr.ll b/llvm/test/CodeGen/X86/shrinkwrap-callbr.ll
index 72e78c69f8fbe..b8e9cbb14a151 100644
--- a/llvm/test/CodeGen/X86/shrinkwrap-callbr.ll
+++ b/llvm/test/CodeGen/X86/shrinkwrap-callbr.ll
@@ -20,7 +20,7 @@ define i32 @test1(i32 %v) {
; CHECK-NEXT: # %bb.1: # %if.end
; CHECK-NEXT: callq fn
; CHECK-NEXT: #APP
-; CHECK-NEXT: # jump to .Ltmp0
+; CHECK-NEXT: # jump to .LBB0_4
; CHECK-NEXT: #NO_APP
; CHECK-NEXT: # %bb.2: # %return
; CHECK-NEXT: movl $4, %eax
@@ -33,8 +33,9 @@ define i32 @test1(i32 %v) {
; CHECK-NEXT: popq %rcx
; CHECK-NEXT: .cfi_def_cfa_offset 8
; CHECK-NEXT: retq
-; CHECK-NEXT: .Ltmp0: # Block address taken
-; CHECK-NEXT: .LBB0_4: # %two
+; CHECK-NEXT: .LBB0_4: # Block address taken
+; CHECK-NEXT: # %two
+; CHECK-NEXT: # Label of block must be emitted
; CHECK-NEXT: .cfi_def_cfa_offset 16
; CHECK-NEXT: popq %rax
; CHECK-NEXT: .cfi_def_cfa_offset 8
diff --git a/llvm/test/CodeGen/X86/tail-dup-asm-goto.ll b/llvm/test/CodeGen/X86/tail-dup-asm-goto.ll
index 087af889652ff..9e3a8e605cfd4 100644
--- a/llvm/test/CodeGen/X86/tail-dup-asm-goto.ll
+++ b/llvm/test/CodeGen/X86/tail-dup-asm-goto.ll
@@ -35,10 +35,10 @@ define ptr @test1(ptr %arg1, ptr %arg2) {
; CHECK-NEXT: successors: %bb.5(0x80000000), %bb.4(0x00000000)
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[PHI:%[0-9]+]]:gr64 = PHI [[COPY]], %bb.2, [[MOV64rm]], %bb.1
- ; CHECK-NEXT: INLINEASM_BR &"#$0 $1 $2", 9 /* sideeffect mayload attdialect */, 13 /* imm */, 42, 13 /* imm */, 0, 13 /* imm */, blockaddress(@test1, %ir-block.bb17.i.i.i), 12 /* clobber */, implicit-def early-clobber $df, 12 /* clobber */, implicit-def early-clobber $fpsw, 12 /* clobber */, implicit-def early-clobber $eflags
+ ; CHECK-NEXT: INLINEASM_BR &"#$0 $1 $2", 9 /* sideeffect mayload attdialect */, 13 /* imm */, 42, 13 /* imm */, 0, 13 /* imm */, %bb.4, 12 /* clobber */, implicit-def early-clobber $df, 12 /* clobber */, implicit-def early-clobber $fpsw, 12 /* clobber */, implicit-def early-clobber $eflags
; CHECK-NEXT: JMP_1 %bb.5
; CHECK-NEXT: {{ $}}
- ; CHECK-NEXT: bb.4.bb17.i.i.i (machine-block-address-taken, ir-block-address-taken %ir-block.bb17.i.i.i, inlineasm-br-indirect-target):
+ ; CHECK-NEXT: bb.4.bb17.i.i.i (machine-block-address-taken, inlineasm-br-indirect-target):
; CHECK-NEXT: successors: %bb.5(0x80000000)
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: {{ $}}
More information about the llvm-commits
mailing list