return false;
}
+ // Check that there is no hardware loop related intrinsics in the loop.
+ for (auto *BB : L->getBlocks())
+ for (auto &I : *BB)
+ if (auto *Call = dyn_cast<IntrinsicInst>(&I))
+ if (Call->getIntrinsicID() == Intrinsic::set_loop_iterations ||
+ Call->getIntrinsicID() == Intrinsic::loop_decrement)
+ return false;
+
SmallVector<BasicBlock*, 4> ExitingBlocks;
L->getExitingBlocks(ExitingBlocks);
; Function Attrs: nounwind
declare ptr @halide_int64_to_string(ptr, ptr, i64, i32) #1
-;; FIXME: hardware loop should not be generated in the loop that already has a
-;; user defined hardware loop. Only one mtctr should be in the final assembly.
+;; Hardware loop should not be generated in the loop that already has a user
+;; defined hardware loop. Only one mtctr should be in the final assembly.
; CHECK-LABEL: halide_double_to_string
-; CHECK-COUNT-2: mtctr
+; CHECK-COUNT-1: mtctr
; Function Attrs: nounwind
define weak ptr @halide_double_to_string(ptr %dst, ptr %end, double %arg, i32 %scientific) #1 {