[PATCH] D58419: [GISel]: Allow G_EXTRACT_VEC_ELT's result to be larger the source element type
Aditya Nandakumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 19 17:18:09 PST 2019
aditya_nandakumar created this revision.
aditya_nandakumar added reviewers: arsenm, aemerson, dsanders, volkan, bogner, paquette, qcolombet.
Herald added a subscriber: wdng.
Herald added a project: LLVM.
It's quite inconvenient when dealing with G_EXTRACT_VEC_ELT of <4xs8>,0 where s8 is not legal in the target - typically one ends up with G_UNMERGE_VALUES + G_LSHR by 8 which expands to three instructions.
Instead allow the destination type to be larger than source scalar type and it's higher bits are any extended. This is similar to DAG's opcode.
Note - I couldn't really find a use in tree - so I added a unit test.
Repository:
rL LLVM
https://reviews.llvm.org/D58419
Files:
include/llvm/Target/GenericOpcodes.td
lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
lib/CodeGen/MachineVerifier.cpp
test/MachineVerifier/test_g_extract_vec_elt.mir
unittests/CodeGen/GlobalISel/MachineIRBuilderTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58419.187475.patch
Type: text/x-patch
Size: 4504 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190220/0a4644ca/attachment.bin>
More information about the llvm-commits
mailing list