Add assertions checking def dominates use. NFC.
This is also be caught by the function verifier, but disconnected from the place that produced it. Catch it already at creation to be able to reason more directly about the cause. llvm-svn: 261790
This commit is contained in:
parent
a9c846c4ee
commit
eac9726e8c
|
@ -403,6 +403,10 @@ void BlockGenerator::generateScalarLoads(ScopStmt &Stmt, ValueMapT &BBMap) {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto *Address = getOrCreateAlloca(*MA);
|
auto *Address = getOrCreateAlloca(*MA);
|
||||||
|
assert((!isa<Instruction>(Address) ||
|
||||||
|
DT.dominates(cast<Instruction>(Address)->getParent(),
|
||||||
|
Builder.GetInsertBlock())) &&
|
||||||
|
"Domination violation");
|
||||||
BBMap[MA->getBaseAddr()] =
|
BBMap[MA->getBaseAddr()] =
|
||||||
Builder.CreateLoad(Address, Address->getName() + ".reload");
|
Builder.CreateLoad(Address, Address->getName() + ".reload");
|
||||||
}
|
}
|
||||||
|
@ -435,6 +439,14 @@ void BlockGenerator::generateScalarStores(ScopStmt &Stmt, LoopToScevMapT <S,
|
||||||
auto *Address = getOrCreateAlloca(*MA);
|
auto *Address = getOrCreateAlloca(*MA);
|
||||||
|
|
||||||
Val = getNewValue(Stmt, Val, BBMap, LTS, L);
|
Val = getNewValue(Stmt, Val, BBMap, LTS, L);
|
||||||
|
assert((!isa<Instruction>(Val) ||
|
||||||
|
DT.dominates(cast<Instruction>(Val)->getParent(),
|
||||||
|
Builder.GetInsertBlock())) &&
|
||||||
|
"Domination violation");
|
||||||
|
assert((!isa<Instruction>(Address) ||
|
||||||
|
DT.dominates(cast<Instruction>(Address)->getParent(),
|
||||||
|
Builder.GetInsertBlock())) &&
|
||||||
|
"Domination violation");
|
||||||
Builder.CreateStore(Val, Address);
|
Builder.CreateStore(Val, Address);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1266,6 +1278,14 @@ void RegionGenerator::generateScalarStores(ScopStmt &Stmt, LoopToScevMapT <S,
|
||||||
|
|
||||||
Value *NewVal = getExitScalar(MA, LTS, BBMap);
|
Value *NewVal = getExitScalar(MA, LTS, BBMap);
|
||||||
Value *Address = getOrCreateAlloca(*MA);
|
Value *Address = getOrCreateAlloca(*MA);
|
||||||
|
assert((!isa<Instruction>(NewVal) ||
|
||||||
|
DT.dominates(cast<Instruction>(NewVal)->getParent(),
|
||||||
|
Builder.GetInsertBlock())) &&
|
||||||
|
"Domination violation");
|
||||||
|
assert((!isa<Instruction>(Address) ||
|
||||||
|
DT.dominates(cast<Instruction>(Address)->getParent(),
|
||||||
|
Builder.GetInsertBlock())) &&
|
||||||
|
"Domination violation");
|
||||||
Builder.CreateStore(NewVal, Address);
|
Builder.CreateStore(NewVal, Address);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue