[PATCH] D37017: [DAGCombiner] fold assertzexts separated by trunc

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 11:26:04 PDT 2017


spatel created this revision.
Herald added a subscriber: mcrosier.

If we have an AssertZext of a truncated value that has already been AssertZext'ed, we can assert on the wider source op to improve the zext-y knowledge.

This is an implementation of the change suggested in https://reviews.llvm.org/D36890 (and I think would obsolete that patch). Actually, I don't think the suggestion #1 that I made there is valid, but this achieves the same result in a safe way by matching the a larger pattern.

The fact that this only affects x86 makes me suspicious that x86 is doing something suboptimal to create these AssertZexts in the first place, but I'm not sure.


https://reviews.llvm.org/D37017

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/X86/bool-zext.ll
  test/CodeGen/X86/critical-edge-split-2.ll
  test/CodeGen/X86/fp128-select.ll
  test/CodeGen/X86/illegal-bitfield-loadstore.ll
  test/CodeGen/X86/mask-negated-bool.ll
  test/CodeGen/X86/negate-i1.ll
  test/CodeGen/X86/select_const.ll
  test/CodeGen/X86/sext-i1.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37017.112204.patch
Type: text/x-patch
Size: 10915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170822/d519b4fd/attachment.bin>


More information about the llvm-commits mailing list