From 6d88b7d6e712789115c149c5abb0f359d1222545 Mon Sep 17 00:00:00 2001 From: Kang Zhang Date: Thu, 26 Dec 2019 02:12:32 +0000 Subject: [PowerPC] Modify the hasSideEffects of MTLR and MFLR from 1 to 0 Summary: If we didn't set the value for hasSideEffects bit in our td file, `llvm-tblgen` will set it as true for those instructions which has no match pattern. The instructions `MTLR` and `MFLR` don't set the hasSideEffects flag and don't have match pattern, so their hasSideEffects flag will be set true by `llvm-tblgen`. But in fact, we can use `[LR]` to model the two instructions, so they should not have SideEffects. This patch is to modify the hasSideEffects of MTLR and MFLR from 1 to 0. Reviewed By: jsji Differential Revision: https://reviews.llvm.org/D71390 --- llvm/test/CodeGen/PowerPC/CSR-fit.ll | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/test/CodeGen/PowerPC/CSR-fit.ll') diff --git a/llvm/test/CodeGen/PowerPC/CSR-fit.ll b/llvm/test/CodeGen/PowerPC/CSR-fit.ll index 49bfc79eb4c..ebaffdb0534 100644 --- a/llvm/test/CodeGen/PowerPC/CSR-fit.ll +++ b/llvm/test/CodeGen/PowerPC/CSR-fit.ll @@ -27,9 +27,9 @@ define dso_local signext i32 @caller1(i32 signext %a, i32 signext %b) local_unna ; CHECK-PWR8-NEXT: nop ; CHECK-PWR8-NEXT: addi r1, r1, 176 ; CHECK-PWR8-NEXT: ld r0, 16(r1) -; CHECK-PWR8-NEXT: mtlr r0 ; CHECK-PWR8-NEXT: ld r15, -136(r1) # 8-byte Folded Reload ; CHECK-PWR8-NEXT: ld r14, -144(r1) # 8-byte Folded Reload +; CHECK-PWR8-NEXT: mtlr r0 ; CHECK-PWR8-NEXT: blr ; ; CHECK-PWR9-LABEL: caller1: @@ -51,9 +51,9 @@ define dso_local signext i32 @caller1(i32 signext %a, i32 signext %b) local_unna ; CHECK-PWR9-NEXT: nop ; CHECK-PWR9-NEXT: addi r1, r1, 176 ; CHECK-PWR9-NEXT: ld r0, 16(r1) -; CHECK-PWR9-NEXT: mtlr r0 ; CHECK-PWR9-NEXT: ld r15, -136(r1) # 8-byte Folded Reload ; CHECK-PWR9-NEXT: ld r14, -144(r1) # 8-byte Folded Reload +; CHECK-PWR9-NEXT: mtlr r0 ; CHECK-PWR9-NEXT: blr entry: %0 = tail call i32 asm "add $0, $1, $2", "=r,r,r,~{r14},~{r15}"(i32 %a, i32 %b) @@ -81,9 +81,9 @@ define dso_local signext i32 @caller2(i32 signext %a, i32 signext %b) local_unna ; CHECK-PWR8-NEXT: nop ; CHECK-PWR8-NEXT: addi r1, r1, 176 ; CHECK-PWR8-NEXT: ld r0, 16(r1) -; CHECK-PWR8-NEXT: mtlr r0 ; CHECK-PWR8-NEXT: lfd f15, -136(r1) # 8-byte Folded Reload ; CHECK-PWR8-NEXT: lfd f14, -144(r1) # 8-byte Folded Reload +; CHECK-PWR8-NEXT: mtlr r0 ; CHECK-PWR8-NEXT: blr ; ; CHECK-PWR9-LABEL: caller2: @@ -105,9 +105,9 @@ define dso_local signext i32 @caller2(i32 signext %a, i32 signext %b) local_unna ; CHECK-PWR9-NEXT: nop ; CHECK-PWR9-NEXT: addi r1, r1, 176 ; CHECK-PWR9-NEXT: ld r0, 16(r1) -; CHECK-PWR9-NEXT: mtlr r0 ; CHECK-PWR9-NEXT: lfd f15, -136(r1) # 8-byte Folded Reload ; CHECK-PWR9-NEXT: lfd f14, -144(r1) # 8-byte Folded Reload +; CHECK-PWR9-NEXT: mtlr r0 ; CHECK-PWR9-NEXT: blr entry: %0 = tail call i32 asm "add $0, $1, $2", "=r,r,r,~{f14},~{f15}"(i32 %a, i32 %b) -- cgit v1.2.3