File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,10 @@ class ASTVisitor : public RecursiveASTVisitor<ASTVisitor> {
150150 : nullptr ;
151151 };
152152 mGetInstructionFunction = [Matcher](Instruction *I) {
153- return cast<Instruction>((**Matcher)[I]);
153+ auto Instr = (**Matcher)[I];
154+ return Instr
155+ ? cast<Instruction>(Instr)
156+ : nullptr ;
154157 };
155158 }
156159
@@ -310,9 +313,14 @@ class ASTVisitor : public RecursiveASTVisitor<ASTVisitor> {
310313
311314 bool isSplittableDependence (Instruction *Read, Instruction *Write,
312315 const unsigned LoopDepth) const {
316+ const auto ServerWrite = mGetInstructionFunction (Write);
317+ const auto ServerRead = mGetInstructionFunction (Read);
318+ if (!ServerWrite || !ServerRead) {
319+ return false ;
320+ }
313321 // TODO: Probably true instead of false
314- const auto Dependence = mDependence -> depends (
315- mGetInstructionFunction (Write), mGetInstructionFunction (Read) , false );
322+ const auto Dependence =
323+ mDependence -> depends (ServerWrite, ServerRead , false );
316324 if (!Dependence) {
317325 return false ;
318326 }
You can’t perform that action at this time.
0 commit comments