llvm.org GIT mirror llvm / f40a990
[DSE] add test for PR36129; NFC We can miscompile because we're not checking is the memory might me modified between the seemingly redundant store ops. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323704 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjay Patel 1 year, 7 months ago
1 changed file(s) with 15 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
182182 %xbc = bitcast i32* %x to i8*
183183 store i32 0, i32* %x ; big store of constant
184184 store i8 4, i8* %xbc ; small store with mergeable constant
185 ret void
186 }
187
188 ; FIXME: We can't eliminate the last store because P and Q may alias.
189
190 define void @PR36129(i32* %P, i32* %Q) {
191 ; CHECK-LABEL: @PR36129(
192 ; CHECK-NEXT: store i32 3, i32* [[P:%.*]]
193 ; CHECK-NEXT: store i32 2, i32* [[Q:%.*]]
194 ; CHECK-NEXT: ret void
195 ;
196 store i32 1, i32* %P
197 %P2 = bitcast i32* %P to i8*
198 store i32 2, i32* %Q
199 store i8 3, i8* %P2
185200 ret void
186201 }
187202