From: Krzysztof Parzyszek Date: Tue, 2 May 2017 18:03:08 +0000 (+0000) Subject: [Hexagon] Make sure duplexed dealloc_returns are checked for double jumps X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e6cd1e213813bfcff00b252a41e36a97dfe028d;p=llvm [Hexagon] Make sure duplexed dealloc_returns are checked for double jumps Patch by Colin LeMahieu. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301951 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp b/lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp index 4844862e6d1..2a3af20b35f 100644 --- a/lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp +++ b/lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp @@ -336,6 +336,14 @@ bool HexagonShuffler::check() { ++jumps; foundBranches.push_back(ISJ); } + if (HexagonMCInstrInfo::getDesc(MCII, Inst0).isReturn()) { + ++deallocs, ++jumps, ++jump1; // DEALLOC_RETURN is of type LD. + foundBranches.push_back(ISJ); + } + if (HexagonMCInstrInfo::getDesc(MCII, Inst1).isReturn()) { + ++deallocs, ++jumps, ++jump1; // DEALLOC_RETURN is of type LD. + foundBranches.push_back(ISJ); + } break; } } diff --git a/test/MC/Hexagon/dealloc-return-jump.s b/test/MC/Hexagon/dealloc-return-jump.s new file mode 100644 index 00000000000..0d480bef85d --- /dev/null +++ b/test/MC/Hexagon/dealloc-return-jump.s @@ -0,0 +1,7 @@ +# RUN: not llvm-mc -arch=hexagon -mcpu=hexagonv62 -filetype=obj -o - %s +# Check that a duplex involving dealloc_return is correctly checked +# dealloc_return cannot be involved in a double jump packet + +{ r0=add(r0,#-1) + p0=cmp.eq(r0,r0); if (p0.new) jump:nt 0 + if (p0) dealloc_return }