1 # RUN: llc -mtriple=powerpc64le--linux-gnu -start-before ppc-mi-peepholes %s -o - -verify-machineinstrs | FileCheck %s
2 # RUN: llc -mtriple=powerpc64le--linux-gnu -run-pass ppc-mi-peepholes %s -o - -verify-machineinstrs | FileCheck %s --check-prefix=CHECK-PASS
4 # The differential revision https://reviews.llvm.org/D60402 was supposed to
5 # collapse RLDICL/RLDICR into RLDIC when possible, but it missed removing the
6 # RLDICL instruction. This test case tests the fix for the bug.
9 ; ModuleID = 'jump-tables-collapse-rotate-remove-SrcMI.ll'
10 source_filename = "jump-tables-collapse-rotate-remove-SrcMI.ll"
11 target datalayout = "e-m:e-i64:64-n32:64"
13 define dso_local i64 @test(i64 %a, i64 %b) local_unnamed_addr {
15 %add = add nsw i64 %b, %a
23 tracksRegLiveness: true
25 - { id: 0, class: g8rc }
26 - { id: 1, class: g8rc }
27 - { id: 2, class: g8rc }
29 - { reg: '$x3', virtual-reg: '%0' }
30 - { reg: '$x4', virtual-reg: '%1' }
33 machineFunctionInfo: {}
40 %2:g8rc = RLDICL killed %1, 0, 32
41 %3:g8rc = RLDICR %2, 2, 61
43 BLR8 implicit $lr8, implicit $rm, implicit $x3
47 # CHECK: # %bb.0: # %entry
48 # CHECK-NEXT: rldic 3, 4, 2, 30
51 # CHECK-PASS-NOT: %2:g8rc = RLDICL killed %1, 0, 32
52 # CHECK-PASS-NOT: %3:g8rc = RLDICR %2, 2, 61
53 # CHECK-PASS: %3:g8rc = RLDIC killed %1, 2, 30