OSDN Git Service

[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)
commit28b89d61a665dc5598e4b5be9647cb7270f5f63c
tree8f49809785398bb02c5b496a7cd6eddbea922649
parent0ff9becff330bb5a75aa9e2842b410682536a221
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286843 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Hexagon/HexagonInstrInfo.cpp
test/CodeGen/Hexagon/dead-store-stack.ll [new file with mode: 0644]