[PATCH] D72069: [NFC] Put implementation of releaseNode into header file

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 00:44:27 PST 2020


lkail added a comment.

Can you add more info about compilation errors and compiler version?



================
Comment at: llvm/include/llvm/CodeGen/MachineScheduler.h:762
+  void releaseNode(SUnit *SU, unsigned ReadyCycle, unsigned Idx = 0) {
+    releaseNodeImpl(SU, ReadyCycle, Idx, InPQueue);
+  }
----------------
I think adding an `Impl` method might break origin author's intention. With a template parameter, compiler can remove some dead branches at compile time.


================
Comment at: llvm/lib/CodeGen/MachineScheduler.cpp:2091
 
-template <bool InPQueue>
-void SchedBoundary::releaseNode(SUnit *SU, unsigned ReadyCycle, unsigned Idx) {
+void SchedBoundary::releaseNodeImpl(SUnit *SU, unsigned ReadyCycle,
+                                    unsigned Idx, bool InPQueue) {
----------------
Can template explicit instantiation help? By adding
```
template void SchedBoundary::releaseNode<true>(SUnit *SU, unsigned ReadyCycle,                                                                                                                 
                                               unsigned Idx);                                                                                                                                  
template void SchedBoundary::releaseNode<false>(SUnit *SU, unsigned ReadyCycle,                                                                                                                
                                                unsigned Idx);
```
before this line.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72069





More information about the llvm-commits mailing list