[PATCH] D128322: [GuardWidening] Use logical and in widenCondCommon as it stated in doc

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 22:54:43 PDT 2022


skatkov created this revision.
skatkov added reviewers: mkazantsev, reames, apilipenko, nikic.
Herald added subscribers: mgrang, 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 protect us we could use logical and instead of arithmetic and as it states in
widenCondCommon.

This is alternative solution to https://reviews.llvm.org/D128155.
What worries me is that usage of select may break parseRangeChecks logic
where it expects arithmetic and to split already widened condition...


https://reviews.llvm.org/D128322

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: D128322.438919.patch
Type: text/x-patch
Size: 69080 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220622/88a98e6c/attachment-0001.bin>


More information about the llvm-commits mailing list