[PATCH] D33958: [GlobalISel][X86] Support vector type G_MERGE_VALUES selection.

Igor Breger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 00:17:25 PDT 2017


igorb added inline comments.


================
Comment at: lib/Target/X86/X86InstructionSelector.cpp:902
+  MRI.setRegBank(DefReg, RegBank);
+  if (!emitInsertSubreg(DefReg, I.getOperand(1).getReg(), I, MRI, MF))
+    return false;
----------------
guyblank wrote:
> why not use G_INSERT for the first element as well?
For the first element i need to create G_INSERT undef, val
    %0(<8 x s32>) = IMPLICIT_DEF
    %1(<4 x s32>) = COPY %xmm1
    %2(<8 x s32>) = G_INSERT %0(<8 x s32>), %1(<4 x s32>), 0
That will be lowered to InsertSubreg. IMPLICIT_DEF  is dead code and doesn't get RegClass constrain so MachineVerifier fail.  In general case we have dead code elimination so this problem doesn't exist.


https://reviews.llvm.org/D33958





More information about the llvm-commits mailing list