summaryrefslogtreecommitdiff
path: root/mlir/test/python/lib/PythonTestDialect.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2021-10-24 12:39:26 -0700
committerPhilip Reames <listmail@philipreames.com>2021-10-24 14:42:03 -0700
commita461fa64bb37cffd73f683c74f6b0780379fc2ca (patch)
tree3bf8c71eea02d6f431d5ab5d698406dc722b0b48 /mlir/test/python/lib/PythonTestDialect.cpp
parent3c06ecaa1e8d0267fe67c1e5c8fa5f294de2aab8 (diff)
Treat branch on poison as immediate UB (under an off by default flag)
The LangRef clearly states that branching on a undef or poison value is immediate undefined behavior, but historically, we have not been consistent about implementing that interpretation in the optimizer. Historically, we used (in some cases) a more relaxed model which essentially looked for provable UB along both paths which was control dependent on the condition. However, we've never been 100% consistent here. For instance SCEV uses the strong model for increments which form AddRecs (and only addrecs). At the moment, the last big blocker for finally making this switch is enabling the fix landed in D106041. Loop unswitching (in it's classic form) is incorrect as it creates many "branch on poisons" when unswitching conditions originally unreachable within the loop. This change adds a flag to value tracking which allows to easily test the optimization potential of treating branch on poison as immediate UB. It's intended to help ease work on getting us finally through this transition and avoid multiple independent rediscovers of the same issues. Differential Revision: https://reviews.llvm.org/D112026
Diffstat (limited to 'mlir/test/python/lib/PythonTestDialect.cpp')
0 files changed, 0 insertions, 0 deletions