1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/CodeGen/Hexagon/early-if-conv-lifetime.mir
Guillaume Chatelet d49cb60862 [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 11:16:48 +00:00

76 lines
1.8 KiB
YAML

# RUN: llc -march=hexagon -run-pass hexagon-early-if %s -o - | FileCheck %s
# Test that the LIFETIME_END instruction is not speculated and moved to a
# different basic block.
# CHECK: bb.1.b1:
# CHECK: LIFETIME_END
# CHECK: bb.2.b2:
--- |
%s.0 = type { %s.1 }
%s.1 = type { %s.2 }
%s.2 = type { %s.3 }
%s.3 = type { %s.4 }
%s.4 = type { %s.5 }
%s.5 = type { i32, i32, i8* }
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #0
define hidden fastcc void @f0() {
b0:
%v0 = alloca %s.0, align 4
%v1 = load i8, i8* undef, align 1
%v2 = add i8 %v1, -102
%v3 = icmp ult i8 %v2, 1
br i1 %v3, label %b1, label %b2
b1: ; preds = %b0
%v4 = bitcast %s.0* %v0 to i8*
call void @llvm.lifetime.end.p0i8(i64 12, i8* nonnull %v4)
br label %b2
b2: ; preds = %b1, %b0
ret void
}
attributes #0 = { argmemonly nounwind }
...
---
name: f0
alignment: 16
registers:
- { id: 0, class: intregs, preferred-register: '' }
- { id: 1, class: intregs, preferred-register: '' }
- { id: 2, class: predregs, preferred-register: '' }
- { id: 3, class: predregs, preferred-register: '' }
liveins:
frameInfo:
maxAlignment: 4
fixedStack:
stack:
- { id: 0, name: v0, type: default, offset: 0, size: 12, alignment: 4 }
constants:
body: |
bb.0.b0:
successors: %bb.1.b1(0x40000000), %bb.2.b2(0x40000000)
%1 = IMPLICIT_DEF
%0 = L2_loadrb_io killed %1, 0 :: (load 1 from `i8* undef`)
%2 = C2_cmpeqi killed %0, 102
%3 = COPY killed %2
J2_jumpf killed %3, %bb.2.b2, implicit-def dead $pc
J2_jump %bb.1.b1, implicit-def dead $pc
bb.1.b1:
successors: %bb.2.b2(0x80000000)
LIFETIME_END %stack.0.v0
bb.2.b2:
PS_jmpret $r31, implicit-def dead $pc
...