[PATCH] D55448: [DAGCombiner] allow hoisting vector bitwise logic ahead of truncates

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 7 11:28:31 PST 2018


spatel created this revision.
spatel added reviewers: kparzysz, craig.topper, RKSimon.
Herald added subscribers: kristof.beyls, javed.absar, mcrosier.

The transform performs a bitwise logic op in a wider type followed by truncate when both inputs are truncated from the same source type:
logic_op (truncate x), (truncate y) --> truncate (logic_op x, y)

There are a bunch of other checks that should prevent doing this when it might be harmful.

We already do this for scalars. The vector limitation was shared with a check for the case when the operands are extended. I'm not sure if that limit is needed either, but that would be a separate patch.


https://reviews.llvm.org/D55448

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/ARM/setcc-logic.ll
  test/CodeGen/Hexagon/autohvx/bitwise-pred-128b.ll
  test/CodeGen/Hexagon/autohvx/bitwise-pred-64b.ll
  test/CodeGen/X86/avx512-select.ll
  test/CodeGen/X86/bitcast-and-setcc-128.ll
  test/CodeGen/X86/bitcast-and-setcc-256.ll
  test/CodeGen/X86/bitcast-and-setcc-512.ll
  test/CodeGen/X86/psubus.ll
  test/CodeGen/X86/vector-rotate-128.ll
  test/CodeGen/X86/vector-rotate-256.ll
  test/CodeGen/X86/vector-rotate-512.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55448.177254.patch
Type: text/x-patch
Size: 55664 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181207/c73a8af7/attachment.bin>


More information about the llvm-commits mailing list