https://github.com/halide/Halide
Revision 63cfd9daa3d3da08ef4bfbd42040faf8fda389fa authored by Andrew Adams on 12 October 2021, 20:52:24 UTC, committed by GitHub on 12 October 2021, 20:52:24 UTC
* Look through lets in find_intrinsics

If an Expr like: narrow((widen(x) + y + 1)/2) gets lifted into a let,
the simplifier will then substitute things in like so: let foo =
widen(x) + y in narrow(foo + 1)/2, potentially breaking a pattern. This
is a general problem for patterns that widen, do some math, and then
narrow.

They will always get cut at the widening operation, so this PR just
substitutes in all widening operations. This can't cause combinatorial
blow-up, because each substitution has a wider type than the values that
it depends on, so the chains can be at most 2-3 lets deep.

* Make substituting in widening lets a prepass instead

* Move find_intrinsics a little earlier in lowering

* Handle impure subexpressions

by leaving them behind at the original let site

* FindIntrinsics must be after the last simplification pass
1 parent a351021
History
Tip revision: 63cfd9daa3d3da08ef4bfbd42040faf8fda389fa authored by Andrew Adams on 12 October 2021, 20:52:24 UTC
Substitute in all widening lets prior to find_intrinsics (#6307)
Tip revision: 63cfd9d
File Mode Size
.github
apps
cmake
dependencies
doc
packaging
python_bindings
src
test
tools
tutorial
util
.clang-format -rw-r--r-- 1.4 KB
.clang-format-ignore -rw-r--r-- 265 bytes
.clang-tidy -rw-r--r-- 1.8 KB
.gitattributes -rw-r--r-- 342 bytes
.gitignore -rw-r--r-- 1.1 KB
.gitmodules -rw-r--r-- 0 bytes
CMakeLists.txt -rw-r--r-- 5.5 KB
CMakePresets.json -rw-r--r-- 5.2 KB
CODE_OF_CONDUCT.md -rw-r--r-- 3.5 KB
LICENSE.txt -rw-r--r-- 3.2 KB
Makefile -rw-r--r-- 101.0 KB
README.md -rw-r--r-- 16.5 KB
README_cmake.md -rw-r--r-- 69.3 KB
README_rungen.md -rw-r--r-- 12.1 KB
README_webassembly.md -rw-r--r-- 8.6 KB
run-clang-format.sh -rwxr-xr-x 1.4 KB
run-clang-tidy.sh -rwxr-xr-x 3.2 KB

README.md

back to top