Closed vgene closed 4 years ago
Fixed. A Noelle bug. Here's the diff.
diff --git a/src/basic_utilities/src/ScalarEvolutionReferenceTreeExpander.cpp b/src/basic_utilities/src/ScalarEvolutionReferenceTreeExpander.cpp
index 72a2f5f2..9ac0849b 100644
--- a/src/basic_utilities/src/ScalarEvolutionReferenceTreeExpander.cpp
+++ b/src/basic_utilities/src/ScalarEvolutionReferenceTreeExpander.cpp
@@ -72,12 +72,12 @@ std::pair<Value *, Value *> ReferenceTreeExpander::visitTwoOperands(const SCEVNA
currentNode = currentNodeHolder->getChildReference(0);
Value *LHS = visit(S->getOperand(0));
currentNode = currentNodeHolder->getChildReference(1);
- Value *RHS = visit(S->getOperand(0));
+ Value *RHS = visit(S->getOperand(1));
currentNode = currentNodeHolder;
if (!LHS || !RHS) {
- if (LHS) LHS->deleteValue();
- if (RHS) RHS->deleteValue();
+ //if (LHS) LHS->deleteValue();
+ //if (RHS) RHS->deleteValue();
return std::make_pair(nullptr, nullptr);
}
return std::make_pair(LHS, RHS);
Noelle has an extra layer around scev for IV. I still don’t understand what that is for. Especially why the deleteValue is necessary in general.
Swaption failed while trying to generate induction variable from Noelle. A SCEV of PHINode is not generated properly, segfault with
scev->dump()
. The first operand is a ConstantInt but the value's type context points to a bogus memory address.