Skip to content

Commit b055afe

Browse files
committed
[DA] remove Constraints class
1 parent 9d2b7ec commit b055afe

File tree

2 files changed

+34
-572
lines changed

2 files changed

+34
-572
lines changed

llvm/include/llvm/Analysis/DependenceAnalysis.h

Lines changed: 6 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -393,106 +393,6 @@ class DependenceInfo {
393393
unsigned char DirSet;
394394
};
395395

396-
/// Constraint - This private class represents a constraint, as defined
397-
/// in the paper
398-
///
399-
/// Practical Dependence Testing
400-
/// Goff, Kennedy, Tseng
401-
/// PLDI 1991
402-
///
403-
/// There are 5 kinds of constraint, in a hierarchy.
404-
/// 1) Any - indicates no constraint, any dependence is possible.
405-
/// 2) Line - A line ax + by = c, where a, b, and c are parameters,
406-
/// representing the dependence equation.
407-
/// 3) Distance - The value d of the dependence distance;
408-
/// 4) Point - A point <x, y> representing the dependence from
409-
/// iteration x to iteration y.
410-
/// 5) Empty - No dependence is possible.
411-
class Constraint {
412-
private:
413-
enum ConstraintKind { Empty, Point, Distance, Line, Any } Kind;
414-
ScalarEvolution *SE;
415-
const SCEV *A;
416-
const SCEV *B;
417-
const SCEV *C;
418-
const Loop *AssociatedSrcLoop;
419-
const Loop *AssociatedDstLoop;
420-
421-
public:
422-
/// isEmpty - Return true if the constraint is of kind Empty.
423-
bool isEmpty() const { return Kind == Empty; }
424-
425-
/// isPoint - Return true if the constraint is of kind Point.
426-
bool isPoint() const { return Kind == Point; }
427-
428-
/// isDistance - Return true if the constraint is of kind Distance.
429-
bool isDistance() const { return Kind == Distance; }
430-
431-
/// isLine - Return true if the constraint is of kind Line.
432-
/// Since Distance's can also be represented as Lines, we also return
433-
/// true if the constraint is of kind Distance.
434-
bool isLine() const { return Kind == Line || Kind == Distance; }
435-
436-
/// isAny - Return true if the constraint is of kind Any;
437-
bool isAny() const { return Kind == Any; }
438-
439-
/// getX - If constraint is a point <X, Y>, returns X.
440-
/// Otherwise assert.
441-
LLVM_ABI const SCEV *getX() const;
442-
443-
/// getY - If constraint is a point <X, Y>, returns Y.
444-
/// Otherwise assert.
445-
LLVM_ABI const SCEV *getY() const;
446-
447-
/// getA - If constraint is a line AX + BY = C, returns A.
448-
/// Otherwise assert.
449-
LLVM_ABI const SCEV *getA() const;
450-
451-
/// getB - If constraint is a line AX + BY = C, returns B.
452-
/// Otherwise assert.
453-
LLVM_ABI const SCEV *getB() const;
454-
455-
/// getC - If constraint is a line AX + BY = C, returns C.
456-
/// Otherwise assert.
457-
LLVM_ABI const SCEV *getC() const;
458-
459-
/// getD - If constraint is a distance, returns D.
460-
/// Otherwise assert.
461-
LLVM_ABI const SCEV *getD() const;
462-
463-
/// getAssociatedSrcLoop - Returns the source loop associated with this
464-
/// constraint.
465-
LLVM_ABI const Loop *getAssociatedSrcLoop() const;
466-
467-
/// getAssociatedDstLoop - Returns the destination loop associated with
468-
/// this constraint.
469-
LLVM_ABI const Loop *getAssociatedDstLoop() const;
470-
471-
/// setPoint - Change a constraint to Point.
472-
LLVM_ABI void setPoint(const SCEV *X, const SCEV *Y,
473-
const Loop *CurrentSrcLoop,
474-
const Loop *CurrentDstLoop);
475-
476-
/// setLine - Change a constraint to Line.
477-
LLVM_ABI void setLine(const SCEV *A, const SCEV *B, const SCEV *C,
478-
const Loop *CurrentSrcLoop,
479-
const Loop *CurrentDstLoop);
480-
481-
/// setDistance - Change a constraint to Distance.
482-
LLVM_ABI void setDistance(const SCEV *D, const Loop *CurrentSrcLoop,
483-
const Loop *CurrentDstLoop);
484-
485-
/// setEmpty - Change a constraint to Empty.
486-
LLVM_ABI void setEmpty();
487-
488-
/// setAny - Change a constraint to Any.
489-
LLVM_ABI void setAny(ScalarEvolution *SE);
490-
491-
/// dump - For debugging purposes. Dumps the constraint
492-
/// out to OS.
493-
LLVM_ABI void dump(raw_ostream &OS) const;
494-
};
495-
496396
/// Returns true if two loops have the Same iteration Space and Depth. To be
497397
/// more specific, two loops have SameSD if they are in the same nesting
498398
/// depth and have the same backedge count. SameSD stands for Same iteration
@@ -659,7 +559,7 @@ class DependenceInfo {
659559
/// If the dependence isn't proven to exist,
660560
/// marks the Result as inconsistent.
661561
bool testSIV(const SCEV *Src, const SCEV *Dst, unsigned &Level,
662-
FullDependence &Result, Constraint &NewConstraint) const;
562+
FullDependence &Result) const;
663563

