[PATCH] D30826: [DAG] vector div/rem with any zero element in divisor is undef

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 10 06:53:53 PST 2017


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

This is the backend counterpart to: 
https://reviews.llvm.org/rL297390
https://reviews.llvm.org/rL297409
and follow-up to:
https://reviews.llvm.org/rL297384

It surprised me that we need to duplicate the check in FoldConstantArithmetic and FoldConstantVectorArithmetic, but one or the other doesn't catch all of the test cases. There is an existing code comment about merging those someday. If we fix more cases like this to properly recognize undef (signed overflow in sdiv, oversized shifts, etc), we should fix the code structure or at least make a helper function to avoid repeating code.


https://reviews.llvm.org/D30826

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  test/CodeGen/X86/div-rem-simplify.ll
  test/CodeGen/X86/vec_sdiv_to_shift.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30826.91325.patch
Type: text/x-patch
Size: 4396 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170310/32f63087/attachment.bin>


More information about the llvm-commits mailing list