Summary: This is one of the initial commit of "RFC: Devirtualization v2" proposal: https://docs.google.com/document/d/16GVtCpzK8sIHNc2qZz6RN8amICNBtvjWUod2SujZVEo/edit?usp=sharing Reviewers: rsmith, amharc, kuhar, sanjoy Subscribers: arsenm, nhaehnle, javed.absar, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D45111 llvm-svn: 331448
25 lines
602 B
LLVM
25 lines
602 B
LLVM
; RUN: opt -codegenprepare -S < %s | FileCheck %s
|
|
|
|
@tmp = global i8 0
|
|
|
|
; CHECK-LABEL: define void @foo() {
|
|
define void @foo() {
|
|
enter:
|
|
; CHECK-NOT: !invariant.group
|
|
; CHECK-NOT: @llvm.launder.invariant.group.p0i8(
|
|
; CHECK: %val = load i8, i8* @tmp, !tbaa
|
|
%val = load i8, i8* @tmp, !invariant.group !0, !tbaa !{!1, !1, i64 0}
|
|
%ptr = call i8* @llvm.launder.invariant.group.p0i8(i8* @tmp)
|
|
|
|
; CHECK: store i8 42, i8* @tmp
|
|
store i8 42, i8* %ptr, !invariant.group !0
|
|
|
|
ret void
|
|
}
|
|
; CHECK-LABEL: }
|
|
|
|
declare i8* @llvm.launder.invariant.group.p0i8(i8*)
|
|
|
|
!0 = !{!"something"}
|
|
!1 = !{!"x", !0}
|