664564
/// testRDIV - Tests the RDIV subscript pair (Src and Dst) for dependence.
665565
/// Things of the form [c1 + a1*i] and [c2 + a2*j]
@@ -689,7 +589,7 @@ class DependenceInfo {
689589
bool strongSIVtest(const SCEV *Coeff, const SCEV *SrcConst,
690590
const SCEV *DstConst, const Loop *CurrentSrcLoop,
691591
const Loop *CurrentDstLoop, unsigned Level,
692-
FullDependence &Result, Constraint &NewConstraint) const;
592+
FullDependence &Result) const;
693593

694594
/// weakCrossingSIVtest - Tests the weak-crossing SIV subscript pair
695595
/// (Src and Dst) for dependence.
@@ -703,8 +603,7 @@ class DependenceInfo {
703603
bool weakCrossingSIVtest(const SCEV *SrcCoeff, const SCEV *SrcConst,
704604
const SCEV *DstConst, const Loop *CurrentSrcLoop,
705605
const Loop *CurrentDstLoop, unsigned Level,
706-
FullDependence &Result,
707-
Constraint &NewConstraint) const;
606+
FullDependence &Result) const;
708607

709608
/// ExactSIVtest - Tests the SIV subscript pair
710609
/// (Src and Dst) for dependence.
@@ -718,8 +617,7 @@ class DependenceInfo {
718617
bool exactSIVtest(const SCEV *SrcCoeff, const SCEV *DstCoeff,
719618
const SCEV *SrcConst, const SCEV *DstConst,
720619
const Loop *CurrentSrcLoop, const Loop *CurrentDstLoop,
721-
unsigned Level, FullDependence &Result,
722-
Constraint &NewConstraint) const;
620+
unsigned Level, FullDependence &Result) const;
723621

724622
/// weakZeroSrcSIVtest - Tests the weak-zero SIV subscript pair
725623
/// (Src and Dst) for dependence.
@@ -734,8 +632,7 @@ class DependenceInfo {
734632
bool weakZeroSrcSIVtest(const SCEV *DstCoeff, const SCEV *SrcConst,
735633
const SCEV *DstConst, const Loop *CurrentSrcLoop,
736634
const Loop *CurrentDstLoop, unsigned Level,
737-
FullDependence &Result,
738-
Constraint &NewConstraint) const;
635+
FullDependence &Result) const;
739636

740637
/// weakZeroDstSIVtest - Tests the weak-zero SIV subscript pair
741638
/// (Src and Dst) for dependence.
@@ -750,8 +647,7 @@ class DependenceInfo {
750647
bool weakZeroDstSIVtest(const SCEV *SrcCoeff, const SCEV *SrcConst,
751648
const SCEV *DstConst, const Loop *CurrentSrcLoop,
752649
const Loop *CurrentDstLoop, unsigned Level,
753-
FullDependence &Result,
754-
Constraint &NewConstraint) const;
650+
FullDependence &Result) const;
755651

756652
/// exactRDIVtest - Tests the RDIV subscript pair for dependence.
757653
/// Things of the form [c1 + a*i] and [c2 + b*j],
@@ -871,37 +767,6 @@ class DependenceInfo {
871767
void findBoundsEQ(CoefficientInfo *A, CoefficientInfo *B, BoundInfo *Bound,
872768
unsigned K) const;
873769

874-
/// intersectConstraints - Updates X with the intersection
875-
/// of the Constraints X and Y. Returns true if X has changed.
876-
bool intersectConstraints(Constraint *X, const Constraint *Y);
877-
878-
/// findCoefficient - Given a linear SCEV,
879-
/// return the coefficient corresponding to specified loop.
880-
/// If there isn't one, return the SCEV constant 0.
881-
/// For example, given a*i + b*j + c*k, returning the coefficient
882-
/// corresponding to the j loop would yield b.
883-
const SCEV *findCoefficient(const SCEV *Expr, const Loop *TargetLoop) const;
884-
885-
/// zeroCoefficient - Given a linear SCEV,
886-
/// return the SCEV given by zeroing out the coefficient
887-
/// corresponding to the specified loop.
888-
/// For example, given a*i + b*j + c*k, zeroing the coefficient
889-
/// corresponding to the j loop would yield a*i + c*k.
890-
const SCEV *zeroCoefficient(const SCEV *Expr, const Loop *TargetLoop) const;
891-
892-
/// addToCoefficient - Given a linear SCEV Expr,
893-
/// return the SCEV given by adding some Value to the
894-
/// coefficient corresponding to the specified TargetLoop.
895-
/// For example, given a*i + b*j + c*k, adding 1 to the coefficient
896-
/// corresponding to the j loop would yield a*i + (b+1)*j + c*k.
897-
const SCEV *addToCoefficient(const SCEV *Expr, const Loop *TargetLoop,
898-
const SCEV *Value) const;
899-
900-
/// updateDirection - Update direction vector entry
901-
/// based on the current constraint.
902-
void updateDirection(Dependence::DVEntry &Level,
903-
const Constraint &CurConstraint) const;
904-
905770
/// Given a linear access function, tries to recover subscripts
906771
/// for each dimension of the array element access.
907772
bool tryDelinearize(Instruction *Src, Instruction *Dst,

0 commit comments

Comments
 (0)