summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Hexagon/MCTargetDesc
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-07-02 13:05:12 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-07-02 13:05:12 +0000
commit4d9d2cc77fb58c39e5386d1aeb8dba91b87e5199 (patch)
treeb14f46556e40fb07965338ef223a14e7e2302aa6 /llvm/lib/Target/Hexagon/MCTargetDesc
parentf040d8c0611996a9c1d0a74e11b7afa7b9710897 (diff)
downloadbcm5719-llvm-4d9d2cc77fb58c39e5386d1aeb8dba91b87e5199.tar.gz
bcm5719-llvm-4d9d2cc77fb58c39e5386d1aeb8dba91b87e5199.zip
[Hexagon] Create global std::map lazily.
This could of course be a simple binary search with no global state involved at all if someone cares enough. Just don't make everyone linking the hexagon backend pay for it on process startup and shutdown. llvm-svn: 274437
Diffstat (limited to 'llvm/lib/Target/Hexagon/MCTargetDesc')
-rw-r--r--llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCDuplexInfo.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCDuplexInfo.cpp b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCDuplexInfo.cpp
index e6194f61a6b..88336217cc8 100644
--- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCDuplexInfo.cpp
+++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCDuplexInfo.cpp
@@ -80,9 +80,6 @@ static const std::pair<unsigned, unsigned> opcodeData[] = {
std::make_pair((unsigned)V4_SS2_storewi0, 4096),
std::make_pair((unsigned)V4_SS2_storewi1, 4352)};
-static std::map<unsigned, unsigned>
- subinstOpcodeMap(std::begin(opcodeData), std::end(opcodeData));
-
bool HexagonMCInstrInfo::isDuplexPairMatch(unsigned Ga, unsigned Gb) {
switch (Ga) {
case HexagonII::HSIG_None:
@@ -587,6 +584,9 @@ bool HexagonMCInstrInfo::isOrderedDuplexPair(MCInstrInfo const &MCII,
unsigned MIaG = HexagonMCInstrInfo::getDuplexCandidateGroup(MIa),
MIbG = HexagonMCInstrInfo::getDuplexCandidateGroup(MIb);
+ static std::map<unsigned, unsigned> subinstOpcodeMap(std::begin(opcodeData),
+ std::end(opcodeData));
+
// If a duplex contains 2 insns in the same group, the insns must be
// ordered such that the numerically smaller opcode is in slot 1.
if ((MIaG != HexagonII::HSIG_None) && (MIaG == MIbG) && bisReversable) {
OpenPOWER on IntegriCloud