[PATCH] D31331: [mips][msa] Truncation of vector elements for instructions creating ISD::SHL, ISD::SRL or ISD::SRA nodes
Stefan Maksimovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 31 06:06:18 PDT 2017
smaksimovic updated this revision to Diff 93624.
smaksimovic added a comment.
Hello, thanks for the comment.
Made a change introducing an ISD::AND node which is now used to truncate the vector elements which hold shift amounts regardless of the vector having constants or not.
One downside we're experiencing now is that although we produce the code that executes correctly, and.v instruction is generated in addition to sll, where and.v is superfluous since sll will handle both negative and those shift amounts that are larger by value than the vector element size correctly.
Ideally, we'd like the sll and and.v to be optimized away in case all of the operands are constant values.
Additionally, this could be restricted to -O2, since on lower optimization levels shift instructions are generated anyway, hence and.v will be redundant in that situation as well.
Any tips on handling these two issues?
https://reviews.llvm.org/D31331
Files:
lib/Target/Mips/MipsSEISelLowering.cpp
test/CodeGen/Mips/msa/3r-s.ll
test/CodeGen/Mips/msa/shift_constant_pool.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31331.93624.patch
Type: text/x-patch
Size: 18596 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170331/c35c6905/attachment.bin>
More information about the llvm-commits
mailing list