2017-02-13 07:28:06 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
[GVN] Initial check-in of a new global value numbering algorithm.
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
2016-12-23 00:03:48 +08:00
|
|
|
; RUN: opt < %s -newgvn -S | FileCheck %s
|
|
|
|
; PR2213
|
|
|
|
|
|
|
|
define i32* @f(i8* %x) {
|
2017-02-13 07:28:06 +08:00
|
|
|
; CHECK-LABEL: @f(
|
|
|
|
; CHECK-NEXT: entry:
|
|
|
|
; CHECK-NEXT: [[TMP:%.*]] = call i8* @m(i32 12)
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* [[TMP]] to i32*
|
|
|
|
; CHECK-NEXT: ret i32* [[TMP1]]
|
|
|
|
;
|
[GVN] Initial check-in of a new global value numbering algorithm.
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
2016-12-23 00:03:48 +08:00
|
|
|
entry:
|
2017-02-13 07:28:06 +08:00
|
|
|
%tmp = call i8* @m( i32 12 ) ; <i8*> [#uses=2]
|
|
|
|
%tmp1 = bitcast i8* %tmp to i32* ; <i32*> [#uses=0]
|
|
|
|
%tmp3 = bitcast i32* %tmp1 to i8*
|
|
|
|
%tmp2 = bitcast i8* %tmp3 to i32* ; <i32*> [#uses=0]
|
|
|
|
ret i32* %tmp2
|
[GVN] Initial check-in of a new global value numbering algorithm.
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
2016-12-23 00:03:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
declare i8* @m(i32)
|