VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /proc/thread-self/root/usr/lib/llvm-10/include/llvm/Transforms/Utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/usr/lib/llvm-10/include/llvm/Transforms/Utils/MisExpect.h
//===--- MisExpect.h - Check the use of llvm.expect with PGO data ---------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This contains code to emit warnings for potentially incorrect usage of the
// llvm.expect intrinsic. This utility extracts the threshold values from
// metadata associated with the instrumented Branch or Switch instruction. The
// threshold values are then used to determine if a warning should be emmited.
//
//===----------------------------------------------------------------------===//

#include "llvm/ADT/SmallVector.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"

namespace llvm {
namespace misexpect {

/// verifyMisExpect - compares PGO counters to the thresholds used for
/// llvm.expect and warns if the PGO counters are outside of the expected
/// range.
/// \param I The Instruction being checked
/// \param Weights A vector of profile weights for each target block
/// \param Ctx The current LLVM context
void verifyMisExpect(llvm::Instruction *I,
                     const llvm::SmallVector<uint32_t, 4> &Weights,
                     llvm::LLVMContext &Ctx);

/// checkClangInstrumentation - verify if llvm.expect matches PGO profile
/// This function checks the frontend instrumentation in the backend when
/// lowering llvm.expect intrinsics. It checks for existing metadata, and
/// then validates the use of llvm.expect against the assigned branch weights.
//
/// \param I the Instruction being checked
void checkFrontendInstrumentation(Instruction &I);

} // namespace misexpect
} // namespace llvm

VaKeR 2022