1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 05:52:53 +02:00
llvm-mirror/test/Analysis/CostModel/PowerPC/popcnt.ll
Benjamin Kramer 40fc84b1be [TTI] Let the cost model estimate ctpop costs based on legality
PPC has a vector popcount, this lets the vectorizer use the correct cost
for it. Tweak X86 test to use an intrinsic that's actually scalarized (we
have a somewhat efficient lowering for vector popcount using SSE, the
cost model finds that now).

llvm-svn: 265005
2016-03-31 10:42:40 +00:00

12 lines
515 B
LLVM

; RUN: opt < %s -cost-model -analyze -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 | FileCheck %s
target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
target triple = "powerpc64-unknown-linux-gnu"
define <4 x i32> @test1(<4 x i32> %arg) {
; CHECK: cost of 1 {{.*}} call <4 x i32> @llvm.ctpop.v4i32
%ctpop = call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %arg)
ret <4 x i32> %ctpop
}
declare <4 x i32> @llvm.ctpop.v4i32(<4 x i32>)