The PPCCTRLoop pass has been moved to HardwareLoops,
so the comments and some useless code are deprecated now.
Details
- Reviewers
shchenz steven.zhang nemanjai - Group Reviewers
Restricted Project - Commits
- rGab6cb31642fd: [PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for clean-up. Some minor comments.
llvm/lib/Target/PowerPC/PPCCTRLoops.cpp | ||
---|---|---|
16 | Seems now we only need following headers: #include "MCTargetDesc/PPCMCTargetDesc.h" #include "PPC.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/InitializePasses.h" #include "llvm/Pass.h" #include "llvm/Support/Debug.h" #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFunctionPass.h" | |
43–44 | Since now all the function body is guarded under #ifndef NDEBUG, should we guard other headers as well? |
Update the NDEBUG
llvm/lib/Target/PowerPC/PPCCTRLoops.cpp | ||
---|---|---|
16 | The full include-list for /home/jji/llvm-project/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp: #include <vector> // for vector #include "MCTargetDesc/PPCMCTargetDesc.h" // for CTR, CTR8, BDNZ #include "PPC.h" // for createPPCCTRLoo... #include "llvm/ADT/SmallSet.h" // for SmallSet #include "llvm/ADT/SmallVector.h" // for SmallVector #include "llvm/ADT/StringRef.h" // for StringRef #include "llvm/ADT/ilist_iterator.h" // for operator!=, ope... #include "llvm/CodeGen/MachineBasicBlock.h" // for MachineBasicBlock #include "llvm/CodeGen/MachineDominators.h" // for MachineDominato... #include "llvm/CodeGen/MachineFunction.h" // for MachineFunction #include "llvm/CodeGen/MachineFunctionPass.h" // for MachineFunction... #include "llvm/CodeGen/MachineInstr.h" // for operator<<, Mac... #include "llvm/CodeGen/MachineInstrBundleIterator.h" // for MachineInstrBun... #include "llvm/CodeGen/MachineOperand.h" // for MachineOperand #include "llvm/CodeGen/Register.h" // for Register #include "llvm/InitializePasses.h" // for initializeMachi... #include "llvm/Pass.h" // for AnalysisUsage #include "llvm/PassRegistry.h" // for PassRegistry #include "llvm/Support/CodeGen.h" // for llvm #include "llvm/Support/Debug.h" // lines 40-40 #include "llvm/Support/ErrorHandling.h" // for llvm_unreachable #include "llvm/Support/GenericDomTreeConstruction.h" // for dbgs, LLVM_DEBUG #include "llvm/Support/Printable.h" // for operator<<, Pri... #include "llvm/Support/raw_ostream.h" // for raw_ostream --- This is the output of include what you use, some of the include may have been included in some other headers, I would prefer we keep this as we may want to reduce some include in headers as well later. |
LGTM.
llvm/lib/Target/PowerPC/PPCCTRLoops.cpp | ||
---|---|---|
11 | Complete passes that are only defined for non-NDEBUG builds are rare and I think a comment should explain what is going on here. Something like: CTR loops are produced by the HardwareLoops pass and this pass is simply a verification that no invalid CTR loops are produced. As such, it isn't something that needs to be run (or even defined) for Release builds so the entire file is guarded by NDEBUG. |
Complete passes that are only defined for non-NDEBUG builds are rare and I think a comment should explain what is going on here. Something like:
CTR loops are produced by the HardwareLoops pass and this pass is simply a verification that no invalid CTR loops are produced. As such, it isn't something that needs to be run (or even defined) for Release builds so the entire file is guarded by NDEBUG.