[PATCH] D42251: [globalisel][legalizer] Adapt LegalizerInfo to support inter-type dependencies and other things.
Daniel Sanders via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 24 13:50:02 PST 2018
dsanders updated this revision to Diff 131343.
dsanders marked 2 inline comments as done.
dsanders added a comment.
Fix various review comments
It's now possible to declare multiple-opcodes together:
getActionDefinitions({G_ADD, G_SUB, G_MUL, G_AND, G_OR, G_XOR, G_SHL})
.legalFor({s32, s64, v2s32, v4s32, v2s64})
.clampScalar(0, s32, s64)
.widenScalarToNextPow2(0)
.clampNumElements(0, v2s32, v4s32)
.clampNumElements(0, v2s64, v2s64)
.moreElementsToNextPow2(0);
Aside from convenience, this is also a (very) slight improvement to
initialization time and doesn't measurably change run-time. In terms of
semantics, doing this is a promise that these opcodes are functionally
equivalent and will remain so.
Assertions check the following:
- The second opcode onwards are not already equivalent to an opcode other than the first one specified.
- The second opcode onwards do not already have definitions in case they are different from those of the first opcode.
- The second opcode onwards are not modified beyond that point.
https://reviews.llvm.org/D42251
Files:
include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
lib/CodeGen/GlobalISel/CMakeLists.txt
lib/CodeGen/GlobalISel/LegalityPredicates.cpp
lib/CodeGen/GlobalISel/LegalizeMutations.cpp
lib/CodeGen/GlobalISel/LegalizerInfo.cpp
lib/Target/AArch64/AArch64LegalizerInfo.cpp
unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42251.131343.patch
Type: text/x-patch
Size: 56320 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180124/aced7093/attachment.bin>
More information about the llvm-commits
mailing list