diff options
| author | Philip Reames <listmail@philipreames.com> | 2019-09-24 17:24:16 +0000 |
|---|---|---|
| committer | Philip Reames <listmail@philipreames.com> | 2019-09-24 17:24:16 +0000 |
| commit | d9629b88ff72927cac6494293e5a5501e504b222 (patch) | |
| tree | cfd952e1ab1f5313783325165a75039251aa3da2 /llvm/test | |
| parent | a7f27f357df8b199285b0d1882ea7eb47d39cd07 (diff) | |
| download | bcm5719-llvm-d9629b88ff72927cac6494293e5a5501e504b222.tar.gz bcm5719-llvm-d9629b88ff72927cac6494293e5a5501e504b222.zip | |
[GCRelocate] Add a peephole to canonicalize base pointer relocation
If we generate the gc.relocate, and then later prove two arguments to the statepoint are equivalent, we should canonicalize the gc.relocate to the form we would have produced if this had been known before rewriting.
llvm-svn: 372771
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/gc.relocate.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/gc.relocate.ll b/llvm/test/Transforms/InstCombine/gc.relocate.ll index 78b3b5f42f9..f8eade6f11f 100644 --- a/llvm/test/Transforms/InstCombine/gc.relocate.ll +++ b/llvm/test/Transforms/InstCombine/gc.relocate.ll @@ -52,6 +52,17 @@ entry: ret <2 x i8 addrspace(1)*> %obj.relocated } +define i32 addrspace(1)* @canonical_base(i32 addrspace(1)* %dparam) gc "statepoint-example" { +; Checks that a nonnull pointer +; CHECK-LABEL: @canonical_base +; CHECK: (token %tok, i32 7, i32 7) ; (%dparam, %dparam) +entry: + %tok = tail call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0, i32 addrspace(1)* %dparam, i32 addrspace(1)* %dparam) + %relocate = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(token %tok, i32 7, i32 8) + ret i32 addrspace(1)* %relocate +} + + declare void @do_safepoint() declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...) |

