[PATCH] D55851: Implement basic loop fusion pass

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 19 09:05:25 PDT 2019


Meinersbur added inline comments.


================
Comment at: llvm/trunk/lib/Transforms/Scalar/LoopFuse.cpp:324
+}
+#endif
+
----------------
rtereshin wrote:
> It appears that if both `NDEBUG` and `LLVM_ENABLE_DUMP` are defined, the function will be compiled in, but all `LLVM_DEBUG` macro eliminated. Resulting
> ```lang=c++
> static void
> printFusionCandidates(const FusionCandidateCollection &FusionCandidates) {
>   for (const auto &CandidateSet : FusionCandidates) {
>   }
> }
> ```
> produces an "unused variable" `CandidateSet` warning. We probably don't need to wrap anything in `LLVM_DEBUG` here.
> We probably don't need to wrap anything in LLVM_DEBUG here.

I agree, but for a different reason: 
All calls to printFusionCandidates are already wrapped by LLVM_DEBUG. The macro checks whether anything should be printed by checking the `-debug`/`-debug-only` cl::opt.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55851/new/

https://reviews.llvm.org/D55851





More information about the llvm-commits mailing list