[PATCH] D62341: [DAGCombine][X86][AArch64][AMDGPU][MIPS][PPC] (sub x, c) -> (add x, -c) vector edition.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 6 06:58:33 PDT 2019


lebedev.ri marked an inline comment as done.
lebedev.ri added a comment.

In D62341#1660798 <https://reviews.llvm.org/D62341#1660798>, @RKSimon wrote:

> For vectors this is a big increase in constant pool usage - are we sure we want to do this?


Could you be more specific please?
Are you thinking of the code where we previously reused the constant from `sub` in some other instruction, and now we won't?
One more issue i'm seeing is some load folding opportunities.



================
Comment at: llvm/test/CodeGen/X86/addsub-constant-folding.ll:460-463
+; X86-NEXT:    movdqa %xmm0, %xmm1
 ; X86-NEXT:    movdqu %xmm0, (%esp) # 16-byte Spill
-; X86-NEXT:    psubd {{\.LCPI.*}}, %xmm0
+; X86-NEXT:    movdqa {{.*#+}} xmm0 = [4294967288,4294967288,4294967288,4294967288]
+; X86-NEXT:    paddd %xmm1, %xmm0
----------------
FIXME: Sometimes using `sub` will allow to avoid extra load instruction.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62341





More information about the llvm-commits mailing list