mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
05f5acb5ae
When the instruction has imm form and fed by LI, we can remove the redundat LI instruction. Below is an example: ``` renamable $x5 = LI8 2 renamable $x4 = exact SRD killed renamable $x4, killed renamable $r5, implicit $x5 ``` will be converted to: ``` renamable $x5 = LI8 2 renamable $x4 = exact RLDICL killed renamable $x4, 62, 2, implicit killed $x5 ``` But when we do this optimization, we forget to remove implicit killed $x5 This bug has caused a lnt case error. This patch is to fix above bug. Reviewed By: #powerpc, shchenz Differential Revision: https://reviews.llvm.org/D85288
23 lines
723 B
YAML
23 lines
723 B
YAML
# RUN: llc -mtriple=powerpc64-unknown-unknown -stop-after ppc-pre-emit-peephole \
|
|
# RUN: %s -o - -verify-machineinstrs | FileCheck %s
|
|
|
|
---
|
|
name: testRedundantLiImplicitReg
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0.entry:
|
|
liveins: $x3, $x4, $x5
|
|
|
|
STW killed $r3, killed $x5, 100
|
|
renamable $x5 = LI8 2
|
|
renamable $x4 = exact SRD killed renamable $x4, killed renamable $r5, implicit $x5
|
|
STD $x4, $x4, 100
|
|
BLR8 implicit $lr8, implicit $rm
|
|
|
|
; CHECK-LABEL: testRedundantLiImplicitReg
|
|
; CHECK: bb.0.entry:
|
|
; CHECK: STW killed $r3, killed $x5, 100
|
|
; CHECK: renamable $x4 = exact RLDICL killed renamable $x4, 62, 2
|
|
; CHECK: STD killed $x4, $x4, 100
|
|
; CHECK: BLR8 implicit $lr8, implicit $rm
|