mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Add support to indvars for optimizing sadd.with.overflow.
Split sadd.with.overflow into add + sadd.with.overflow to allow analysis and optimization. This should ideally be done after InstCombine, which can perform code motion (eventually indvars should run after all canonical instcombines). We want ISEL to recombine the add and the check, at least on x86. This is currently under an option for reducing live induction variables: -liv-reduce. The next step is reducing liveness of IVs that are live out of the overflow check paths. Once the related optimizations are fully developed, reviewed and tested, I do expect this to become default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197926 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
namespace llvm {
|
||||
|
||||
class CastInst;
|
||||
class DominatorTree;
|
||||
class IVUsers;
|
||||
class Loop;
|
||||
class LPPassManager;
|
||||
@@ -31,9 +32,25 @@ class ScalarEvolution;
|
||||
/// Interface for visiting interesting IV users that are recognized but not
|
||||
/// simplified by this utility.
|
||||
class IVVisitor {
|
||||
protected:
|
||||
const DominatorTree *DT;
|
||||
bool ShouldSplitOverflowIntrinsics;
|
||||
|
||||
virtual void anchor();
|
||||
public:
|
||||
IVVisitor(): DT(NULL), ShouldSplitOverflowIntrinsics(false) {}
|
||||
virtual ~IVVisitor() {}
|
||||
|
||||
const DominatorTree *getDomTree() const { return DT; }
|
||||
|
||||
bool shouldSplitOverflowInstrinsics() const {
|
||||
return ShouldSplitOverflowIntrinsics;
|
||||
}
|
||||
void setSplitOverflowIntrinsics() {
|
||||
ShouldSplitOverflowIntrinsics = true;
|
||||
assert(DT && "Splitting overflow intrinsics requires a DomTree.");
|
||||
}
|
||||
|
||||
virtual void visitCast(CastInst *Cast) = 0;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user