[llvm] [GVN] Invalidate ICF cache when clearing the instructions (PR #68145)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 5 02:03:11 PDT 2023
nikic wrote:
Somewhat reduced test case for `-passes=gvn`:
```llvm
declare void @_PyMem_RawFree() nounwind willreturn
define i64 @test(ptr %p) {
entry:
%a = alloca [2 x ptr], align 8
%a2 = getelementptr ptr, ptr %a, i64 1
call void null(ptr %a)
br i1 false, label %if, label %exit
if:
%p0 = load ptr, ptr %a, align 8
%p1 = load ptr, ptr %a2, align 8
br label %exit
exit:
store ptr @_PyMem_RawFree, ptr %p
%p2 = load ptr, ptr %a, align 8
%pgocount.i = load i64, ptr %p2, align 8
%fn = load ptr, ptr %p
tail call void %fn()
%res = load i64, ptr %a2, align 8
ret i64 %res
}
```
https://github.com/llvm/llvm-project/pull/68145
More information about the llvm-commits
mailing list