[PATCH] [SDAG] When performing post-legalize DAG combining, run the legalizer over each node in the worklist prior to combining.

Chandler Carruth chandlerc at gmail.com
Thu Jul 17 09:55:00 PDT 2014


Hi hfinkel, grosbach,

This allows the combiner to produce new nodes which need to go back
through legalization. This is particularly useful when generating
operands to target specific nodes in a post-legalize DAG combine where
the operands are significantly easier to express as pre-legalized
operations. My immediate use case will be PSHUFB formation where we need
to build a constant shuffle mask with a build_vector node.

This also refactors the relevant functionality in the legalizer to
support this, and updates relevant tests. I've spoken to the R600 folks
and these changes look like improvements. The avx512 change needs to be
investigated, I suspect there is a disagreement between the legalizer
and the DAG combiner there, but it seems a minor issue so leaving it to
be re-evaluated after this patch.

http://reviews.llvm.org/D4564

Files:
  include/llvm/CodeGen/SelectionDAG.h
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  test/CodeGen/R600/fp_to_sint.ll
  test/CodeGen/R600/fp_to_uint.ll
  test/CodeGen/R600/setcc-equivalent.ll
  test/CodeGen/X86/avx512-cmp.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4564.11583.patch
Type: text/x-patch
Size: 15763 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140717/0bfdfa0e/attachment.bin>


More information about the llvm-commits mailing list