[PATCH] D18944: [DAGCombiner] Fold xor/and/or (bitcast(A), bitcast(B)) -> bitcast(op (A, B)) anytime before LegalizeVectorOprs

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 10 08:19:56 PDT 2016


RKSimon created this revision.
RKSimon added reviewers: qcolombet, delena, spatel, andreadb.
RKSimon added a subscriber: llvm-commits.
RKSimon set the repository for this revision to rL LLVM.

xor/and/or (bitcast(A), bitcast(B)) -> bitcast(op (A,B)) was only being combined at the AfterLegalizeTypes stage, this patch permits the combine to occur anytime before then as well.

My aim with this to improve the ability to recognise bitmasks that can be coverted to shuffles.

Elena - I had to modify a number of AVX512 mask tests as the basic bitcast to/from scalar pattern was being stripped out preventing testing of the mmask bitops. By replacing the bitcasts with loads I can get almost the same result.

Repository:
  rL LLVM

http://reviews.llvm.org/D18944

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/X86/avx512-mask-op.ll
  test/CodeGen/X86/avx512-select.ll
  test/CodeGen/X86/avx512bw-mask-op.ll
  test/CodeGen/X86/avx512dq-mask-op.ll
  test/CodeGen/X86/vector-shuffle-128-v4.ll
  test/CodeGen/X86/vector-shuffle-128-v8.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18944.53179.patch
Type: text/x-patch
Size: 13755 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160410/cdaeba3c/attachment.bin>


More information about the llvm-commits mailing list