[PATCH] D128155: [GuardWindening] Use freeze to widen using possible poison value.

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 19 23:20:53 PDT 2022


skatkov created this revision.
skatkov added reviewers: mkazantsev, apilipenko, reames.
Herald added a subscriber: hiraditya.
Herald added a project: All.
skatkov requested review of this revision.
Herald added a project: LLVM.

During the guard widening we can add a poison use in the first guard which
can result in undefined behavior which were not before due to this guard could
guards us from it.

To avoid this behavior we can use freeze instruction.


https://reviews.llvm.org/D128155

Files:
  llvm/lib/Transforms/Scalar/GuardWidening.cpp
  llvm/test/Transforms/GuardWidening/basic-loop.ll
  llvm/test/Transforms/GuardWidening/basic.ll
  llvm/test/Transforms/GuardWidening/basic_widenable_condition_guards.ll
  llvm/test/Transforms/GuardWidening/loop-schedule.ll
  llvm/test/Transforms/GuardWidening/mixed_guards.ll
  llvm/test/Transforms/GuardWidening/range-check-merging.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128155.438260.patch
Type: text/x-patch
Size: 91497 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220620/55db86e1/attachment.bin>


More information about the llvm-commits mailing list