[PATCH] D123324: [VP] Explicitly map from VP intrinsic to ISD opcode
Fraser Cormack via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 7 10:17:33 PDT 2022
frasercrmck created this revision.
frasercrmck added reviewers: simoll, rogfer01, craig.topper.
Herald added subscribers: StephenFan, dexonsmith, hiraditya.
Herald added a project: All.
frasercrmck requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This patch aims to overcome an issue in these mappings where, when an ISD
node was registered with BEGIN_REGISTER_VP_SDNODE but outwidth the scope
of a pair of BEGIN_REGISTER_VP_INTRINSIC/END_REGISTER_VP_INTRINSIC
macros, the switch cases fell apart. This in particular happened with
VP_SETCC, where we'd end up with something along the lines of:
case Intrinsic::vp_fcmp:
break;
case Intrinsic::vp_icmp:
break;
ResOpc = ISD::VP_SETCC;
case Intrinsic::vp_store:
...
To remedy this, we introduce a special-purpose mapping macro which can
map any number of VP intrinsic opcodes to an ISD opcode.
As a result, we no longer need to special-case the mapping from vp.icmp
and vp.fcmp to VP_SETCC, as the new helper macro does it for us.
Thanks to @craig.topper for noticing this and to @rogfer01 for the idea.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D123324
Files:
llvm/include/llvm/IR/VPIntrinsics.def
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123324.421264.patch
Type: text/x-patch
Size: 6765 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220407/c5af0c39/attachment.bin>
More information about the llvm-commits
mailing list