[PATCH] D114375: [SLP]Fix emission of int division with some undef vector subelements.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 22 09:06:45 PST 2021


ABataev created this revision.
ABataev added reviewers: RKSimon, anton-afanasyev, dtemirbulatov, vporpo.
Herald added a subscriber: hiraditya.
ABataev requested review of this revision.
Herald added a project: LLVM.

If it is legal and profitable to vectorize integer division operations
and some of the operands are undefs, need to replace these undefs in the
vector operands elements with some actual values. Otherwise, such
division operations will be replaced by the vector poison values in the
instcombiner. It leads to incorrect llvm ir per https://llvm.org/docs/LangRef.html#poisonvalues. According to this document "Vector elements may be independently poisoned. Therefore, transforms on instructions such as shufflevector must be careful to propagate poison across values or elements only as allowed by the original code."


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114375

Files:
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/test/Transforms/SLPVectorizer/X86/arith-div-undef.ll
  llvm/test/Transforms/SLPVectorizer/X86/shrink_after_reorder2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114375.388942.patch
Type: text/x-patch
Size: 5814 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211122/4cd827e1/attachment.bin>


More information about the llvm-commits mailing list