swh:1:snp:70f530b74f5be73cfb71c212c9e3317ce44c1ebc
Revision 6d61433748e4322baae8ad6bcd211ae08cb03801 authored by Steven Johnson on 10 August 2018, 19:17:15 UTC, committed by Steven Johnson on 10 August 2018, 19:17:15 UTC
C++11 doesn't guarantee that function arguments are evaluated in a particular order, thus calls of the form `builder->CreateFoo(codegen(a), codegen(b))` might generate LLVM IR with either a-then-b or b-then-a; at best, this makes comparing IR between compilers a nuisance; at worst, it can trigger subtle bugs and make them harder to find (see https://github.com/halide/Halide/issues/3203). This PR looks for all calls that evalutate codegen() more than once as a function arg and rearranges code to use temporaries to ensure a well-defined order.

(Note that a few with only a single call to codegen() were also pulled into temporaries where I thought it improved clarity or helped forestall reinsertion of the bad code pattern by future edits.)
1 parent 8c2f090
History
Tip revision: 4e0b313fa7f6d3897f960dd322cfd13daed97c98 authored by Andrew Adams on 18 April 2024, 19:48:59 UTC
Rewrite IREquality to use a more compact stack instead of deep recursion (#8198)
Tip revision: 4e0b313
File Mode Size
apps
bazel
python_bindings
src
test
tools
tutorial
util
.clang-format -rw-r--r-- 1.4 KB
.gitignore -rw-r--r-- 1.0 KB
.travis.yml -rw-r--r-- 2.3 KB
CMakeLists.txt -rw-r--r-- 16.6 KB
Doxyfile -rw-r--r-- 103.6 KB
Doxyfile.in -rw-r--r-- 64.3 KB
LICENSE.txt -rw-r--r-- 1.1 KB
Makefile -rw-r--r-- 76.3 KB
README.md -rw-r--r-- 15.8 KB
README_cmake.md -rw-r--r-- 9.9 KB
README_rungen.md -rw-r--r-- 7.9 KB
halide.cmake -rw-r--r-- 28.7 KB

README.md

back to top