1 //===- LowerConstantIntrinsics.h - Lower constant int. pass -*- C++ -*-========//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 /// The header file for the LowerConstantIntrinsics pass as used by the new pass
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_TRANSFORMS_SCALAR_LOWERCONSTANTINTRINSICS_H
16 #define LLVM_TRANSFORMS_SCALAR_LOWERCONSTANTINTRINSICS_H
18 #include "llvm/IR/Function.h"
19 #include "llvm/IR/PassManager.h"
23 struct LowerConstantIntrinsicsPass
:
24 PassInfoMixin
<LowerConstantIntrinsicsPass
> {
26 explicit LowerConstantIntrinsicsPass() {}
28 /// Run the pass over the function.
30 /// This will lower all remaining 'objectsize' and 'is.constant'`
31 /// intrinsic calls in this function, even when the argument has no known
32 /// size or is not a constant respectively. The resulting constant is
33 /// propagated and conditional branches are resolved where possible.
34 /// This complements the Instruction Simplification and
35 /// Instruction Combination passes of the optimized pass chain.
36 PreservedAnalyses
run(Function
&F
, FunctionAnalysisManager
&);