Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ordering of LLVM Add instructions can change HVX codegen semantics #3203
It appears that changing the order of codegen for an Add node can alter the overall result of the pipeline when generating HVX code. My suspiction is a bug in LLVM (either in general or in the HVX backend), though I haven't entirely ruled out something in Halide's HVX-specific code.
Note that both output:
Now, edit Codegen_LLVM.cpp by changing the
Note that the third value is different (1764 instead of 1760); needless to say, the order of arguments to integer addition shouldn't be affecting the result.
(Note that at top-of-tree, the order of codegen is unspecified and at the mercy of how the C++ compiler decides to evaluate the arguments to
added a commit
Aug 10, 2018
referenced this issue
Aug 14, 2018
Narrowed this down to a bug in the software pipeliner in LLVM that was incorrectly fixing up the PHI nodes in the kernel of a software pipelined loop. A fix for this is in review here https://reviews.llvm.org/D51167