[llvm] fe17ce0 - [PowerPC] add RUN lines for both endians to test; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 13 07:50:08 PST 2022


Author: Sanjay Patel
Date: 2022-01-13T10:49:23-05:00
New Revision: fe17ce0fa6626f79be663ab9948c1ed24d8e2b85

URL: https://github.com/llvm/llvm-project/commit/fe17ce0fa6626f79be663ab9948c1ed24d8e2b85
DIFF: https://github.com/llvm/llvm-project/commit/fe17ce0fa6626f79be663ab9948c1ed24d8e2b85.diff

LOG: [PowerPC] add RUN lines for both endians to test; NFC

The load narrowing transform works for both targets,
so we might as well test both with simple examples
like this.

Added: 
    

Modified: 
    llvm/test/CodeGen/PowerPC/lbz-from-ld-shift.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/PowerPC/lbz-from-ld-shift.ll b/llvm/test/CodeGen/PowerPC/lbz-from-ld-shift.ll
index 1b4f2a55f6359..e401cd3ba69bf 100644
--- a/llvm/test/CodeGen/PowerPC/lbz-from-ld-shift.ll
+++ b/llvm/test/CodeGen/PowerPC/lbz-from-ld-shift.ll
@@ -1,18 +1,18 @@
-; RUN: llc -verify-machineinstrs -mcpu=ppc64 < %s | FileCheck %s
-target datalayout = "E-m:e-i64:64-n32:64"
-target triple = "powerpc64-unknown-linux-gnu"
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -ppc-asm-full-reg-names -verify-machineinstrs -mtriple=powerpc64--   < %s | FileCheck %s --check-prefixes=BE
+; RUN: llc -ppc-asm-full-reg-names -verify-machineinstrs -mtriple=powerpc64le-- < %s | FileCheck %s --check-prefixes=LE
 
-; Function Attrs: nounwind readonly
-define signext i32 @test(i32* nocapture readonly %P) #0 {
-entry:
-  %0 = load i32, i32* %P, align 4
-  %shr = lshr i32 %0, 24
+define signext i32 @test(i32* nocapture readonly %P) nounwind {
+; BE-LABEL: test:
+; BE:       # %bb.0:
+; BE-NEXT:    lbz r3, 0(r3)
+; BE-NEXT:    blr
+;
+; LE-LABEL: test:
+; LE:       # %bb.0:
+; LE-NEXT:    lbz r3, 3(r3)
+; LE-NEXT:    blr
+  %t0 = load i32, i32* %P, align 4
+  %shr = lshr i32 %t0, 24
   ret i32 %shr
-
-; CHECK-LABEL: @test
-; CHECK: lbz 3, 0(3)
-; CHECK: blr
 }
-
-attributes #0 = { nounwind readonly }
-


        


More information about the llvm-commits mailing list