File tree Expand file tree Collapse file tree 5 files changed +15
-1
lines changed
test/analysis/canonical_loop Expand file tree Collapse file tree 5 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -414,9 +414,10 @@ class CanonicalLoopLabeler : public MatchFinder::MatchCallback {
414414 std::get<4 >(Tuple) = &U;
415415 }
416416 } else if (isa<ConstantData>(Op) || isa<GlobalValue>(Op)) {
417+ if (!InductIdx.count (Op.getOperandNo ())) {
417418 std::get<3 >(Tuple) = Op;
418419 std::get<4 >(Tuple) = &U;
419- } else if ( auto Expr = dyn_cast<llvm::ConstantExpr>(Op)) {
420+ }
420421 } else {
421422 std::get<0 >(Tuple) = false ;
422423 return Tuple;
Original file line number Diff line number Diff line change @@ -18,3 +18,4 @@ canonical_loop_17
1818canonical_loop_18
1919global_1
2020global_2
21+ global_3
Original file line number Diff line number Diff line change 1+ int I ;
2+ void foo () {
3+ for (I = 0 ; I < 10 ; ++ I );
4+ }
5+ //CHECK: Printing analysis 'Canonical Form Loop Analysis' for function 'foo':
6+ //CHECK: loop at global_3.c:3:3 is semantically canonical
Original file line number Diff line number Diff line change 1+ plugin = TsarPlugin
2+
3+ sample = $name.c
4+ options = -print-only=canonical-loop -print-filename -use-analysis-server
5+ run = "$tsar $sample $options"
Original file line number Diff line number Diff line change @@ -18,3 +18,4 @@ canonical_loop_17: action=init
1818canonical_loop_18: action=init
1919global_1: action=init
2020global_2: action=init
21+ global_3: action=init
You can’t perform that action at this time.
0 commit comments