Skip to content

Commit

Permalink
[LoopVectorize] Convert test to opaque pointers (NFC)
Browse files Browse the repository at this point in the history
I'm keeping the bitcast in the input here, because without it
we end up introducing a stride 1 assumption and end up testing
a different case.
  • Loading branch information
nikic committed Jun 12, 2023
1 parent 9929f95 commit 2b7c347
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
; RUN: opt -opaque-pointers=0 -mtriple=s390x-unknown-linux -mcpu=z13 -passes=loop-vectorize \
; RUN: opt -mtriple=s390x-unknown-linux -mcpu=z13 -passes=loop-vectorize \
; RUN: -force-vector-width=2 -debug-only=loop-vectorize \
; RUN: -disable-output < %s 2>&1 | FileCheck %s
; REQUIRES: asserts
;
; Check that a scalarized load does not get operands scalarization costs added.

define void @fun(i64* %data, i64 %n, i64 %s, double* %Src) {
define void @fun(ptr %data, i64 %n, i64 %s, ptr %Src) {
entry:
br label %for.body

for.body:
%iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
%mul = mul nsw i64 %iv, %s
%gep = getelementptr inbounds double, double* %Src, i64 %mul
%bct = bitcast double* %gep to i64*
%ld = load i64, i64* %bct
%gep = getelementptr inbounds double, ptr %Src, i64 %mul
%bct = bitcast ptr %gep to ptr
%ld = load i64, ptr %bct
%iv.next = add nuw nsw i64 %iv, 1
%cmp110.us = icmp slt i64 %iv.next, %n
br i1 %cmp110.us, label %for.body, label %for.end
Expand All @@ -23,5 +23,5 @@ for.end:
ret void

; CHECK: LV: Found an estimated cost of 2 for VF 2 For instruction: %mul = mul nsw i64 %iv, %s
; CHECK: LV: Found an estimated cost of 2 for VF 2 For instruction: %ld = load i64, i64* %bct
; CHECK: LV: Found an estimated cost of 2 for VF 2 For instruction: %ld = load i64, ptr %bct
}

0 comments on commit 2b7c347

Please sign in to comment.