LLVM: lib/Transforms/Scalar/LowerWidenableCondition.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
21
22using namespace llvm;
23
25
26
28 F.getParent(), Intrinsic::experimental_widenable_condition);
29 if (!WCDecl || WCDecl->use_empty())
30 return false;
31
34
35
36
37 for (auto *U : WCDecl->users())
39 if (CI->getFunction() == &F)
41
42 if (ToLower.empty())
43 return false;
44
45 for (auto *CI : ToLower) {
47 CI->eraseFromParent();
48 }
49 return true;
50}
51
static bool lowerWidenableCondition(Function &F)
Definition LowerWidenableCondition.cpp:24
This file defines the SmallVector class.
static LLVM_ABI ConstantInt * getTrue(LLVMContext &Context)
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
LLVM_ABI Function * getDeclarationIfExists(const Module *M, ID id)
Look up the Function declaration of the intrinsic id in the Module M and return it if it exists.
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast - Return the argument parameter cast to the specified type.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition LowerWidenableCondition.cpp:52