[Hexagon] Fix insertion point for pointer difference calculation
authorKrzysztof Parzyszek <kparzysz@quicinc.com>
Wed, 19 Oct 2022 21:14:48 +0000 (14:14 -0700)
committerKrzysztof Parzyszek <kparzysz@quicinc.com>
Wed, 19 Oct 2022 21:23:39 +0000 (14:23 -0700)
commite5d9ab08c39aa674def376dcffead2242a097536
tree39a2cb2661f59a2e3e49ae327d5067499e119ee1
parent5e12c183920b506f83b2a10205b4a26b17ca9115
[Hexagon] Fix insertion point for pointer difference calculation

HVC::calculatePointerDifference inserts temporary instructions for
simplification, and calulation of known bits. These instructions were
inserted at the end of a basic block (after the terminator), which
caused BB->getTerminator() to return nullptr. This, in turn, caused
a crash when a PHI instruction was examined in computeKnownBits.
llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp
llvm/test/CodeGen/Hexagon/autohvx/vector-align-terminator.ll [new file with mode: 0644]