[PATCH] D48529: [DAGCombiner][X86][PowerPC][ARM][AMDGPU][Sparc] Replace (sub C, X) with (xor X, C) if there is no chance of a borrow during the subtraction.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 25 08:41:03 PDT 2018


arsenm added inline comments.


================
Comment at: test/CodeGen/AMDGPU/ds-sub-offset.ll:26
 ; GCN-DAG: v_lshlrev_b32_e32 [[SCALED:v[0-9]+]], 2, v0
-; CI-DAG: v_sub_i32_e32 [[NEG:v[0-9]+]], vcc, 0, [[SCALED]]
-; GFX9-DAG: v_sub_u32_e32 [[NEG:v[0-9]+]], 0, [[SCALED]]
+; GCN-DAG: v_xor_b32_e32 [[NEG:v[0-9]+]], 0xffff, [[SCALED]]
 ; GCN-DAG: v_mov_b32_e32 [[K:v[0-9]+]], 13
----------------
This is worse in terms of code size, so ideally there would be an undo-combine for this during selection


Repository:
  rL LLVM

https://reviews.llvm.org/D48529





More information about the llvm-commits mailing list