[PATCH] D27466: [SLP] Fix sign-extends for type-shrinking

Matthew Simpson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 09:02:24 PST 2016


mssimpso created this revision.
mssimpso added reviewers: mzolotukhin, mkuper.
mssimpso added subscribers: llvm-commits, mcrosier.

This patch ensures the correct minimum bit width during type-shrinking. Previously when type-shrinking, we always sign-extended values back to their original width. However, if we are going to sign-extend, and the sign bit is unknown, we have to increase the minimum bit width by one bit so the sign-extend will fill the upper bits correctly. If the sign bit is known to be zero, we can perform a zero-extend instead. This should fix PR31243.

Reference: https://llvm.org/bugs/show_bug.cgi?id=31243


https://reviews.llvm.org/D27466

Files:
  lib/Transforms/Vectorize/SLPVectorizer.cpp
  test/Transforms/SLPVectorizer/X86/minimum-sizes.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27466.80434.patch
Type: text/x-patch
Size: 8769 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161206/8083c08b/attachment.bin>


More information about the llvm-commits mailing list