diff options
| author | Igor Laevsky <igmyrj@gmail.com> | 2016-05-04 14:55:36 +0000 |
|---|---|---|
| committer | Igor Laevsky <igmyrj@gmail.com> | 2016-05-04 14:55:36 +0000 |
| commit | fb1811d3a0b771ef0c340687d6d8ebcddde0aaef (patch) | |
| tree | 3dbdec73d0562dbc7d858bacf518fe1e41ac35e8 /llvm/test/Transforms/RewriteStatepointsForGC | |
| parent | ebb04b9eb614fb8ee59938b66400f77a785e156f (diff) | |
| download | bcm5719-llvm-fb1811d3a0b771ef0c340687d6d8ebcddde0aaef.tar.gz bcm5719-llvm-fb1811d3a0b771ef0c340687d6d8ebcddde0aaef.zip | |
[RS4GC] Use SetVector/MapVector instead of DenseSet/DenseMap to guarantee stable ordering
Goal of this change is to guarantee stable ordering of the statepoint arguments and other
newly inserted values such as gc.relocates. Previously we had explicit sorting in a couple
of places. However for unnamed values ordering was partial and overall we didn't have any
strong invariant regarding it. This change switches all data structures to use SetVector's
and MapVector's which provide possibility for deterministic iteration over them.
Explicit sorting is now redundant and was removed.
Differential Revision: http://reviews.llvm.org/D19669
llvm-svn: 268502
Diffstat (limited to 'llvm/test/Transforms/RewriteStatepointsForGC')
4 files changed, 7 insertions, 7 deletions
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-vector.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-vector.ll index 2ec82aa2557..3f507c0a77c 100644 --- a/llvm/test/Transforms/RewriteStatepointsForGC/base-vector.ll +++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-vector.ll @@ -7,9 +7,9 @@ define i64 addrspace(1)* @test(<2 x i64 addrspace(1)*> %vec, i32 %idx) gc "state ; CHECK: extractelement ; CHECK: statepoint ; CHECK: gc.relocate -; CHECK-DAG: ; (%base_ee, %base_ee) -; CHECK: gc.relocate ; CHECK-DAG: ; (%base_ee, %obj) +; CHECK: gc.relocate +; CHECK-DAG: ; (%base_ee, %base_ee) ; Note that the second extractelement is actually redundant here. A correct output would ; be to reuse the existing obj as a base since it is actually a base pointer. entry: diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/basics.ll b/llvm/test/Transforms/RewriteStatepointsForGC/basics.ll index 0b994a77404..967a804f7a1 100644 --- a/llvm/test/Transforms/RewriteStatepointsForGC/basics.ll +++ b/llvm/test/Transforms/RewriteStatepointsForGC/basics.ll @@ -35,8 +35,8 @@ entry: ; CHECK-LABEL: entry: ; CHECK-NEXT: getelementptr ; CHECK-NEXT: gc.statepoint -; CHECK-NEXT: %derived.relocated = call coldcc i8 addrspace(1)* ; CHECK-NEXT: %obj.relocated = call coldcc i8 addrspace(1)* +; CHECK-NEXT: %derived.relocated = call coldcc i8 addrspace(1)* ; CHECK-NEXT: load i8, i8 addrspace(1)* %derived.relocated ; CHECK-NEXT: load i8, i8 addrspace(1)* %obj.relocated ; Tests to make sure we visit both the taken and untaken predeccessor diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/rematerialize-derived-pointers.ll b/llvm/test/Transforms/RewriteStatepointsForGC/rematerialize-derived-pointers.ll index 3e0a9611e8b..c4ec2ce5bf7 100644 --- a/llvm/test/Transforms/RewriteStatepointsForGC/rematerialize-derived-pointers.ll +++ b/llvm/test/Transforms/RewriteStatepointsForGC/rematerialize-derived-pointers.ll @@ -76,10 +76,10 @@ entry: ; CHECK: addrspacecast i32* %ptr1 to i32 addrspace(1)* call void @do_safepoint() [ "deopt"() ] -; CHECK: %base.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token, i32 7, i32 7) -; CHECK: %base.relocated.casted = bitcast i8 addrspace(1)* %base.relocated to i32 addrspace(1)* -; CHECK: %ptr2.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token, i32 7, i32 8) +; CHECK: %ptr2.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token, i32 8, i32 7) ; CHECK: %ptr2.relocated.casted = bitcast i8 addrspace(1)* %ptr2.relocated to i32 addrspace(1)* +; CHECK: %base.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token, i32 8, i32 8) +; CHECK: %base.relocated.casted = bitcast i8 addrspace(1)* %base.relocated to i32 addrspace(1)* call void @use_obj32(i32 addrspace(1)* %base) call void @use_obj32(i32 addrspace(1)* %ptr2) ret void diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-format.ll b/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-format.ll index 557823fef42..029864e3efa 100644 --- a/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-format.ll +++ b/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-format.ll @@ -6,7 +6,7 @@ define i64 addrspace(1)* @test_invoke_format(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" personality i32 ()* @personality { ; CHECK-LABEL: @test_invoke_format( ; CHECK-LABEL: entry: -; CHECK: invoke token (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0, i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) +; CHECK: invoke token (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0, i64 addrspace(1)* %obj1, i64 addrspace(1)* %obj) entry: %ret_val = invoke i64 addrspace(1)* @callee(i64 addrspace(1)* %obj) to label %normal_return unwind label %exceptional_return |

