[PATCH] D84584: GlobalISel: Implement bitcast action for G_INSERT_VECTOR_ELT

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 22:44:47 PDT 2020


aemerson accepted this revision.
aemerson added a comment.
This revision is now accepted and ready to land.

Thanks for the helpful comments. LGTM with a few nits.



================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2555
+  Register CastVec = MIRBuilder.buildBitcast(CastTy, SrcVec).getReg(0);
+  if (NewNumElts < OldNumElts) {
+    if (NewEltSize % OldEltSize != 0)
----------------
Early exit if NewNumElts >= OldNumElts to save on indent?


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2572
+    Register ExtractedElt = CastVec;
+    if (CastTy.isVector()) {
+      ExtractedElt = MIRBuilder.buildExtractVectorElement(NewEltTy, CastVec,
----------------
Unnecessary braces


================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2583
+                                               Val, OffsetBits);
+    if (CastTy.isVector()) {
+      InsertedElt = MIRBuilder.buildInsertVectorElement(
----------------
same


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84584/new/

https://reviews.llvm.org/D84584



More information about the llvm-commits mailing list