summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/GlobalOpt
diff options
context:
space:
mode:
authorPiotr Padlewski <piotr.padlewski@gmail.com>2018-07-02 04:49:30 +0000
committerPiotr Padlewski <piotr.padlewski@gmail.com>2018-07-02 04:49:30 +0000
commit5b3db45e8f4d2600c32e18b136a31457e31b7aed (patch)
treea69115753193ac7484d57a950a470fbca72437d1 /llvm/test/Transforms/GlobalOpt
parent53054141a70d40965b3056b03c4dcc704a4e0504 (diff)
downloadbcm5719-llvm-5b3db45e8f4d2600c32e18b136a31457e31b7aed.tar.gz
bcm5719-llvm-5b3db45e8f4d2600c32e18b136a31457e31b7aed.zip
Implement strip.invariant.group
Summary: This patch introduce new intrinsic - strip.invariant.group that was described in the RFC: Devirtualization v2 Reviewers: rsmith, hfinkel, nlopes, sanjoy, amharc, kuhar Subscribers: arsenm, nhaehnle, JDevlieghere, hiraditya, xbolva00, llvm-commits Differential Revision: https://reviews.llvm.org/D47103 Co-authored-by: Krzysztof Pszeniczny <krzysztof.pszeniczny@gmail.com> llvm-svn: 336073
Diffstat (limited to 'llvm/test/Transforms/GlobalOpt')
-rw-r--r--llvm/test/Transforms/GlobalOpt/invariant.group.ll (renamed from llvm/test/Transforms/GlobalOpt/invariant.group.barrier.ll)20
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/test/Transforms/GlobalOpt/invariant.group.barrier.ll b/llvm/test/Transforms/GlobalOpt/invariant.group.ll
index 9ae7e78b785..8a090cbd0d3 100644
--- a/llvm/test/Transforms/GlobalOpt/invariant.group.barrier.ll
+++ b/llvm/test/Transforms/GlobalOpt/invariant.group.ll
@@ -27,15 +27,15 @@ enter:
define void @_optimizable() {
enter:
%valptr = alloca i32
-
+
%val = call i32 @TheAnswerToLifeTheUniverseAndEverything()
store i32 %val, i32* @tmp
store i32 %val, i32* %valptr
-
+
%0 = bitcast i32* %valptr to i8*
%barr = call i8* @llvm.launder.invariant.group(i8* %0)
%1 = bitcast i8* %barr to i32*
-
+
%val2 = load i32, i32* %1
store i32 %val2, i32* @tmp2
ret void
@@ -43,30 +43,30 @@ enter:
; We can't step through launder.invariant.group here, because that would change
; this load in @usage_of_globals()
-; val = load i32, i32* %ptrVal, !invariant.group !0
-; into
+; val = load i32, i32* %ptrVal, !invariant.group !0
+; into
; %val = load i32, i32* @tmp3, !invariant.group !0
-; and then we could assume that %val and %val2 to be the same, which coud be
+; and then we could assume that %val and %val2 to be the same, which coud be
; false, because @changeTmp3ValAndCallBarrierInside() may change the value
; of @tmp3.
define void @_not_optimizable() {
enter:
store i32 13, i32* @tmp3, !invariant.group !0
-
+
%0 = bitcast i32* @tmp3 to i8*
%barr = call i8* @llvm.launder.invariant.group(i8* %0)
%1 = bitcast i8* %barr to i32*
-
+
store i32* %1, i32** @ptrToTmp3
store i32 42, i32* %1, !invariant.group !0
-
+
ret void
}
define void @usage_of_globals() {
entry:
%ptrVal = load i32*, i32** @ptrToTmp3
%val = load i32, i32* %ptrVal, !invariant.group !0
-
+
call void @changeTmp3ValAndCallBarrierInside()
%val2 = load i32, i32* @tmp3, !invariant.group !0
ret void;
OpenPOWER on IntegriCloud