1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -run-pass early-machinelicm -mtriple=powerpc64le-unknown-linux-gnu \
3 # RUN: -verify-machineinstrs %s -o - | FileCheck %s
6 # This case tests that after the dead %3 is CSE-ed with hoisted %5 in MachineLICM
7 # pass, the dead flag will be cleared for %3 if %5 has users.
8 tracksRegLiveness: true
10 ; CHECK-LABEL: name: deadFlagAfterCSE
12 ; CHECK: successors: %bb.1(0x80000000)
13 ; CHECK: liveins: $x3, $x4
14 ; CHECK: [[COPY:%[0-9]+]]:g8rc = COPY $x3
15 ; CHECK: [[COPY1:%[0-9]+]]:g8rc = COPY $x4
16 ; CHECK: [[ADD8_:%[0-9]+]]:g8rc_and_g8rc_nox0 = ADD8 [[COPY]], [[COPY1]]
17 ; CHECK: [[ADDI8_:%[0-9]+]]:g8rc_and_g8rc_nox0 = ADDI8 [[ADD8_]], 100
20 ; CHECK: successors: %bb.1(0x80000000)
21 ; CHECK: [[PHI:%[0-9]+]]:g8rc_and_g8rc_nox0 = PHI [[ADD8_]], %bb.0, %5, %bb.1
22 ; CHECK: STDX [[PHI]], [[ADDI8_]], [[ADD8_]]
23 ; CHECK: [[ADDI8_1:%[0-9]+]]:g8rc = nuw ADDI8 [[PHI]], 1
26 ; CHECK: BLR8 implicit $lr8, implicit $rm
31 %2:g8rc_and_g8rc_nox0 = ADD8 %0, %1
32 dead %3:g8rc_and_g8rc_nox0 = ADDI8 %2, 100
36 %4:g8rc_and_g8rc_nox0 = PHI %2, %bb.0, %6, %bb.1
37 %5:g8rc_and_g8rc_nox0 = ADDI8 %2, 100
39 %6:g8rc = nuw ADDI8 %4, 1
43 BLR8 implicit $lr8, implicit $rm
46 name: deadFlagAfterCSE2
47 # This case tests that after the dead %3 is CSE-ed with hoisted dead %5 in
48 # MachineLICM pass, the dead flag will be kept.
49 tracksRegLiveness: true
51 ; CHECK-LABEL: name: deadFlagAfterCSE2
53 ; CHECK: successors: %bb.1(0x80000000)
54 ; CHECK: liveins: $x3, $x4
55 ; CHECK: [[COPY:%[0-9]+]]:g8rc = COPY $x3
56 ; CHECK: [[COPY1:%[0-9]+]]:g8rc = COPY $x4
57 ; CHECK: [[ADD8_:%[0-9]+]]:g8rc_and_g8rc_nox0 = ADD8 [[COPY]], [[COPY1]]
58 ; CHECK: dead %3:g8rc_and_g8rc_nox0 = ADDI8 [[ADD8_]], 100
61 ; CHECK: successors: %bb.1(0x80000000)
62 ; CHECK: [[PHI:%[0-9]+]]:g8rc_and_g8rc_nox0 = PHI [[ADD8_]], %bb.0, %5, %bb.1
63 ; CHECK: [[ADDI8_:%[0-9]+]]:g8rc = nuw ADDI8 [[PHI]], 1
66 ; CHECK: BLR8 implicit $lr8, implicit $rm
71 %2:g8rc_and_g8rc_nox0 = ADD8 %0, %1
72 dead %3:g8rc_and_g8rc_nox0 = ADDI8 %2, 100
76 %4:g8rc_and_g8rc_nox0 = PHI %2, %bb.0, %6, %bb.1
77 dead %5:g8rc_and_g8rc_nox0 = ADDI8 %2, 100
78 %6:g8rc = nuw ADDI8 %4, 1
82 BLR8 implicit $lr8, implicit $rm