1; RUN: opt %s -gvn -S -enable-gvn-memdep=false | FileCheck %s 2; RUN: opt %s -gvn -S -enable-gvn-memdep=true | FileCheck %s 3 4; Check that llvm.x86.avx2.gather.d.ps.256 intrinsic is not eliminated by GVN 5; with and without memory dependence info. 6target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 7target triple = "x86_64-unknown-linux-gnu" 8 9; Function Attrs: nounwind readonly 10declare <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float>, i8*, <8 x i32>, <8 x float>, i8) #0 11 12; Function Attrs: nounwind 13define <8 x float> @foo1(i8* noalias readonly %arr.ptr, <8 x i32>* noalias readonly %vix.ptr, i8* noalias %t2.ptr) #1 { 14allocas: 15 %vix = load <8 x i32>, <8 x i32>* %vix.ptr, align 4 16 %t1.ptr = getelementptr i8, i8* %arr.ptr, i8 4 17 18 %v1 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, i8* %arr.ptr, <8 x i32> %vix, <8 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, i8 1) #2 19 store i8 1, i8* %t1.ptr, align 4 20 21 %v2 = tail call <8 x float> @llvm.x86.avx2.gather.d.ps.256(<8 x float> undef, i8* %arr.ptr, <8 x i32> %vix, <8 x float> <float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000, float 0xFFFFFFFFE0000000>, i8 1) #2 22 %res = fadd <8 x float> %v1, %v2 23 24 ret <8 x float> %res 25} 26; CHECK: foo1 27; CHECK: llvm.x86.avx2.gather.d.ps.256 28; CHECK: store 29; CHECK: llvm.x86.avx2.gather.d.ps.256 30