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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 23 13:16:49 PDT 2019


arsenm added inline comments.


================
Comment at: test/CodeGen/AMDGPU/sub.v2i16.ll:329
 ; GFX9-NEXT:    s_waitcnt vmcnt(0)
-; GFX9-NEXT:    v_pk_sub_i16 v0, v0, 32
+; GFX9-NEXT:    v_pk_add_u16 v0, v0, s8
 ; GFX9-NEXT:    buffer_store_dword v0, off, s[4:7], 0
----------------
This is worse because it is no longer an inline immediate. We undo this already for the 32-bit case during selection:


// Undo sub x, c -> add x, -c canonicalization since c is more likely
// an inline immediate than -c.
// TODO: Also do for 64-bit.
def : GCNPat<
  (add i32:$src0, (i32 NegSubInlineConst32:$src1)),
  (S_SUB_I32 $src0, NegSubInlineConst32:$src1)
>;



Repository:
  rL LLVM

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

https://reviews.llvm.org/D62341





More information about the llvm-commits mailing list