From 6cf07a80ff5ee8ef7dc336f954aae17c7e8d83d4 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 30 May 2012 18:32:23 +0000 Subject: Teach SCEV's icmp simplification logic that a-b == 0 is equivalent to a == b. This also required making recursive simplifications until nothing changes or a hard limit (currently 3) is hit. With the simplification in place indvars can canonicalize loops of the form for (unsigned i = 0; i < a-b; ++i) into for (unsigned i = 0; i != a-b; ++i) which used to fail because SCEV created a weird umax expr for the backedge taken count. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157701 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/ScalarEvolution.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/llvm/Analysis/ScalarEvolution.h') diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h index 8f87b58fe7..c213ade5e8 100644 --- a/include/llvm/Analysis/ScalarEvolution.h +++ b/include/llvm/Analysis/ScalarEvolution.h @@ -837,7 +837,8 @@ namespace llvm { /// bool SimplifyICmpOperands(ICmpInst::Predicate &Pred, const SCEV *&LHS, - const SCEV *&RHS); + const SCEV *&RHS, + unsigned Depth = 0); /// getLoopDisposition - Return the "disposition" of the given SCEV with /// respect to the given loop. -- cgit v1.2.3