2018-11-03 00:52:48 +08:00
|
|
|
# RUN: llc %s -run-pass=postra-machine-sink -o - | FileCheck %s
|
|
|
|
--- |
|
|
|
|
; Module stripped of everything, MIR below is what's interesting
|
|
|
|
; ModuleID = '<stdin>'
|
|
|
|
source_filename = "justacall.cpp"
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
|
|
|
|
; Function Attrs: noinline norecurse nounwind uwtable
|
|
|
|
define dso_local i32 @main(i32 %argc, i8** nocapture readnone %argv) local_unnamed_addr #0 {
|
|
|
|
entry:
|
|
|
|
br label %if.end
|
|
|
|
if.end:
|
|
|
|
br label %return
|
|
|
|
return:
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
!0 = !{!"dummy metadata"}
|
|
|
|
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: None)
|
|
|
|
!3 = !DIFile(filename: "justacall.cpp", directory: "/tmp")
|
|
|
|
!4 = !{}
|
|
|
|
!5 = !{!0}
|
|
|
|
!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
|
|
|
!14 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 7, type: !15, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: true, unit: !2, retainedNodes: !20)
|
|
|
|
!15 = !DISubroutineType(types: !16)
|
|
|
|
!16 = !{!7, !7}
|
|
|
|
!20 = !{!21}
|
|
|
|
!21 = !DILocalVariable(name: "argc", arg: 1, scope: !14, file: !3, line: 7, type: !7)
|
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: main
|
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67433
llvm-svn: 371608
2019-09-11 19:16:48 +08:00
|
|
|
alignment: 16
|
2018-11-03 00:52:48 +08:00
|
|
|
exposesReturnsTwice: false
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
selected: false
|
|
|
|
failedISel: false
|
|
|
|
tracksRegLiveness: true
|
|
|
|
hasWinCFI: false
|
|
|
|
registers:
|
|
|
|
liveins:
|
|
|
|
- { reg: '$edi', virtual-reg: '' }
|
|
|
|
frameInfo:
|
|
|
|
isFrameAddressTaken: false
|
|
|
|
isReturnAddressTaken: false
|
|
|
|
hasStackMap: false
|
|
|
|
hasPatchPoint: false
|
|
|
|
stackSize: 0
|
|
|
|
offsetAdjustment: 0
|
|
|
|
maxAlignment: 0
|
|
|
|
adjustsStack: false
|
|
|
|
hasCalls: true
|
|
|
|
stackProtector: ''
|
|
|
|
maxCallFrameSize: 4294967295
|
|
|
|
cvBytesOfCalleeSavedRegisters: 0
|
|
|
|
hasOpaqueSPAdjustment: false
|
|
|
|
hasVAStart: false
|
|
|
|
hasMustTailInVarArgFunc: false
|
|
|
|
localFrameSize: 0
|
|
|
|
savePoint: ''
|
|
|
|
restorePoint: ''
|
|
|
|
fixedStack:
|
|
|
|
stack:
|
|
|
|
constants:
|
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
|
|
|
successors: %bb.2(0x40000000), %bb.1(0x40000000)
|
|
|
|
liveins: $edi
|
|
|
|
|
|
|
|
; Test that the DBG_VALUE on ebx below is sunk with the def of ebx, despite
|
|
|
|
; not being adjacent to the def, see PR38952
|
|
|
|
|
[MachineVerifier] Verify that a DBG_VALUE has a debug location
Summary:
Verify that each DBG_VALUE has a debug location. This is required by
LiveDebugValues, and perhaps by other late passes.
There's an exception for tests: lots of tests use a two-operand form of
DBG_VALUE for convenience. There's no reason to prevent that.
This is an extension of D80665, but there's no dependency.
Reviewers: aprantl, jmorse, davide, chrisjackson
Subscribers: hiraditya, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80670
2020-05-28 06:44:10 +08:00
|
|
|
DBG_VALUE $edi, $noreg
|
2018-11-03 00:52:48 +08:00
|
|
|
renamable $ebx = COPY $edi
|
|
|
|
renamable $eax = MOV32r0 implicit-def dead $eflags
|
[MachineVerifier] Verify that a DBG_VALUE has a debug location
Summary:
Verify that each DBG_VALUE has a debug location. This is required by
LiveDebugValues, and perhaps by other late passes.
There's an exception for tests: lots of tests use a two-operand form of
DBG_VALUE for convenience. There's no reason to prevent that.
This is an extension of D80665, but there's no dependency.
Reviewers: aprantl, jmorse, davide, chrisjackson
Subscribers: hiraditya, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80670
2020-05-28 06:44:10 +08:00
|
|
|
DBG_VALUE $ebx, $noreg
|
2018-11-03 00:52:48 +08:00
|
|
|
CMP32ri $edi, 255, implicit-def $eflags
|
[X86] Merge the different Jcc instructions for each condition code into single instructions that store the condition code as an operand.
Summary:
This avoids needing an isel pattern for each condition code. And it removes translation switches for converting between Jcc instructions and condition codes.
Now the printer, encoder and disassembler take care of converting the immediate. We use InstAliases to handle the assembly matching. But we print using the asm string in the instruction definition. The instruction itself is marked IsCodeGenOnly=1 to hide it from the assembly parser.
Reviewers: spatel, lebedev.ri, courbet, gchatelet, RKSimon
Reviewed By: RKSimon
Subscribers: MatzeB, qcolombet, eraman, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60228
llvm-svn: 357802
2019-04-06 03:28:09 +08:00
|
|
|
JCC_1 %bb.2, 15, implicit killed $eflags
|
2018-11-03 00:52:48 +08:00
|
|
|
JMP_1 %bb.1
|
|
|
|
|
|
|
|
bb.1.if.end:
|
|
|
|
; CHECK-LABEL: bb.1.if.end
|
|
|
|
successors: %bb.2(0x80000000)
|
|
|
|
liveins: $ebx
|
|
|
|
|
|
|
|
; CHECK: $ebx = COPY $edi
|
|
|
|
; CHECK-NEXT: DBG_VALUE $ebx
|
|
|
|
renamable $rdx = MOVSX64rr32 renamable $ebx
|
|
|
|
renamable $rdx = nsw SHL64ri killed renamable $rdx, 2, implicit-def dead $eflags
|
|
|
|
ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
|
|
|
|
$rdi = MOV32ri64 0
|
|
|
|
$esi = MOV32r0 implicit-def dead $eflags
|
|
|
|
CALL64pcrel32 &memset, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit killed $esi, implicit $rdx, implicit-def $rsp, implicit-def $ssp, implicit-def dead $rax
|
|
|
|
ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
|
|
|
|
|
|
|
|
bb.2.return:
|
|
|
|
liveins: $eax
|
|
|
|
|
|
|
|
RET 0, $eax
|
|
|
|
|
|
|
|
...
|