[PATCH] D93998: [InstSimplify] Fold out-of-bounds shift to poison

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 3 12:13:15 PST 2021


nikic created this revision.
nikic added reviewers: aqjune, spatel, lebedev.ri.
Herald added subscribers: arphaman, hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Make InstSimplify return poison rather than undef for out-of-bounds shifts, as specified by LandRef:

> If op2 is (statically or dynamically) equal to or larger than the number of bits in op1, this instruction returns a poison value.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93998

Files:
  llvm/lib/Analysis/InstructionSimplify.cpp
  llvm/test/Transforms/InstCombine/add-shl-sdiv-to-srem.ll
  llvm/test/Transforms/InstCombine/out-of-bounds-indexes.ll
  llvm/test/Transforms/InstCombine/phi-shifts.ll
  llvm/test/Transforms/InstCombine/shift.ll
  llvm/test/Transforms/InstSimplify/shift-knownbits.ll
  llvm/test/Transforms/InstSimplify/shift.ll
  llvm/test/Transforms/InstSimplify/undef.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93998.314298.patch
Type: text/x-patch
Size: 9146 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210103/5ffa551f/attachment.bin>


More information about the llvm-commits mailing list