summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2015-04-06 15:29:26 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-04-06 15:29:29 +0000
commit684f5d3bf851733e99906e57f9998357ce8b77c0 (patch)
tree2f51c68488edb0d2bc9820bcfe96a95a912dd33f /driver
parent573617e392d05a04cb666f2ffd7e8c2869ced6b5 (diff)
parent9ba2911b6719b40a0d5dc6a901b40913da527fbb (diff)
downloadrs-684f5d3bf851733e99906e57f9998357ce8b77c0.tar.gz
Merge "Fix TBAA by inserting a distinct root node."
Diffstat (limited to 'driver')
-rw-r--r--driver/runtime/ll32/allocation.ll15
-rw-r--r--driver/runtime/ll64/allocation.ll15
2 files changed, 20 insertions, 10 deletions
diff --git a/driver/runtime/ll32/allocation.ll b/driver/runtime/ll32/allocation.ll
index c17c8438..1af9c89d 100644
--- a/driver/runtime/ll32/allocation.ll
+++ b/driver/runtime/ll32/allocation.ll
@@ -10,21 +10,26 @@ declare i8* @rsOffsetNs([1 x i32] %a.coerce, i32 %x, i32 %y, i32 %z)
; can never access the same memory element. This is different from C, where
; a char or uchar load/store is special as it can alias with about everything.
;
-; The TBAA tree in this file has the the node "RenderScript TBAA" as its root.
+; The TBAA tree in this file has the the node "RenderScript Distinct TBAA" as
+; its root.
; This means all loads/stores that share this common root can be proven to not
; alias. However, the alias analysis still has to assume MayAlias between
; memory accesses in this file and memory accesses annotated with the C/C++
; TBAA metadata.
+; A node named "RenderScript TBAA" wraps our distinct TBAA root node.
; If we can ensure that all accesses to elements loaded from RenderScript
; allocations are either annotated with the RenderScript TBAA information or
; not annotated at all, but never annotated with the C/C++ metadata, we
-; can add the RenderScript TBAA tree under the C/C++ TBAA tree. This enables
-; then the TBAA to prove that an access to data from the RenderScript allocation
+; can add the "RenderScript TBAA" tree under the C/C++ TBAA tree. This enables
+; TBAA to prove that an access to data from the RenderScript allocation
; does not alias with a load/store accessing something not part of a RenderScript
; allocation.
+; We do this by swapping the second operand of "RenderScript TBAA" with the node
+; for "Simple C/C++ TBAA", thus connecting these TBAA groups. The other root
+; node (with no children) can then safely be dropped from the analysis.
-
-!14 = !{!"RenderScript TBAA"}
+!13 = !{!"RenderScript Distinct TBAA"}
+!14 = !{!"RenderScript TBAA", !13}
!15 = !{!"allocation", !14}
!21 = !{!"char", !15}
diff --git a/driver/runtime/ll64/allocation.ll b/driver/runtime/ll64/allocation.ll
index 14f8e265..a956bb23 100644
--- a/driver/runtime/ll64/allocation.ll
+++ b/driver/runtime/ll64/allocation.ll
@@ -12,21 +12,26 @@ declare i8* @rsOffsetNs(%struct.rs_allocation* nocapture readonly %a, i32 %x, i3
; can never access the same memory element. This is different from C, where
; a char or uchar load/store is special as it can alias with about everything.
;
-; The TBAA tree in this file has the the node "RenderScript TBAA" as its root.
+; The TBAA tree in this file has the the node "RenderScript Distinct TBAA" as
+; its root.
; This means all loads/stores that share this common root can be proven to not
; alias. However, the alias analysis still has to assume MayAlias between
; memory accesses in this file and memory accesses annotated with the C/C++
; TBAA metadata.
+; A node named "RenderScript TBAA" wraps our distinct TBAA root node.
; If we can ensure that all accesses to elements loaded from RenderScript
; allocations are either annotated with the RenderScript TBAA information or
; not annotated at all, but never annotated with the C/C++ metadata, we
-; can add the RenderScript TBAA tree under the C/C++ TBAA tree. This enables
-; then the TBAA to prove that an access to data from the RenderScript allocation
+; can add the "RenderScript TBAA" tree under the C/C++ TBAA tree. This enables
+; TBAA to prove that an access to data from the RenderScript allocation
; does not alias with a load/store accessing something not part of a RenderScript
; allocation.
+; We do this by swapping the second operand of "RenderScript TBAA" with the node
+; for "Simple C/C++ TBAA", thus connecting these TBAA groups. The other root
+; node (with no children) can then safely be dropped from the analysis.
-
-!14 = !{!"RenderScript TBAA"}
+!13 = !{!"RenderScript Distinct TBAA"}
+!14 = !{!"RenderScript TBAA", !13}
!15 = !{!"allocation", !14}
!21 = !{!"char", !15}