[Hexagon] Remove unsafe load instructions that affect Stack Slot Coloring
authorSumanth Gundapaneni <sgundapa@codeaurora.org>
Mon, 14 Nov 2016 17:11:00 +0000 (17:11 +0000)
committerSumanth Gundapaneni <sgundapa@codeaurora.org>
Mon, 14 Nov 2016 17:11:00 +0000 (17:11 +0000)
commitd428cf8b5f5c1fce2034320e059894f136ea2c43
treecd842f9fac65a82e86b5b2114d34e578300f8c71
parent348ace2605501cc06286001e403641527c27c899
[Hexagon] Remove unsafe load instructions that affect Stack Slot Coloring

The Stack slot coloring pass removes a store that is followed by a load
that deal with the same stack slot. The function isLoadFromStackSlot
is supposed to consider the loads that have no side-effects. This
patch fixed the issue by removing the unsafe loads from this function
Eg:
%vreg0<def> = L2_loadruh_io <fi#15>, 0
S2_storeri_io <fi#15>, 0, %vreg0

In this case, we load an unsigned extended half word and store this in to
the same stack slot. The Stack slot coloring pass considers safe to remove
the store. This patch marked all the non-vector byte and half word loads as
unsafe.

llvm-svn: 286843
llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
llvm/test/CodeGen/Hexagon/dead-store-stack.ll [new file with mode: 0644]