summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InferFunctionAttrs
diff options
context:
space:
mode:
authorJohannes Doerfert <johannes@jdoerfert.de>2019-10-30 17:21:53 -0500
committerJohannes Doerfert <johannes@jdoerfert.de>2019-10-31 15:09:45 -0500
commiteb4f41dfe58fc88794e1e227935a6f972f1a50e4 (patch)
tree528a7ac76796d6bb6ec7a9464822fe3978faedaf /llvm/test/Transforms/InferFunctionAttrs
parent70ad617dd645a38abe501d2929172bc842914132 (diff)
downloadbcm5719-llvm-eb4f41dfe58fc88794e1e227935a6f972f1a50e4.tar.gz
bcm5719-llvm-eb4f41dfe58fc88794e1e227935a6f972f1a50e4.zip
[Attributor] Really use the executed-context
Before we did not follow casts and geps when we looked at the users of a pointer in the pointers must-be-executed-context. This caused us to fail to determine if it was accessed for sure. With this change we follow such users now. The above extension exposed problems in getKnownNonNullAndDerefBytesForUse which did not always check what the base pointer was. We also did not handle negative offsets as conservative as we have to without explicit loop handling. Finally, we should not derive a huge number if we access a pointer that was traversed backwards first. The problems exposed by this functional change are already tested in the existing test cases as is the functional change. Differential Revision: https://reviews.llvm.org/D69647
Diffstat (limited to 'llvm/test/Transforms/InferFunctionAttrs')
-rw-r--r--llvm/test/Transforms/InferFunctionAttrs/dereferenceable.ll8
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/test/Transforms/InferFunctionAttrs/dereferenceable.ll b/llvm/test/Transforms/InferFunctionAttrs/dereferenceable.ll
index 17c76f11d6c..25412051a7f 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/dereferenceable.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/dereferenceable.ll
@@ -8,9 +8,7 @@
define <4 x double> @PR21780(double* %ptr) {
; CHECK-LABEL: @PR21780(double* %ptr)
-; FIXME: this should be @PR21780(double* nonnull dereferenceable(32) %ptr)
-; trakcing use of GEP in Attributor would fix this problem.
-; ATTRIBUTOR-LABEL: @PR21780(double* nocapture nonnull readonly dereferenceable(8) %ptr)
+; ATTRIBUTOR-LABEL: @PR21780(double* nocapture nonnull readonly dereferenceable(32) %ptr)
; GEP of index 0 is simplified away.
%arrayidx1 = getelementptr inbounds double, double* %ptr, i64 1
@@ -33,9 +31,7 @@ define <4 x double> @PR21780(double* %ptr) {
define double @PR21780_only_access3_with_inbounds(double* %ptr) {
; CHECK-LABEL: @PR21780_only_access3_with_inbounds(double* %ptr)
-; FIXME: this should be @PR21780_only_access3_with_inbounds(double* nonnull dereferenceable(32) %ptr)
-; trakcing use of GEP in Attributor would fix this problem.
-; ATTRIBUTOR-LABEL: @PR21780_only_access3_with_inbounds(double* nocapture readonly %ptr)
+; ATTRIBUTOR-LABEL: @PR21780_only_access3_with_inbounds(double* nocapture nonnull readonly dereferenceable(32) %ptr)
%arrayidx3 = getelementptr inbounds double, double* %ptr, i64 3
%t3 = load double, double* %arrayidx3, align 8
OpenPOWER on IntegriCloud