LLVM
20.0.0git
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
y
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
v
w
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
l
m
o
p
q
r
s
t
u
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
include
llvm
Analysis
OverflowInstAnalysis.h
Go to the documentation of this file.
1
//===-- OverflowInstAnalysis.h - Utils to fold overflow insts ----*- C++ -*-==//
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 file holds routines to help analyse overflow instructions
10
// and fold them into constants or other overflow instructions
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_ANALYSIS_OVERFLOWINSTANALYSIS_H
15
#define LLVM_ANALYSIS_OVERFLOWINSTANALYSIS_H
16
17
namespace
llvm
{
18
class
Use
;
19
class
Value
;
20
21
/// Match one of the patterns up to the select/logic op:
22
/// %Op0 = icmp ne i4 %X, 0
23
/// %Agg = call { i4, i1 } @llvm.[us]mul.with.overflow.i4(i4 %X, i4 %Y)
24
/// %Op1 = extractvalue { i4, i1 } %Agg, 1
25
/// %ret = select i1 %Op0, i1 %Op1, i1 false / %ret = and i1 %Op0, %Op1
26
///
27
/// %Op0 = icmp eq i4 %X, 0
28
/// %Agg = call { i4, i1 } @llvm.[us]mul.with.overflow.i4(i4 %X, i4 %Y)
29
/// %NotOp1 = extractvalue { i4, i1 } %Agg, 1
30
/// %Op1 = xor i1 %NotOp1, true
31
/// %ret = select i1 %Op0, i1 true, i1 %Op1 / %ret = or i1 %Op0, %Op1
32
///
33
/// Callers are expected to align that with the operands of the select/logic.
34
/// IsAnd is set to true if the Op0 and Op1 are used as the first pattern.
35
/// If Op0 and Op1 match one of the patterns above, return true and fill Y's
36
/// use.
37
38
bool
isCheckForZeroAndMulWithOverflow
(Value *Op0, Value *Op1,
bool
IsAnd,
39
Use *&
Y
);
40
bool
isCheckForZeroAndMulWithOverflow
(Value *Op0, Value *Op1,
bool
IsAnd);
41
}
// end namespace llvm
42
43
#endif
Y
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
llvm::TargetStackID::Value
Value
Definition:
TargetFrameLowering.h:29
llvm::rdf::Use
NodeAddr< UseNode * > Use
Definition:
RDFGraph.h:385
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
llvm::isCheckForZeroAndMulWithOverflow
bool isCheckForZeroAndMulWithOverflow(Value *Op0, Value *Op1, bool IsAnd, Use *&Y)
Match one of the patterns up to the select/logic op: Op0 = icmp ne i4 X, 0 Agg = call { i4,...
Definition:
OverflowInstAnalysis.cpp:21
Generated on Wed Mar 12 2025 14:35:33 for LLVM by
1.9.6