[Hexagon] Return the correct chain edge for i1 function calls
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Mon, 23 Oct 2017 19:35:25 +0000 (19:35 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Mon, 23 Oct 2017 19:35:25 +0000 (19:35 +0000)
commit6f06b6edff4eb63703875e2785c18eea5d83e55c
tree442580523cef98ab741a5c07af9fb4ba56cde9a9
parentfeafa1d7f01ee3ca8e33f14af729d962fea91308
[Hexagon] Return the correct chain edge for i1 function calls

In HexagonISelLowering, there is code to handle the case when
a function returns an i1 type. In this case, we need to generate
extra nodes to copy the result from R0 to a predicate register.

The code was returning the wrong value for the chain edge which
caused an assert "Wrong topological sorting" when converting the
instructions to MIs.

This patch fixes the problem by returning the chain for the final
copy.

Patch by Brendon Cahoon.

llvm-svn: 316367
llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
llvm/test/CodeGen/Hexagon/call-ret-i1.ll [new file with mode: 0644]