[PATCH] D128080: [SDAG] convert sub from (Pow2-1) constant into xor

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 01:22:05 PDT 2022


foad added inline comments.


================
Comment at: llvm/test/CodeGen/AMDGPU/ds-sub-offset.ll:112
 ; CI-NEXT:    v_lshlrev_b32_e32 v0, 2, v0
-; CI-NEXT:    v_sub_i32_e32 v0, vcc, 0, v0
+; CI-NEXT:    v_xor_b32_e32 v0, 0xffff, v0
 ; CI-NEXT:    v_mov_b32_e32 v1, 13
----------------
RKSimon wrote:
> spatel wrote:
> > This diff was called a code-size regression in D48529.
> @foad Is this still an issue? Not sure if its relevant, but does the loss of the offset:65535 compensate?
It's still a code size regression and the loss of the offset:65535 does not compensate. Also AMDGPU has a decent set of subrev instructions so I don't think this transform is of any use.


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

https://reviews.llvm.org/D128080



More information about the llvm-commits mailing list