mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-13 00:10:37 +00:00
fix PR9841 by having GVN not process dead loads. This was
causing it to get into infinite loops when it would widen a load (which can necessarily leave around dead loads). llvm-svn: 131847
This commit is contained in:
parent
dcb6599980
commit
6cce3b63ab
@ -1607,6 +1607,11 @@ bool GVN::processLoad(LoadInst *L) {
|
||||
if (L->isVolatile())
|
||||
return false;
|
||||
|
||||
if (L->use_empty()) {
|
||||
markInstructionForDeletion(L);
|
||||
return true;
|
||||
}
|
||||
|
||||
// ... to a pointer that has been loaded from before...
|
||||
MemDepResult Dep = MD->getDependency(L);
|
||||
|
||||
|
@ -151,3 +151,15 @@ dead:
|
||||
dead2:
|
||||
ret i32 %A
|
||||
}
|
||||
|
||||
|
||||
; PR9841
|
||||
define fastcc i8 @test5(i8* %P) nounwind {
|
||||
entry:
|
||||
%0 = load i8* %P, align 2
|
||||
|
||||
%Q = getelementptr i8* %P, i32 1
|
||||
%1 = load i8* %Q, align 1
|
||||
ret i8 %1
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user