llvm.org GIT mirror llvm / de2e27c
Fixed deadstoreelimination bug where negative indices were incorrectly causing the optimisation to occur Turns out long long + unsigned long long is unsigned. Doh! Fixes http://llvm.org/bugs/show_bug.cgi?id=11455 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145731 91177308-0d34-0410-b5e6-96231b3b80d8 Pete Cooper 7 years ago
2 changed file(s) with 18 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
415415 // writes to addresses which will definitely be overwritten later
416416 if (LaterOff > EarlierOff &&
417417 LaterOff < int64_t(EarlierOff + Earlier.Size) &&
418 LaterOff + Later.Size >= EarlierOff + Earlier.Size)
418 int64_t(LaterOff + Later.Size) >= int64_t(EarlierOff + Earlier.Size))
419419 return OverwriteEnd;
420420
421421 // Otherwise, they don't completely overlap.
7575
7676 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
7777 declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
78
79 %struct.trapframe = type { i64, i64, i64 }
80
81 ; bugzilla 11455 - make sure negative GEP's don't break this optimisation
82 ; CHECK: @cpu_lwp_fork
83 define void @cpu_lwp_fork(%struct.trapframe* %md_regs, i64 %pcb_rsp0) nounwind uwtable noinline ssp {
84 entry:
85 %0 = inttoptr i64 %pcb_rsp0 to %struct.trapframe*
86 %add.ptr = getelementptr inbounds %struct.trapframe* %0, i64 -1
87 %1 = bitcast %struct.trapframe* %add.ptr to i8*
88 %2 = bitcast %struct.trapframe* %md_regs to i8*
89 ; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 24, i32 1, i1 false)
90 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 24, i32 1, i1 false)
91 %tf_trapno = getelementptr inbounds %struct.trapframe* %0, i64 -1, i32 1
92 store i64 3, i64* %tf_trapno, align 8
93 ret void
94 }