forked from OSchip/llvm-project
[FIX] Keep a copy of the Domain set in the SCEVAffinator
llvm-svn: 246397
This commit is contained in:
parent
2fc50df900
commit
b1e3bbb7c9
|
@ -30,8 +30,10 @@ SCEVAffinator::SCEVAffinator(Scop *S)
|
|||
: S(S), Ctx(S->getIslCtx()), R(S->getRegion()), SE(*S->getSE()) {}
|
||||
|
||||
SCEVAffinator::~SCEVAffinator() {
|
||||
for (const auto &CachedPair : CachedExpressions)
|
||||
for (const auto &CachedPair : CachedExpressions) {
|
||||
isl_pw_aff_free(CachedPair.second);
|
||||
isl_set_free(CachedPair.first.second);
|
||||
}
|
||||
}
|
||||
|
||||
__isl_give isl_pw_aff *SCEVAffinator::getPwAff(const SCEV *Expr,
|
||||
|
@ -50,11 +52,12 @@ __isl_give isl_pw_aff *SCEVAffinator::getPwAff(const SCEV *Expr,
|
|||
|
||||
__isl_give isl_pw_aff *SCEVAffinator::visit(const SCEV *Expr) {
|
||||
|
||||
auto Key = std::make_pair(Expr, Domain);
|
||||
auto Key = std::make_pair(Expr, isl_set_copy(Domain));
|
||||
isl_pw_aff *PWA = CachedExpressions[Key];
|
||||
|
||||
if (PWA)
|
||||
if (PWA) {
|
||||
isl_set_free(Domain);
|
||||
return isl_pw_aff_copy(PWA);
|
||||
}
|
||||
|
||||
// In case the scev is a valid parameter, we do not further analyze this
|
||||
// expression, but create a new parameter in the isl_pw_aff. This allows us
|
||||
|
|
Loading…
Reference in New Issue