1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 13:11:39 +01:00
llvm-mirror/test/CodeGen/ARM/machine-sink-multidef.ll
David Green 61fedbad58 [MachineSink] Fix for breaking phi edges with instructions with multiple defs
BreakPHIEdge would be set based on whether the instruction needs to
insert a new critical edge to allow sinking into a block where the uses
are PHI nodes. But for instructions with multiple defs it would be reset
on the second def, allowing the instruciton to sink where it should not.

Fixes PR44981

Differential Revision: https://reviews.llvm.org/D78087
2020-04-16 16:42:07 +01:00

57 lines
2.0 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=arm-none-eabi | FileCheck %s
%struct.anon.1.19.23.27.35.49.55.57.59.61.89.95 = type { i32, i32 }
@e = external constant [2 x %struct.anon.1.19.23.27.35.49.55.57.59.61.89.95], align 4
@f = external global i32, align 4
define arm_aapcscc void @g() {
; CHECK-LABEL: g:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: .save {r11, lr}
; CHECK-NEXT: push {r11, lr}
; CHECK-NEXT: ldr r0, .LCPI0_0
; CHECK-NEXT: mov r2, #0
; CHECK-NEXT: ldr r1, .LCPI0_1
; CHECK-NEXT: cmp r2, #0
; CHECK-NEXT: ldr r0, [r0]
; CHECK-NEXT: ldr r0, [r1, r0, lsl #3]!
; CHECK-NEXT: moveq r0, #0
; CHECK-NEXT: cmp r2, #0
; CHECK-NEXT: popne {r11, lr}
; CHECK-NEXT: movne pc, lr
; CHECK-NEXT: ldr r1, [r1, #4]
; CHECK-NEXT: bl k
; CHECK-NEXT: .p2align 2
; CHECK-NEXT: @ %bb.1:
; CHECK-NEXT: .LCPI0_0:
; CHECK-NEXT: .long f
; CHECK-NEXT: .LCPI0_1:
; CHECK-NEXT: .long e
entry:
%0 = load i32, i32* @f, align 4
%c = getelementptr inbounds [2 x %struct.anon.1.19.23.27.35.49.55.57.59.61.89.95], [2 x %struct.anon.1.19.23.27.35.49.55.57.59.61.89.95]* @e, i32 0, i32 %0, i32 0
%1 = load i32, i32* %c, align 4
%d = getelementptr inbounds [2 x %struct.anon.1.19.23.27.35.49.55.57.59.61.89.95], [2 x %struct.anon.1.19.23.27.35.49.55.57.59.61.89.95]* @e, i32 0, i32 %0, i32 1
%2 = load i32, i32* %d, align 4
br i1 undef, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %entry
br label %if.end
if.end: ; preds = %land.lhs.true, %entry
%h.0 = phi i32 [ %1, %entry ], [ 0, %land.lhs.true ]
br i1 undef, label %if.end7, label %if.then5
if.then5: ; preds = %if.end
%call6 = call arm_aapcscc i32 bitcast (i32 (...)* @k to i32 (i32, i32)*)(i32 %h.0, i32 %2)
unreachable
if.end7: ; preds = %if.end
ret void
}
declare arm_aapcscc i32 @k(...)