2015-09-16 02:32:14 +08:00
|
|
|
; RUN: opt -codegenprepare -S < %s | FileCheck %s
|
|
|
|
|
|
|
|
@tmp = global i8 0
|
|
|
|
|
|
|
|
; CHECK-LABEL: define void @foo() {
|
|
|
|
define void @foo() {
|
|
|
|
enter:
|
|
|
|
; CHECK-NOT: !invariant.group
|
2018-05-03 19:03:01 +08:00
|
|
|
; CHECK-NOT: @llvm.launder.invariant.group.p0i8(
|
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
2018-07-02 12:49:30 +08:00
|
|
|
; CHECK: %val = load i8, i8* @tmp{{$}}
|
|
|
|
%val = load i8, i8* @tmp, !invariant.group !0
|
2018-05-03 19:03:01 +08:00
|
|
|
%ptr = call i8* @llvm.launder.invariant.group.p0i8(i8* @tmp)
|
2015-09-16 02:32:14 +08:00
|
|
|
|
2018-05-19 07:53:46 +08:00
|
|
|
; CHECK: store i8 42, i8* @tmp{{$}}
|
2015-09-16 02:32:14 +08:00
|
|
|
store i8 42, i8* %ptr, !invariant.group !0
|
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
; CHECK-LABEL: }
|
|
|
|
|
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
2018-07-02 12:49:30 +08:00
|
|
|
; CHECK-LABEL: define void @foo2() {
|
|
|
|
define void @foo2() {
|
|
|
|
enter:
|
|
|
|
; CHECK-NOT: !invariant.group
|
|
|
|
; CHECK-NOT: @llvm.strip.invariant.group.p0i8(
|
|
|
|
; CHECK: %val = load i8, i8* @tmp{{$}}
|
|
|
|
%val = load i8, i8* @tmp, !invariant.group !0
|
|
|
|
%ptr = call i8* @llvm.strip.invariant.group.p0i8(i8* @tmp)
|
|
|
|
|
|
|
|
; CHECK: store i8 42, i8* @tmp{{$}}
|
|
|
|
store i8 42, i8* %ptr, !invariant.group !0
|
2015-09-16 02:32:14 +08:00
|
|
|
|
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
2018-07-02 12:49:30 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
; CHECK-LABEL: }
|
|
|
|
|
|
|
|
|
|
|
|
declare i8* @llvm.launder.invariant.group.p0i8(i8*)
|
|
|
|
declare i8* @llvm.strip.invariant.group.p0i8(i8*)
|
2018-05-19 07:53:46 +08:00
|
|
|
!0 = !{}
|