[PATCH] D72101: [InstCombine] replace undef elements in vector constant when doing icmp folds (PR44383)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 12:59:29 PST 2020


spatel created this revision.
spatel added reviewers: nlopes, lebedev.ri, regehr.
Herald added subscribers: hiraditya, mcrosier.
Herald added a project: LLVM.

As shown in P44383:
https://bugs.llvm.org/show_bug.cgi?id=44383
...we can't safely propagate a vector constant through this icmp fold if that vector constant contains undefined elements.

We know that each defined element of the constant is safe though, so find the first of those and replicate it into the formerly undef lanes.


https://reviews.llvm.org/D72101

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ne-to-icmp-ugt.ll
  llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sgt-to-icmp-sgt.ll
  llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-slt-to-icmp-sgt.ll
  llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ugt-to-icmp-ugt.ll
  llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ult-to-icmp-ugt.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72101.235928.patch
Type: text/x-patch
Size: 6839 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200102/203c5146/attachment.bin>


More information about the llvm-commits mailing list