summaryrefslogtreecommitdiff
path: root/mlir/test/python/lib/PythonTestDialect.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-09-29 22:18:54 +0200
committerNikita Popov <nikita.ppv@gmail.com>2021-10-22 23:47:02 +0200
commit61cfdf636dc720c0af9d1ba42ead5aea8401d34b (patch)
tree9e7c404f1ef03c262b557626cb28315f41ff6a03 /mlir/test/python/lib/PythonTestDialect.cpp
parenta5a493e1920572ca78b77fcdaef68c26e96d25e7 (diff)
[BasicAA] Model implicit trunc of GEP indices
GEP indices larger than the GEP index size are implicitly truncated to the index size. BasicAA currently doesn't model this, resulting in incorrect alias analysis results. Fix this by explicitly modelling truncation in CastedValue in the same way we do zext and sext. Additionally we need to disable a number of optimizations for truncated values, in particular "non-zero" and "non-equal" may no longer hold after truncation. I believe the constant offset heuristic is also not necessarily correct for truncated values, but wasn't able to come up with a test for that one. A possible followup here would be to use the new mechanism to model explicit trunc as well (which should be much more common, as it is the canonical form). This is straightforward, but omitted here to separate the correctness fix from the analysis improvement. (Side note: While I say "index size" above, BasicAA currently uses the pointer size instead. Something for another day...) Differential Revision: https://reviews.llvm.org/D110977
Diffstat (limited to 'mlir/test/python/lib/PythonTestDialect.cpp')
0 files changed, 0 insertions, 0 deletions