LLVM 23.0.0git
UndefPoison.h
Go to the documentation of this file.
1//===-- llvm/Support/UndefPoison.h - Undef/Poison tracking ------*- 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/// \file
10/// This file contains the UndefPoisonKind enum and helper functions.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_SUPPORT_UNDEFPOISON_H
15#define LLVM_SUPPORT_UNDEFPOISON_H
16
17namespace llvm {
18
19/// Enumeration to track whether we are interested in Undef, Poison, or both.
20enum class UndefPoisonKind {
21 PoisonOnly = (1 << 0),
22 UndefOnly = (1 << 1),
24};
25
26/// Returns true if \p Kind includes the Poison bit.
28 return (static_cast<unsigned>(Kind) &
29 static_cast<unsigned>(UndefPoisonKind::PoisonOnly)) != 0;
30}
31
32/// Returns true if \p Kind includes the Undef bit.
33inline bool includesUndef(UndefPoisonKind Kind) {
34 return (static_cast<unsigned>(Kind) &
35 static_cast<unsigned>(UndefPoisonKind::UndefOnly)) != 0;
36}
37
38} // namespace llvm
39
40#endif // LLVM_SUPPORT_UNDEFPOISON_H
This is an optimization pass for GlobalISel generic memory operations.
bool includesPoison(UndefPoisonKind Kind)
Returns true if Kind includes the Poison bit.
Definition UndefPoison.h:27
bool includesUndef(UndefPoisonKind Kind)
Returns true if Kind includes the Undef bit.
Definition UndefPoison.h:33
UndefPoisonKind
Enumeration to track whether we are interested in Undef, Poison, or both.
Definition UndefPoison.h:20