llvm.org GIT mirror llvm / 80a70bb
[X86] Add test case for D58805. NFC This demonstrates dead store elimination removing a store that may alias a gather that uses null as its base. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355227 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 6 months ago
1 changed file(s) with 20 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1 ; RUN: opt < %s -dse -S | FileCheck %s
2
3 ; Both stores should be emitted because we can't tell if the gather aliases.
4
5 define <4 x i32> @bar(<4 x i32> %arg, i32* %arg1) {
6 ; CHECK-LABEL: @bar(
7 ; CHECK-NEXT: bb:
8 ; CHECK-NEXT: [[TMP:%.*]] = tail call <4 x i32> @llvm.x86.avx2.gather.d.d(<4 x i32> zeroinitializer, i8* null, <4 x i32> [[ARG:%.*]], <4 x i32> , i8 1)
9 ; CHECK-NEXT: store i32 10, i32* [[ARG1:%.*]]
10 ; CHECK-NEXT: ret <4 x i32> [[TMP]]
11 ;
12 bb:
13 store i32 5, i32* %arg1
14 %tmp = tail call <4 x i32> @llvm.x86.avx2.gather.d.d(<4 x i32> zeroinitializer, i8* null, <4 x i32> %arg, <4 x i32> , i8 1)
15 store i32 10, i32* %arg1
16 ret <4 x i32> %tmp
17 }
18
19 declare <4 x i32> @llvm.x86.avx2.gather.d.d(<4 x i32>, i8*, <4 x i32>, <4 x i32>, i8)