2
0

BasicTargetTransformInfo.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //===- BasicTargetTransformInfo.cpp - Basic target-independent TTI impl ---===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. /// \file
  10. /// This file provides the implementation of a basic TargetTransformInfo pass
  11. /// predicated on the target abstractions present in the target independent
  12. /// code generator. It uses these (primarily TargetLowering) to model as much
  13. /// of the TTI query interface as possible. It is included by most targets so
  14. /// that they can specialize only a small subset of the query space.
  15. ///
  16. //===----------------------------------------------------------------------===//
  17. #include "llvm/CodeGen/BasicTTIImpl.h"
  18. #include "llvm/Analysis/LoopInfo.h"
  19. #include "llvm/Analysis/TargetTransformInfo.h"
  20. #include "llvm/Analysis/TargetTransformInfoImpl.h"
  21. #include "llvm/CodeGen/Passes.h"
  22. #include "llvm/Support/CommandLine.h"
  23. #include <utility>
  24. using namespace llvm;
  25. #define DEBUG_TYPE "basictti"
  26. // This flag is used by the template base class for BasicTTIImpl, and here to
  27. // provide a definition.
  28. cl::opt<unsigned>
  29. llvm::PartialUnrollingThreshold("partial-unrolling-threshold", cl::init(0),
  30. cl::desc("Threshold for partial unrolling"),
  31. cl::Hidden);
  32. BasicTTIImpl::BasicTTIImpl(const TargetMachine *TM, Function &F)
  33. : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)),
  34. TLI(ST->getTargetLowering()) {}