[PATCH] D84584: GlobalISel: Implement bitcast action for G_INSERT_VECTOR_ELT
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 11 07:39:26 PDT 2020
arsenm closed this revision.
arsenm added a comment.
e2f1b48f867d9ed349b7520dea495717bca26f31
================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2555
+ Register CastVec = MIRBuilder.buildBitcast(CastTy, SrcVec).getReg(0);
+ if (NewNumElts < OldNumElts) {
+ if (NewEltSize % OldEltSize != 0)
----------------
aemerson wrote:
> Early exit if NewNumElts >= OldNumElts to save on indent?
I considered this, but this function is only half implemented. The >= case should also be here. I think early exit would make sense for the shorter case, but I'm not sure which one that would be without implementing it
================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2572
+ Register ExtractedElt = CastVec;
+ if (CastTy.isVector()) {
+ ExtractedElt = MIRBuilder.buildExtractVectorElement(NewEltTy, CastVec,
----------------
aemerson wrote:
> Unnecessary braces
This covers multiple lines
================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2583
+ Val, OffsetBits);
+ if (CastTy.isVector()) {
+ InsertedElt = MIRBuilder.buildInsertVectorElement(
----------------
aemerson wrote:
> same
Also covers multiple lines
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84584/new/
https://reviews.llvm.org/D84584
More information about the llvm-commits
mailing list