summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/implicit-null-check-negative.ll
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-06-30 21:22:32 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-06-30 21:22:32 +0000
commit9c41a93e24880289837cb387dc78dc643edc9ec6 (patch)
treea03059fd480e461d157d000e66280c8431d09420 /llvm/test/CodeGen/X86/implicit-null-check-negative.ll
parent2b00f08620d99e49734a9cae8c14461912afbc47 (diff)
downloadbcm5719-llvm-9c41a93e24880289837cb387dc78dc643edc9ec6.tar.gz
bcm5719-llvm-9c41a93e24880289837cb387dc78dc643edc9ec6.zip
[FaultMaps] Let the frontend pre-select implicit null check candidates.
Summary: This change introduces a !make.implicit metadata that allows the frontend to pre-select the set of explicit null checks that will be considered for transformation into implicit null checks. The reason for not using profiling data instead of !make.implicit is explained in the change to `FaultMaps.rst`. Reviewers: atrick, reames, pgavlin, JosephTremoulet Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10824 llvm-svn: 241116
Diffstat (limited to 'llvm/test/CodeGen/X86/implicit-null-check-negative.ll')
-rw-r--r--llvm/test/CodeGen/X86/implicit-null-check-negative.ll20
1 files changed, 18 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/X86/implicit-null-check-negative.ll b/llvm/test/CodeGen/X86/implicit-null-check-negative.ll
index 02c3d6e57d1..8fbed9f7bee 100644
--- a/llvm/test/CodeGen/X86/implicit-null-check-negative.ll
+++ b/llvm/test/CodeGen/X86/implicit-null-check-negative.ll
@@ -10,7 +10,7 @@ define i32 @imp_null_check_load(i32* %x, i32* %y) {
%c = icmp eq i32* %x, null
; It isn't legal to move the load from %x from "not_null" to here --
; the store to %y could be aliasing it.
- br i1 %c, label %is_null, label %not_null
+ br i1 %c, label %is_null, label %not_null, !make.implicit !0
is_null:
ret i32 42
@@ -24,7 +24,7 @@ define i32 @imp_null_check_load(i32* %x, i32* %y) {
define i32 @imp_null_check_gep_load(i32* %x) {
entry:
%c = icmp eq i32* %x, null
- br i1 %c, label %is_null, label %not_null
+ br i1 %c, label %is_null, label %not_null, !make.implicit !0
is_null:
ret i32 42
@@ -36,3 +36,19 @@ define i32 @imp_null_check_gep_load(i32* %x) {
%t = load i32, i32* %x.gep
ret i32 %t
}
+
+define i32 @imp_null_check_load_no_md(i32* %x) {
+; This is fine, except it is missing the !make.implicit metadata.
+ entry:
+ %c = icmp eq i32* %x, null
+ br i1 %c, label %is_null, label %not_null
+
+ is_null:
+ ret i32 42
+
+ not_null:
+ %t = load i32, i32* %x
+ ret i32 %t
+}
+
+!0 = !{}
OpenPOWER on IntegriCloud