diff options
author | Daniel Sanders <daniel_l_sanders@apple.com> | 2018-02-13 23:02:44 +0000 |
---|---|---|
committer | Daniel Sanders <daniel_l_sanders@apple.com> | 2018-02-13 23:02:44 +0000 |
commit | 7fc87360e94e97bae91161cda79e3e4b1c108ffe (patch) | |
tree | ae4fa418b7c895a4d6d3ce5cc9cab0d6546f15a8 /llvm/lib | |
parent | 3ce76ad26f18443ea2c2733c75343976ecff43ce (diff) | |
download | bcm5719-llvm-7fc87360e94e97bae91161cda79e3e4b1c108ffe.tar.gz bcm5719-llvm-7fc87360e94e97bae91161cda79e3e4b1c108ffe.zip |
[globalisel][legalizerinfo] Follow up on post-commit review comments after r323681
* Document most API's
* Delete a useless function call
* Fix a discrepancy between the single and multi-opcode variants of
getActionDefinitions().
The multi-opcode variant now requires that more than one opcode is requested.
Previously it acted much like the single-opcode form but unnecessarily
enforced the requirements of the multi-opcode form.
llvm-svn: 325067
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp index 3b8eb103297..6b2c3644749 100644 --- a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp +++ b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp @@ -261,6 +261,10 @@ LegalizeRuleSet &LegalizerInfo::getActionDefinitionsBuilder( std::initializer_list<unsigned> Opcodes) { unsigned Representative = *Opcodes.begin(); + assert(Opcodes.begin() != Opcodes.end() && + Opcodes.begin() + 1 != Opcodes.end() && + "Initializer list must have at least two opcodes"); + for (auto I = Opcodes.begin() + 1, E = Opcodes.end(); I != E; ++I) aliasActionDefinitions(Representative, *I); diff --git a/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp b/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp index 16821fbe3d0..083047c3814 100644 --- a/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp @@ -240,7 +240,6 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST) { getActionDefinitionsBuilder(G_ATOMIC_CMPXCHG) .legalForCartesianProduct({s8, s16, s32, s64}, {p0}); } - getActionDefinitionsBuilder(G_ATOMIC_CMPXCHG); if (ST.hasLSE()) { for (auto Ty : {s8, s16, s32, s64}) { |