diff options
Diffstat (limited to 'gnu/llvm/lib/Analysis/DemandedBits.cpp')
| -rw-r--r-- | gnu/llvm/lib/Analysis/DemandedBits.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/gnu/llvm/lib/Analysis/DemandedBits.cpp b/gnu/llvm/lib/Analysis/DemandedBits.cpp index 9c53f9140ca..de7d21f9f13 100644 --- a/gnu/llvm/lib/Analysis/DemandedBits.cpp +++ b/gnu/llvm/lib/Analysis/DemandedBits.cpp @@ -1,4 +1,4 @@ -//===---- DemandedBits.cpp - Determine demanded bits ----------------------===// +//===- DemandedBits.cpp - Determine demanded bits -------------------------===// // // The LLVM Compiler Infrastructure // @@ -20,30 +20,41 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/DemandedBits.h" -#include "llvm/ADT/DepthFirstIterator.h" +#include "llvm/ADT/APInt.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Analysis/AssumptionCache.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/IR/BasicBlock.h" -#include "llvm/IR/CFG.h" +#include "llvm/IR/Constants.h" #include "llvm/IR/DataLayout.h" +#include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Dominators.h" #include "llvm/IR/InstIterator.h" -#include "llvm/IR/Instructions.h" +#include "llvm/IR/InstrTypes.h" +#include "llvm/IR/Instruction.h" #include "llvm/IR/IntrinsicInst.h" +#include "llvm/IR/Intrinsics.h" #include "llvm/IR/Module.h" #include "llvm/IR/Operator.h" +#include "llvm/IR/PassManager.h" +#include "llvm/IR/Type.h" +#include "llvm/IR/Use.h" #include "llvm/Pass.h" +#include "llvm/Support/Casting.h" #include "llvm/Support/Debug.h" #include "llvm/Support/KnownBits.h" #include "llvm/Support/raw_ostream.h" +#include <algorithm> +#include <cstdint> + using namespace llvm; #define DEBUG_TYPE "demanded-bits" char DemandedBitsWrapperPass::ID = 0; + INITIALIZE_PASS_BEGIN(DemandedBitsWrapperPass, "demanded-bits", "Demanded bits analysis", false, false) INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker) @@ -357,7 +368,7 @@ void DemandedBits::performAnalysis() { APInt DemandedBits::getDemandedBits(Instruction *I) { performAnalysis(); - const DataLayout &DL = I->getParent()->getModule()->getDataLayout(); + const DataLayout &DL = I->getModule()->getDataLayout(); auto Found = AliveBits.find(I); if (Found != AliveBits.end()) return Found->second; @@ -374,8 +385,8 @@ bool DemandedBits::isInstructionDead(Instruction *I) { void DemandedBits::print(raw_ostream &OS) { performAnalysis(); for (auto &KV : AliveBits) { - OS << "DemandedBits: 0x" << utohexstr(KV.second.getLimitedValue()) << " for " - << *KV.first << "\n"; + OS << "DemandedBits: 0x" << Twine::utohexstr(KV.second.getLimitedValue()) + << " for " << *KV.first << '\n'; } } |
