2020-07-01 06:40:24 +08:00
|
|
|
; RUN: opt %loadPolly -basic-aa -polly-codegen -polly-vectorizer=polly \
|
2016-08-15 23:56:24 +08:00
|
|
|
; RUN: -polly-invariant-load-hoisting=true -dce -S < %s | FileCheck %s
|
2012-12-18 15:46:13 +08:00
|
|
|
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-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
|
|
|
|
|
|
|
@A = common global [1024 x float] zeroinitializer, align 16
|
|
|
|
@B = common global [1024 x double] zeroinitializer, align 16
|
|
|
|
|
|
|
|
define void @simple_vec_const() nounwind {
|
|
|
|
bb:
|
|
|
|
br label %bb1
|
|
|
|
|
|
|
|
bb1: ; preds = %bb3, %bb
|
|
|
|
%indvar = phi i64 [ %indvar.next, %bb3 ], [ 0, %bb ]
|
2015-02-28 03:20:19 +08:00
|
|
|
%scevgep = getelementptr [1024 x double], [1024 x double]* @B, i64 0, i64 %indvar
|
2012-12-18 15:46:13 +08:00
|
|
|
%exitcond = icmp ne i64 %indvar, 4
|
|
|
|
br i1 %exitcond, label %bb2, label %bb4
|
|
|
|
|
|
|
|
bb2: ; preds = %bb1
|
2015-03-14 02:21:20 +08:00
|
|
|
%tmp = load float, float* getelementptr inbounds ([1024 x float], [1024 x float]* @A, i64 0, i64 0), align 16
|
2012-12-18 15:46:13 +08:00
|
|
|
%tmp2 = fpext float %tmp to double
|
|
|
|
store double %tmp2, double* %scevgep, align 4
|
|
|
|
br label %bb3
|
|
|
|
|
|
|
|
bb3: ; preds = %bb2
|
|
|
|
%indvar.next = add i64 %indvar, 1
|
|
|
|
br label %bb1
|
|
|
|
|
|
|
|
bb4: ; preds = %bb1
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-09-30 07:47:21 +08:00
|
|
|
; CHECK: %.load = load float, float* getelementptr inbounds ([1024 x float], [1024 x float]* @A, i32 0, i32 0)
|
2014-11-17 06:43:21 +08:00
|
|
|
|
2015-09-30 07:47:21 +08:00
|
|
|
; CHECK: polly.stmt.bb2: ; preds = %polly.start
|
2020-12-24 08:33:58 +08:00
|
|
|
; CHECK: %tmp_p.splatinsert = insertelement <4 x float> poison, float %.load, i32 0
|
|
|
|
; CHECK: %tmp_p.splat = shufflevector <4 x float> %tmp_p.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
|
2015-09-30 07:47:21 +08:00
|
|
|
; CHECK: %0 = fpext <4 x float> %tmp_p.splat to <4 x double>
|
|
|
|
; CHECK: store <4 x double> %0, <4 x double>*
|