2017-01-20 21:10:12 +08:00
|
|
|
# RUN: llc -run-pass=peephole-opt %s -o - | FileCheck %s
|
|
|
|
|
|
|
|
--- |
|
|
|
|
; ModuleID = '<stdin>'
|
|
|
|
source_filename = "<stdin>"
|
|
|
|
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
|
|
|
|
target triple = "thumb-none--eabi"
|
|
|
|
|
|
|
|
define i32 @f(i32 %a, i32 %b) {
|
|
|
|
entry:
|
|
|
|
%mul = mul nsw i32 %b, %a
|
|
|
|
%cmp = icmp eq i32 %mul, 0
|
|
|
|
%conv = zext i1 %cmp to i32
|
|
|
|
ret i32 %conv
|
|
|
|
}
|
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: f
|
|
|
|
# CHECK-LABEL: name: f
|
[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: 2
|
2017-01-20 21:10:12 +08:00
|
|
|
exposesReturnsTwice: false
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
selected: false
|
|
|
|
tracksRegLiveness: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: tgpr }
|
|
|
|
- { id: 1, class: tgpr }
|
|
|
|
- { id: 2, class: tgpr }
|
|
|
|
- { id: 3, class: tgpr }
|
|
|
|
- { id: 4, class: tgpr }
|
|
|
|
- { id: 5, class: tgpr }
|
|
|
|
liveins:
|
2018-02-01 06:04:26 +08:00
|
|
|
- { reg: '$r0', virtual-reg: '%0' }
|
|
|
|
- { reg: '$r1', virtual-reg: '%1' }
|
2017-01-20 21:10:12 +08:00
|
|
|
frameInfo:
|
|
|
|
isFrameAddressTaken: false
|
|
|
|
isReturnAddressTaken: false
|
|
|
|
hasStackMap: false
|
|
|
|
hasPatchPoint: false
|
|
|
|
stackSize: 0
|
|
|
|
offsetAdjustment: 0
|
|
|
|
maxAlignment: 0
|
|
|
|
adjustsStack: false
|
|
|
|
hasCalls: false
|
|
|
|
maxCallFrameSize: 0
|
|
|
|
hasOpaqueSPAdjustment: false
|
|
|
|
hasVAStart: false
|
|
|
|
hasMustTailInVarArgFunc: false
|
|
|
|
|
2018-02-01 06:04:26 +08:00
|
|
|
# CHECK: tMOVi8 1, 14, $noreg
|
|
|
|
# CHECK: tMOVi8 0, 14, $noreg
|
|
|
|
# CHECK: tMUL %1, %0, 14, $noreg
|
2017-01-20 21:10:12 +08:00
|
|
|
# CHECK-NOT: tCMPi8
|
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $r0, $r1
|
2017-01-20 21:10:12 +08:00
|
|
|
|
2018-02-01 06:04:26 +08:00
|
|
|
%1 = COPY $r1
|
|
|
|
%0 = COPY $r0
|
|
|
|
%2, $cpsr = tMUL %1, %0, 14, $noreg
|
|
|
|
%3, $cpsr = tMOVi8 1, 14, $noreg
|
|
|
|
%4, $cpsr = tMOVi8 0, 14, $noreg
|
|
|
|
tCMPi8 killed %2, 0, 14, $noreg, implicit-def $cpsr
|
|
|
|
tBcc %bb.2.entry, 0, $cpsr
|
2017-01-20 21:10:12 +08:00
|
|
|
|
|
|
|
bb.1.entry:
|
|
|
|
|
|
|
|
bb.2.entry:
|
|
|
|
%5 = PHI %4, %bb.1.entry, %3, %bb.0.entry
|
2018-02-01 06:04:26 +08:00
|
|
|
$r0 = COPY %5
|
|
|
|
tBX_RET 14, $noreg, implicit $r0
|
2017-01-20 21:10:12 +08:00
|
|
|
|
|
|
|
...
|