[PATCH] D62327: [X86][CodeGen][NFC] Delay `combineIncDecVector()` from DAGCombine to X86DAGToDAGISel

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 03:32:46 PDT 2019


lebedev.ri added inline comments.


================
Comment at: lib/Target/X86/X86ISelDAGToDAG.cpp:3449
+  APInt SplatVal;
+  if (!X86::isConstantSplat(OneVec, SplatVal) || !SplatVal.isOneValue())
+    return false;
----------------
craig.topper wrote:
> What happens to the constant pool value we already allocated. Does something recognize that is unused and not emit to the final assembly?
I believe so:
```
$ cat /tmp/test.ll 
define <16 x i8> @inc(<16 x i8> %x) {
  %r = add <16 x i8> %x, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
  ret <16 x i8> %r
}
$ ./bin/llc -o - /tmp/test.ll 
        .text
        .file   "test.ll"
        .globl  inc                     # -- Begin function inc
        .p2align        4, 0x90
        .type   inc, at function
inc:                                    # @inc
        .cfi_startproc
# %bb.0:
        pcmpeqd %xmm1, %xmm1
        psubb   %xmm1, %xmm0
        retq
.Lfunc_end0:
        .size   inc, .Lfunc_end0-inc
        .cfi_endproc
                                        # -- End function

        .section        ".note.GNU-stack","", at progbits

```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62327





More information about the llvm-commits mailing list