[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
Fri Jun 24 04:28:32 PDT 2022


skatkov updated this revision to Diff 439698.
skatkov added a comment.

After long offline conversation with Max, we came to conclusion that combineCheck case does not require logical and.
It based on the facts that all conditions in this case are nuw/nsw if first condition is true and the first condition nuw/nsw flags cannot be based on other conditions (due to its constant is minimal one) and can be safely hoisted before the guard as its poison flags (if they exist) are based on something else then on other conditions.

It would be good if someone could verify our conclusion. It looks like the area is very fragile.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128322/new/

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.439698.patch
Type: text/x-patch
Size: 22481 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220624/fc083234/attachment.bin>


More information about the llvm-commits mailing list