From 2e13f7ab01d05ff2ecc8bbca320da9da047598e9 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 12 May 2025 06:28:03 -0700 Subject: [PATCH] [SLP][NFC]Add a test with the incorrect vectorization for the pointers with distance difference > 2^32 --- .../X86/long-pointer-distance.ll | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 llvm/test/Transforms/SLPVectorizer/X86/long-pointer-distance.ll diff --git a/llvm/test/Transforms/SLPVectorizer/X86/long-pointer-distance.ll b/llvm/test/Transforms/SLPVectorizer/X86/long-pointer-distance.ll new file mode 100644 index 000000000000..9cfafd278448 --- /dev/null +++ b/llvm/test/Transforms/SLPVectorizer/X86/long-pointer-distance.ll @@ -0,0 +1,21 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 +; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-grtev4-linux-gnu < %s -mattr=+avx | FileCheck %s + +define void @test(ptr %this) { +; CHECK-LABEL: define void @test( +; CHECK-SAME: ptr [[THIS:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-NEXT: [[ENTRY:.*:]] +; CHECK-NEXT: store <4 x i64> , ptr [[THIS]], align 8 +; CHECK-NEXT: ret void +; +entry: + store i64 1, ptr %this, align 8 + %b = getelementptr i8, ptr %this, i64 8 + store i64 2, ptr %b, align 8 + %c = getelementptr i8, ptr %this, i64 u0x100000010 + store i64 3, ptr %c, align 8 + %d = getelementptr i8, ptr %this, i64 u0x100000018 + store i64 4, ptr %d, align 8 + ret void +} +