diff options
| author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-04-30 00:55:59 +0000 |
|---|---|---|
| committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-04-30 00:55:59 +0000 |
| commit | 47cf2affbdb8a8152b84965134282581692baace (patch) | |
| tree | 7f35f302fead07fd1a2695b9749d6e44e0d47d08 /llvm/test | |
| parent | 1befea2bdcb2514298441fd15adf89e65548faeb (diff) | |
| download | bcm5719-llvm-47cf2affbdb8a8152b84965134282581692baace.tar.gz bcm5719-llvm-47cf2affbdb8a8152b84965134282581692baace.zip | |
[LowerGuardIntrinsics] Keep track of !make.implicit metadata
If a guard call being lowered by LowerGuardIntrinsics has the
`!make.implicit` metadata attached, then reattach the metadata to the
branch in the resulting expanded form of the intrinsic. This allows us
to implement null checks as guards and still get the benefit of implicit
null checks.
llvm-svn: 268148
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/LowerGuardIntrinsic/basic.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LowerGuardIntrinsic/basic.ll b/llvm/test/Transforms/LowerGuardIntrinsic/basic.ll index ae696cf4269..ade24eb7b22 100644 --- a/llvm/test/Transforms/LowerGuardIntrinsic/basic.ll +++ b/llvm/test/Transforms/LowerGuardIntrinsic/basic.ll @@ -60,3 +60,15 @@ define i32 @f_zero_args(i1* %c_ptr) { ; CHECK: guarded: ; CHECK-NEXT: ret i32 500 } + +define i8 @f_with_make_implicit_md(i32* %ptr) { +; CHECK-LABEL: @f_with_make_implicit_md( +; CHECK: br i1 %notNull, label %guarded, label %deopt, !make.implicit !0 +; CHECK: deopt: +; CHECK-NEXT: %deoptcall = call i8 (...) @llvm.experimental.deoptimize.i8(i32 1) [ "deopt"(i32 1) ] +; CHECK-NEXT: ret i8 %deoptcall + + %notNull = icmp ne i32* %ptr, null + call void(i1, ...) @llvm.experimental.guard(i1 %notNull, i32 1) [ "deopt"(i32 1) ], !make.implicit !{} + ret i8 5 +} |

