SuccessChanges

Summary

  1. [WC] Fix a subtle bug in our definition of widenable branch (details)
  2. [JumpThreading] Factor out code to clone instructions (NFC) (details)
  3. [Orc] Fix iterator usage after remove (details)
Commit 686f449e3d4ecad6413427aef35557f5adac100c by listmail
[WC] Fix a subtle bug in our definition of widenable branch
We had a subtle, but nasty bug in our definition of a widenable branch,
and thus in the transforms which used that utility. Specifically, we
returned true for any branch which included a widenable condition within
it's condition, regardless of whether that widenable condition also had
other uses.
The problem is that the result of the WC() call is defined to be one
particular value. As such, all users must agree as to what that value
is. If we widen a branch without also updating *all other users* of the
WC in the same way, we have broken the required semantics.
Most of the textual diff is updating existing transforms not to leave
dead uses hanging around. They're largely NFC as the dead instructions
would be immediately deleted by other passes. The reason to make these
changes is so that the transforms preserve the widenable branch form.
In practice, we don't get bitten by this only because it isn't
profitable to CSE WC() calls and the lowering pass from guards uses
distinct WC calls per branch.
Differential Revision: https://reviews.llvm.org/D69916
The file was modifiedllvm/lib/Analysis/GuardUtils.cpp
The file was modifiedllvm/lib/Transforms/Scalar/GuardWidening.cpp
The file was modifiedllvm/lib/Transforms/Scalar/LoopPredication.cpp
The file was modifiedllvm/test/Transforms/GuardWidening/basic_widenable_condition_guards.ll
The file was modifiedllvm/test/Transforms/GuardWidening/mixed_guards.ll
The file was modifiedllvm/test/Transforms/SimplifyCFG/wc-widen-block.ll
Commit f0f73ed8b004d213a3710b7b850e09c5bbd8e93d by kazu
[JumpThreading] Factor out code to clone instructions (NFC)
Summary: This patch factors out code to clone instructions -- partly for
readability and partly to facilitate an upcoming patch of my own.
Reviewers: wmi
Subscribers: hiraditya, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69861
The file was modifiedllvm/lib/Transforms/Scalar/JumpThreading.cpp
The file was modifiedllvm/include/llvm/Transforms/Scalar/JumpThreading.h
Commit 007d173e2e0c29903bc17a9d5108f531a6f2ea4d by alexandre.ganea
[Orc] Fix iterator usage after remove
Differential Revision: https://reviews.llvm.org/D69805
The file was modifiedllvm/lib/ExecutionEngine/Orc/Core.cpp