[PATCH] D127073: [SLP] Treat undef as any other constant

Harald van Dijk via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 5 07:51:06 PDT 2022


hvdijk created this revision.
hvdijk added reviewers: ABataev, RKSimon, vporpo, nikic, nlopes, MaskRay.
hvdijk added a project: LLVM.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
hvdijk requested review of this revision.
Herald added a subscriber: llvm-commits.

vporpo's phi-undef-input.ll shows how we would build vectors with poison where we wanted undef. Rather than continuing to treat undef as a special case and fixing the handling of it, this change fixes the problem by limiting the special casing to poison. undef is now treated as any other constant, by selecting from a specific input, and preserved that way.

This is an alternative to D126939 <https://reviews.llvm.org/D126939>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127073

Files:
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/test/Transforms/SLPVectorizer/X86/broadcast_long.ll
  llvm/test/Transforms/SLPVectorizer/X86/diamond_broadcast_extra_shuffle.ll
  llvm/test/Transforms/SLPVectorizer/X86/extract-scalar-from-undef.ll
  llvm/test/Transforms/SLPVectorizer/X86/insert-shuffle.ll
  llvm/test/Transforms/SLPVectorizer/X86/matched-shuffled-entries.ll
  llvm/test/Transforms/SLPVectorizer/X86/partail.ll
  llvm/test/Transforms/SLPVectorizer/X86/phi-undef-input.ll
  llvm/test/Transforms/SLPVectorizer/X86/remark_extract_broadcast.ll
  llvm/test/Transforms/SLPVectorizer/X86/reused-undefs.ll
  llvm/test/Transforms/SLPVectorizer/X86/vectorize-widest-phis.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127073.434330.patch
Type: text/x-patch
Size: 27178 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220605/142ddb4d/attachment-0001.bin>


More information about the llvm-commits mailing list