
Summary: Some constants can be handled with less instructions than our current results. And it seems our original approach is not very easy to extend. Therefore this patch proposes to materialize all 64-bit constants by enumerated patterns. I traversed almost all constants to verified the functionality of these pattens. A traversed comparison of the number of instructions used by the original method and the new method has also been completed, where no degradation was caused by this patch. This patch also passed Bootstrap test and SPEC test. Improvements of this patch are shown in llvm/test/CodeGen/PowerPC/constants-i64.ll Reviewed By: steven.zhang, stefanp Differential Revision: https://reviews.llvm.org/D92089
24 lines
577 B
LLVM
24 lines
577 B
LLVM
; RUN: llc -verify-machineinstrs -mcpu=ppc64 < %s | FileCheck %s
|
|
target datalayout = "E-m:e-i64:64-n32:64"
|
|
target triple = "powerpc64-unknown-linux-gnu"
|
|
|
|
; Function Attrs: nounwind
|
|
define void @bar() #0 {
|
|
entry:
|
|
tail call void @xxx([2 x i64] [i64 4607182418800017408, i64 4611686018427387904]) #0
|
|
ret void
|
|
|
|
; CHECK-LABEL: @bar
|
|
; CHECK-DAG: li [[REG1:[0-9]+]], 1023
|
|
; CHECK-DAG: li [[REG2:[0-9]+]], {{1$}}
|
|
; CHECK-DAG: rldic 3, [[REG1]], 52, 2
|
|
; CHECK-DAG: rldic 4, [[REG2]], 62, 1
|
|
; CHECK: bl xxx
|
|
; CHECK: blr
|
|
}
|
|
|
|
declare void @xxx([2 x i64])
|
|
|
|
attributes #0 = { nounwind }
|
|
|