LLVM
17.0.0git
include
llvm
Transforms
Scalar
MakeGuardsExplicit.h
Go to the documentation of this file.
1
//===-- MakeGuardsExplicit.h - Turn guard intrinsics into guard branches --===//
2
//
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
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This pass lowers the @llvm.experimental.guard intrinsic to the new form of
10
// guard represented as widenable explicit branch to the deopt block. The
11
// difference between this pass and LowerGuardIntrinsic is that after this pass
12
// the guard represented as intrinsic:
13
//
14
// call void(i1, ...) @llvm.experimental.guard(i1 %old_cond) [ "deopt"() ]
15
//
16
// transforms to a guard represented as widenable explicit branch:
17
//
18
// %widenable_cond = call i1 @llvm.experimental.widenable.condition()
19
// br i1 (%old_cond & %widenable_cond), label %guarded, label %deopt
20
//
21
// Here:
22
// - The semantics of @llvm.experimental.widenable.condition allows to replace
23
// %widenable_cond with the construction (%widenable_cond & %any_other_cond)
24
// without loss of correctness;
25
// - %guarded is the lower part of old guard intrinsic's parent block split by
26
// the intrinsic call;
27
// - %deopt is a block containing a sole call to @llvm.experimental.deoptimize
28
// intrinsic.
29
//
30
// Therefore, this branch preserves the property of widenability.
31
//
32
//===----------------------------------------------------------------------===//
33
#ifndef LLVM_TRANSFORMS_SCALAR_MAKEGUARDSEXPLICIT_H
34
#define LLVM_TRANSFORMS_SCALAR_MAKEGUARDSEXPLICIT_H
35
36
#include "
llvm/IR/PassManager.h
"
37
38
namespace
llvm
{
39
40
struct
MakeGuardsExplicitPass
:
public
PassInfoMixin
<MakeGuardsExplicitPass> {
41
PreservedAnalyses
run
(
Function
&
F
,
FunctionAnalysisManager
&AM);
42
};
43
44
}
// namespace llvm
45
46
#endif // LLVM_TRANSFORMS_SCALAR_MAKEGUARDSEXPLICIT_H
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition:
PassManager.h:152
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition:
PassManager.h:371
llvm::Function
Definition:
Function.h:59
F
#define F(x, y, z)
Definition:
MD5.cpp:55
llvm::MakeGuardsExplicitPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
llvm::MakeGuardsExplicitPass
Definition:
MakeGuardsExplicit.h:40
PassManager.h
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition:
InstructionSimplify.h:42
Generated on Sat Jan 28 2023 08:55:28 for LLVM by
1.8.17