mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
bd0298b1e1
The code have been developed by Daniel Berlin over the years, and the new implementation goal is that of addressing shortcomings of the current GVN infrastructure, i.e. long compile time for large testcases, lack of phi predication, no load/store value numbering etc... The current code just implements the "core" GVN algorithm, although other pieces (load coercion, phi handling, predicate system) are already implemented in a branch out of tree. Once the core is stable, we'll start adding pieces on top of the base framework. The test currently living in test/Transform/NewGVN are a copy of the ones in GVN, with proper `XFAIL` (missing features in NewGVN). A flag will be added in a future commit to enable NewGVN, so that interested parties can exercise this code easily. Differential Revision: https://reviews.llvm.org/D26224 llvm-svn: 290346
31 lines
653 B
LLVM
31 lines
653 B
LLVM
; XFAIL: *
|
|
; RUN: opt -basicaa -newgvn -S %s | FileCheck %s
|
|
|
|
%MyStruct = type { i32, i32 }
|
|
define i8 @foo(i64 %in, i8* %arr) {
|
|
%addr = alloca %MyStruct
|
|
%dead = trunc i64 %in to i32
|
|
br i1 undef, label %next, label %tmp
|
|
|
|
tmp:
|
|
call void @bar()
|
|
br label %next
|
|
|
|
next:
|
|
%addr64 = bitcast %MyStruct* %addr to i64*
|
|
store i64 %in, i64* %addr64
|
|
br label %final
|
|
|
|
final:
|
|
%addr32 = getelementptr %MyStruct, %MyStruct* %addr, i32 0, i32 0
|
|
%idx32 = load i32, i32* %addr32
|
|
|
|
; CHECK: %resptr = getelementptr i8, i8* %arr, i32 %dead
|
|
%resptr = getelementptr i8, i8* %arr, i32 %idx32
|
|
%res = load i8, i8* %resptr
|
|
|
|
ret i8 %res
|
|
}
|
|
|
|
declare void @bar()
|