llvm.org GIT mirror llvm / 750d761
Change greater than to greater than or equal so that an identical sized store to the same offset is treated as completing overwriting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161857 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 7 years ago
2 changed file(s) with 20 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
377377 //
378378 // We have to be careful here as *Off is signed while *.Size is unsigned.
379379 if (EarlierOff >= LaterOff &&
380 Later.Size > Earlier.Size &&
380 Later.Size >= Earlier.Size &&
381381 uint64_t(EarlierOff - LaterOff) + Earlier.Size <= Later.Size)
382382 return OverwriteComplete;
383383
290290 %call = call i8* @strdup(i8* %arrayidx) nounwind
291291 ret i8* %call
292292 }
293
294 ; Make sure same sized store to later element is deleted
295 ; CHECK: @test24
296 ; CHECK-NOT: store i32 0
297 ; CHECK-NOT: store i32 0
298 ; CHECK: store i32 %b
299 ; CHECK: store i32 %c
300 ; CHECK: ret void
301 define void @test24([2 x i32]* %a, i32 %b, i32 %c) nounwind {
302 %1 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 0
303 store i32 0, i32* %1, align 4
304 %2 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 1
305 store i32 0, i32* %2, align 4
306 %3 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 0
307 store i32 %b, i32* %3, align 4
308 %4 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 1
309 store i32 %c, i32* %4, align 4
310 ret void
311 }