[PATCH] D45379: [LoopInterchange] Ignore debug intrinsics during legality checks.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 6 15:42:19 PDT 2018


aprantl added a comment.

This is generally great, I think the helper function would be useful outside of this source file, too.



================
Comment at: lib/Transforms/Scalar/LoopInterchange.cpp:82
+template <typename T>
+static auto skipDebugIntrinsics(iterator_range<T> Iter)
+    -> decltype(make_filter_range(Iter, isDebugIntrinsic)) {
----------------
This adapter should really be available in BasicBlock.h or somewhere more accessible if it doesn't exist already. Could you move it there (or elsewhere appropriate) and add a doxygen comment?


================
Comment at: lib/Transforms/Scalar/LoopInterchange.cpp:1000
+    for (Instruction &I :
+         skipDebugIntrinsics(make_range(BB->begin(), BB->end())))
       if (CallInst *CI = dyn_cast<CallInst>(&I)) {
----------------
I'm assuming that dbg intrinsic calls don't read memory, so this change may be a noop. Feel free to keep it for readability though.


https://reviews.llvm.org/D45379





More information about the llvm-commits mailing list