[PATCH] D73498: [NFC] Remove extra headers included in Loop Unroll and LoopUnrollAndJam files

Anh Tuyen Tran via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 15:28:04 PST 2020


anhtuyen updated this revision to Diff 243684.
anhtuyen added a comment.

Based on comments from Reid @rnk and Michael @Meinersbur about IWYU, I have used the tools and adjusted **removal/addition** of the headers to meet the IWYU ideas. I also decided not to include the suggested **llvm/IR/IntrinsicEnums.inc** b/c it caused build errors.

Please let me know if you have any suggestion/objection!

I attached the log here for quick reference

  /home/anhtuyen/BUILD/llvm-project/llvm/lib/Transforms/Utils/LoopUnroll.cpp should add these lines:
  #include <assert.h>                                   // for assert
  #include <algorithm>                                  // for remove, replace
  #include <type_traits>                                // for enable_if<>::type
  #include <vector>                                     // for vector
  #include "llvm/ADT/ArrayRef.h"                        // for ArrayRef
  #include "llvm/ADT/DenseMap.h"                        // for DenseMapBase
  #include "llvm/ADT/Optional.h"                        // for Optional
  #include "llvm/ADT/STLExtras.h"                       // for any_of
  #include "llvm/ADT/SetVector.h"                       // for SmallSetVector
  #include "llvm/ADT/SmallVector.h"                     // for SmallVector
  #include "llvm/ADT/StringRef.h"                       // for StringRef
  #include "llvm/ADT/Twine.h"                           // for operator+, Twine
  #include "llvm/ADT/ilist_iterator.h"                  // for operator!=, ili...
  #include "llvm/ADT/iterator_range.h"                  // for iterator_range
  #include "llvm/Analysis/DomTreeUpdater.h"             // for DomTreeUpdater
  #include "llvm/Analysis/LoopInfo.h"                   // for Loop, LoopInfo
  #include "llvm/Config/abi-breaking.h"                 // for llvm
  #include "llvm/IR/CFG.h"                              // for successors, pre...
  #include "llvm/IR/CallSite.h"                         // for CallSite
  #include "llvm/IR/Constants.h"                        // for ConstantInt
  #include "llvm/IR/DebugLoc.h"                         // for DebugLoc
  #include "llvm/IR/DiagnosticInfo.h"                   // for operator<<, Opt...
  #include "llvm/IR/Function.h"                         // for Function, Funct...
  #include "llvm/IR/Instruction.h"                      // for Instruction
  #include "llvm/IR/Instructions.h"                     // for BranchInst, PHI...
  #include "llvm/IR/IntrinsicEnums.inc"                 // for assume
  #include "llvm/IR/Metadata.h"                         // for MDNode, MDString
  #include "llvm/IR/Module.h"                           // for Module
  #include "llvm/IR/Use.h"                              // for Use
  #include "llvm/IR/User.h"                             // for User::op_range
  #include "llvm/IR/ValueHandle.h"                      // for WeakTrackingVH
  #include "llvm/IR/ValueMap.h"                         // for ValueMapIterato...
  #include "llvm/Support/Casting.h"                     // for dyn_cast, cast
  #include "llvm/Support/GenericDomTree.h"              // for DomTreeNodeBase
  #include "llvm/Support/MathExtras.h"                  // for GreatestCommonD...
  #include "llvm/Transforms/Utils/ValueMapper.h"        // for ValueToValueMapTy
  namespace llvm { class DataLayout; }
  namespace llvm { class Value; }
  
  /home/anhtuyen/BUILD/llvm-project/llvm/lib/Transforms/Utils/LoopUnroll.cpp should remove these lines:
  - #include "llvm/ADT/SmallPtrSet.h"  // lines 18-18
  - #include "llvm/IR/DataLayout.h"  // lines 26-26
  - #include "llvm/IR/LLVMContext.h"  // lines 30-30
  
  The full include-list for /home/anhtuyen/BUILD/llvm-project/llvm/lib/Transforms/Utils/LoopUnroll.cpp:
  #include <assert.h>                                   // for assert
  #include <algorithm>                                  // for remove, replace
  #include <type_traits>                                // for enable_if<>::type
  #include <vector>                                     // for vector
  #include "llvm/ADT/ArrayRef.h"                        // for ArrayRef
  #include "llvm/ADT/DenseMap.h"                        // for DenseMapBase
  #include "llvm/ADT/Optional.h"                        // for Optional
  #include "llvm/ADT/STLExtras.h"                       // for any_of
  #include "llvm/ADT/SetVector.h"                       // for SmallSetVector
  #include "llvm/ADT/SmallVector.h"                     // for SmallVector
  #include "llvm/ADT/Statistic.h"                       // for STATISTIC, Stat...
  #include "llvm/ADT/StringRef.h"                       // for StringRef
  #include "llvm/ADT/Twine.h"                           // for operator+, Twine
  #include "llvm/ADT/ilist_iterator.h"                  // for operator!=, ili...
  #include "llvm/ADT/iterator_range.h"                  // for iterator_range
  #include "llvm/Analysis/AssumptionCache.h"            // for AssumptionCache
  #include "llvm/Analysis/DomTreeUpdater.h"             // for DomTreeUpdater
  #include "llvm/Analysis/InstructionSimplify.h"        // for SimplifyInstruc...
  #include "llvm/Analysis/LoopInfo.h"                   // for Loop, LoopInfo
  #include "llvm/Analysis/LoopIterator.h"               // for LoopBlocksDFS
  #include "llvm/Analysis/OptimizationRemarkEmitter.h"  // for NV, Optimizatio...
  #include "llvm/Analysis/ScalarEvolution.h"            // for ScalarEvolution
  #include "llvm/Config/abi-breaking.h"                 // for llvm
  #include "llvm/IR/BasicBlock.h"                       // for BasicBlock, Bas...
  #include "llvm/IR/CFG.h"                              // for successors, pre...
  #include "llvm/IR/CallSite.h"                         // for CallSite
  #include "llvm/IR/Constants.h"                        // for ConstantInt
  #include "llvm/IR/DebugInfoMetadata.h"                // for DILocation
  #include "llvm/IR/DebugLoc.h"                         // for DebugLoc
  #include "llvm/IR/DiagnosticInfo.h"                   // for operator<<, Opt...
  #include "llvm/IR/Dominators.h"                       // for DominatorTree
  #include "llvm/IR/Function.h"                         // for Function, Funct...
  #include "llvm/IR/Instruction.h"                      // for Instruction
  #include "llvm/IR/Instructions.h"                     // for BranchInst, PHI...
  #include "llvm/IR/IntrinsicEnums.inc"                 // for assume
  #include "llvm/IR/IntrinsicInst.h"                    // for IntrinsicInst
  #include "llvm/IR/Metadata.h"                         // for MDNode, MDString
  #include "llvm/IR/Module.h"                           // for Module
  #include "llvm/IR/Use.h"                              // for Use
  #include "llvm/IR/User.h"                             // for User::op_range
  #include "llvm/IR/ValueHandle.h"                      // for WeakTrackingVH
  #include "llvm/IR/ValueMap.h"                         // for ValueMapIterato...
  #include "llvm/Support/Casting.h"                     // for dyn_cast, cast
  #include "llvm/Support/CommandLine.h"                 // for opt, init, desc
  #include "llvm/Support/Debug.h"                       // for dbgs, LLVM_DEBUG
  #include "llvm/Support/GenericDomTree.h"              // for DomTreeNodeBase
  #include "llvm/Support/MathExtras.h"                  // for GreatestCommonD...
  #include "llvm/Support/raw_ostream.h"                 // for raw_ostream
  #include "llvm/Transforms/Utils/BasicBlockUtils.h"    // for MergeBlockIntoP...
  #include "llvm/Transforms/Utils/Cloning.h"            // for CloneBasicBlock
  #include "llvm/Transforms/Utils/Local.h"              // for RecursivelyDele...
  #include "llvm/Transforms/Utils/LoopSimplify.h"       // for simplifyLoop
  #include "llvm/Transforms/Utils/LoopUtils.h"          // for formLCSSARecurs...
  #include "llvm/Transforms/Utils/SimplifyIndVar.h"     // for simplifyLoopIVs
  #include "llvm/Transforms/Utils/UnrollLoop.h"         // for UnrollLoopOptions
  #include "llvm/Transforms/Utils/ValueMapper.h"        // for ValueToValueMapTy
  namespace llvm { class DataLayout; }
  namespace llvm { class Value; }
  ---
  
  /home/anhtuyen/BUILD/llvm-project/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp should add these lines:
  #include <assert.h>                                   // for assert
  #include <memory>                                     // for unique_ptr
  #include <type_traits>                                // for enable_if<>::type
  #include <vector>                                     // for vector
  #include "llvm/ADT/ArrayRef.h"                        // for ArrayRef
  #include "llvm/ADT/DenseMap.h"                        // for DenseMap, Dense...
  #include "llvm/ADT/Optional.h"                        // for Optional
  #include "llvm/ADT/STLExtras.h"                       // for reverse
  #include "llvm/ADT/SmallVector.h"                     // for SmallVector
  #include "llvm/ADT/StringRef.h"                       // for StringRef
  #include "llvm/ADT/Twine.h"                           // for operator+, Twine
  #include "llvm/ADT/iterator_range.h"                  // for iterator_range
  #include "llvm/Analysis/DomTreeUpdater.h"             // for DomTreeUpdater
  #include "llvm/Analysis/LoopInfo.h"                   // for Loop, LoopInfo
  #include "llvm/Analysis/MustExecute.h"                // for SimpleLoopSafet...
  #include "llvm/Config/abi-breaking.h"                 // for llvm
  #include "llvm/IR/DebugLoc.h"                         // for DebugLoc
  #include "llvm/IR/DiagnosticInfo.h"                   // for operator<<, Opt...
  #include "llvm/IR/Function.h"                         // for Function, Funct...
  #include "llvm/IR/Instruction.h"                      // for Instruction
  #include "llvm/IR/Instructions.h"                     // for BranchInst, PHI...
  #include "llvm/IR/IntrinsicEnums.inc"                 // for assume
  #include "llvm/IR/Use.h"                              // for Use
  #include "llvm/IR/User.h"                             // for User::op_range
  #include "llvm/IR/Value.h"                            // for Value (ptr only)
  #include "llvm/IR/ValueHandle.h"                      // for WeakTrackingVH
  #include "llvm/IR/ValueMap.h"                         // for ValueMapIterato...
  #include "llvm/Support/Casting.h"                     // for cast, dyn_cast
  #include "llvm/Support/ErrorHandling.h"               // for llvm_unreachable
  #include "llvm/Support/GenericDomTree.h"              // for DominatorTreeBa...
  #include "llvm/Transforms/Utils/ValueMapper.h"        // for ValueToValueMapTy
  
  /home/anhtuyen/BUILD/llvm-project/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp should remove these lines:
  - #include "llvm/Analysis/InstructionSimplify.h"  // lines 18-18
  - #include "llvm/Analysis/LoopAnalysisManager.h"  // lines 19-19
  - #include "llvm/Analysis/LoopPass.h"  // lines 21-21
  - #include "llvm/Analysis/Utils/Local.h"  // lines 24-24
  - #include "llvm/IR/DataLayout.h"  // lines 26-26
  - #include "llvm/IR/LLVMContext.h"  // lines 30-30
  - #include "llvm/Transforms/Utils/LoopSimplify.h"  // lines 35-35
  - #include "llvm/Transforms/Utils/SimplifyIndVar.h"  // lines 37-37
  
  The full include-list for /home/anhtuyen/BUILD/llvm-project/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp:
  #include <assert.h>                                   // for assert
  #include <memory>                                     // for unique_ptr
  #include <type_traits>                                // for enable_if<>::type
  #include <vector>                                     // for vector
  #include "llvm/ADT/ArrayRef.h"                        // for ArrayRef
  #include "llvm/ADT/DenseMap.h"                        // for DenseMap, Dense...
  #include "llvm/ADT/Optional.h"                        // for Optional
  #include "llvm/ADT/STLExtras.h"                       // for reverse
  #include "llvm/ADT/SmallPtrSet.h"                     // for SmallPtrSet
  #include "llvm/ADT/SmallVector.h"                     // for SmallVector
  #include "llvm/ADT/Statistic.h"                       // for STATISTIC, Stat...
  #include "llvm/ADT/StringRef.h"                       // for StringRef
  #include "llvm/ADT/Twine.h"                           // for operator+, Twine
  #include "llvm/ADT/iterator_range.h"                  // for iterator_range
  #include "llvm/Analysis/AssumptionCache.h"            // for AssumptionCache
  #include "llvm/Analysis/DependenceAnalysis.h"         // for Dependence, Dep...
  #include "llvm/Analysis/DomTreeUpdater.h"             // for DomTreeUpdater
  #include "llvm/Analysis/LoopInfo.h"                   // for Loop, LoopInfo
  #include "llvm/Analysis/LoopIterator.h"               // for LoopBlocksDFS
  #include "llvm/Analysis/MustExecute.h"                // for SimpleLoopSafet...
  #include "llvm/Analysis/OptimizationRemarkEmitter.h"  // for NV, Optimizatio...
  #include "llvm/Analysis/ScalarEvolution.h"            // for ScalarEvolution
  #include "llvm/Config/abi-breaking.h"                 // for llvm
  #include "llvm/IR/BasicBlock.h"                       // for BasicBlock, Bas...
  #include "llvm/IR/DebugInfoMetadata.h"                // for DILocation
  #include "llvm/IR/DebugLoc.h"                         // for DebugLoc
  #include "llvm/IR/DiagnosticInfo.h"                   // for operator<<, Opt...
  #include "llvm/IR/Dominators.h"                       // for DominatorTree
  #include "llvm/IR/Function.h"                         // for Function, Funct...
  #include "llvm/IR/Instruction.h"                      // for Instruction
  #include "llvm/IR/Instructions.h"                     // for BranchInst, PHI...
  #include "llvm/IR/IntrinsicEnums.inc"                 // for assume
  #include "llvm/IR/IntrinsicInst.h"                    // for IntrinsicInst
  #include "llvm/IR/Use.h"                              // for Use
  #include "llvm/IR/User.h"                             // for User::op_range
  #include "llvm/IR/Value.h"                            // for Value (ptr only)
  #include "llvm/IR/ValueHandle.h"                      // for WeakTrackingVH
  #include "llvm/IR/ValueMap.h"                         // for ValueMapIterato...
  #include "llvm/Support/Casting.h"                     // for cast, dyn_cast
  #include "llvm/Support/Debug.h"                       // for dbgs, LLVM_DEBUG
  #include "llvm/Support/ErrorHandling.h"               // for llvm_unreachable
  #include "llvm/Support/GenericDomTree.h"              // for DominatorTreeBa...
  #include "llvm/Support/raw_ostream.h"                 // for raw_ostream
  #include "llvm/Transforms/Utils/BasicBlockUtils.h"    // for MergeBlockIntoP...
  #include "llvm/Transforms/Utils/Cloning.h"            // for CloneBasicBlock
  #include "llvm/Transforms/Utils/LoopUtils.h"          // for hasIterationCou...
  #include "llvm/Transforms/Utils/UnrollLoop.h"         // for simplifyLoopAft...
  #include "llvm/Transforms/Utils/ValueMapper.h"        // for ValueToValueMapTy
  ---
  
  /home/anhtuyen/BUILD/llvm-project/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h should add these lines:
  namespace llvm { class Function; }
  
  /home/anhtuyen/BUILD/llvm-project/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h should remove these lines:
  
  The full include-list for /home/anhtuyen/BUILD/llvm-project/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h:
  #include "llvm/IR/PassManager.h"  // for FunctionAnalysisManager, PassInfoMixin
  namespace llvm { class Function; }
  ---
  
  /home/anhtuyen/BUILD/llvm-project/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp should add these lines:
  #include <vector>                                     // for vector
  #include "llvm/ADT/ArrayRef.h"                        // for ArrayRef
  #include "llvm/ADT/Optional.h"                        // for Optional
  #include "llvm/ADT/PriorityWorklist.h"                // for SmallPriorityWo...
  #include "llvm/PassAnalysisSupport.h"                 // for AnalysisUsage
  #include "llvm/PassRegistry.h"                        // for PassRegistry
  #include "llvm/PassSupport.h"                         // for INITIALIZE_PASS...
  #include "llvm/Support/Compiler.h"                    // for llvm
  #include "llvm/Transforms/Utils/LoopSimplify.h"       // for simplifyLoop
  namespace llvm { class Instruction; }
  namespace llvm { class Value; }
  
  /home/anhtuyen/BUILD/llvm-project/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp should remove these lines:
  - #include <algorithm>  // lines 50-50
  - #include <string>  // lines 53-53
  - #include "llvm/ADT/STLExtras.h"  // lines 15-15
  - #include "llvm/Analysis/LoopPass.h"  // lines 23-23
  - #include "llvm/IR/CFG.h"  // lines 28-28
  - #include "llvm/IR/Constant.h"  // lines 29-29
  - #include "llvm/IR/Instruction.h"  // lines 33-33
  - #include "llvm/IR/IntrinsicInst.h"  // lines 35-35
  - #include "llvm/Support/ErrorHandling.h"  // lines 43-43
  - #include "llvm/Transforms/Scalar/LoopPassManager.h"  // lines 46-46
  - #include "llvm/Transforms/Utils.h"  // lines 47-47
  
  The full include-list for /home/anhtuyen/BUILD/llvm-project/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp:
  #include "llvm/Transforms/Scalar/LoopUnrollAndJamPass.h"
  #include <cassert>                                    // for assert
  #include <cstdint>                                    // for uint64_t
  #include <vector>                                     // for vector
  #include "llvm/ADT/ArrayRef.h"                        // for ArrayRef
  #include "llvm/ADT/None.h"                            // for None
  #include "llvm/ADT/Optional.h"                        // for Optional
  #include "llvm/ADT/PriorityWorklist.h"                // for SmallPriorityWo...
  #include "llvm/ADT/SmallPtrSet.h"                     // for SmallPtrSet
  #include "llvm/ADT/StringRef.h"                       // for StringRef
  #include "llvm/Analysis/AssumptionCache.h"            // for AssumptionAnalysis
  #include "llvm/Analysis/CodeMetrics.h"                // for CodeMetrics
  #include "llvm/Analysis/DependenceAnalysis.h"         // for DependenceAnalysis
  #include "llvm/Analysis/LoopAnalysisManager.h"        // for getLoopPassPres...
  #include "llvm/Analysis/LoopInfo.h"                   // for Loop, LoopAnalysis
  #include "llvm/Analysis/OptimizationRemarkEmitter.h"  // for OptimizationRem...
  #include "llvm/Analysis/ScalarEvolution.h"            // for ScalarEvolution
  #include "llvm/Analysis/TargetTransformInfo.h"        // for TargetTransform...
  #include "llvm/IR/BasicBlock.h"                       // for BasicBlock
  #include "llvm/IR/Constants.h"                        // for ConstantInt
  #include "llvm/IR/Dominators.h"                       // for DominatorTreeAn...
  #include "llvm/IR/Function.h"                         // for Function
  #include "llvm/IR/Instructions.h"                     // for LoadInst
  #include "llvm/IR/Metadata.h"                         // for MDNode, MDString
  #include "llvm/IR/PassManager.h"                      // for FunctionAnalysi...
  #include "llvm/InitializePasses.h"                    // for initializeAssum...
  #include "llvm/Pass.h"                                // for FunctionPass
  #include "llvm/PassAnalysisSupport.h"                 // for AnalysisUsage
  #include "llvm/PassRegistry.h"                        // for PassRegistry
  #include "llvm/PassSupport.h"                         // for INITIALIZE_PASS...
  #include "llvm/Support/Casting.h"                     // for dyn_cast
  #include "llvm/Support/CommandLine.h"                 // for opt, desc, init
  #include "llvm/Support/Compiler.h"                    // for llvm
  #include "llvm/Support/Debug.h"                       // for dbgs, LLVM_DEBUG
  #include "llvm/Support/raw_ostream.h"                 // for raw_ostream
  #include "llvm/Transforms/Scalar.h"                   // for createLoopUnrol...
  #include "llvm/Transforms/Utils/LoopSimplify.h"       // for simplifyLoop
  #include "llvm/Transforms/Utils/LoopUtils.h"          // for makeFollowupLoopID
  #include "llvm/Transforms/Utils/UnrollLoop.h"         // for LoopUnrollResult
  namespace llvm { class Instruction; }
  namespace llvm { class Value; }
  ---


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73498

Files:
  llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h
  llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
  llvm/lib/Transforms/Utils/LoopUnroll.cpp
  llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73498.243684.patch
Type: text/x-patch
Size: 7634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200210/2648ae9e/attachment.bin>


More information about the llvm-commits mailing list