diff options
Diffstat (limited to 'include/llvm/Analysis/ConstantFolding.h')
-rw-r--r-- | include/llvm/Analysis/ConstantFolding.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/include/llvm/Analysis/ConstantFolding.h b/include/llvm/Analysis/ConstantFolding.h index 192c1abddcd2..2385b6f09c40 100644 --- a/include/llvm/Analysis/ConstantFolding.h +++ b/include/llvm/Analysis/ConstantFolding.h @@ -1,9 +1,8 @@ //===-- ConstantFolding.h - Fold instructions into constants ----*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// 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 // //===----------------------------------------------------------------------===// // @@ -23,7 +22,7 @@ namespace llvm { class APInt; template <typename T> class ArrayRef; -class CallSite; +class CallBase; class Constant; class ConstantExpr; class ConstantVector; @@ -31,7 +30,6 @@ class DataLayout; class Function; class GlobalValue; class Instruction; -class ImmutableCallSite; class TargetLibraryInfo; class Type; @@ -73,6 +71,12 @@ ConstantFoldCompareInstOperands(unsigned Predicate, Constant *LHS, Constant *RHS, const DataLayout &DL, const TargetLibraryInfo *TLI = nullptr); +/// Attempt to constant fold a unary operation with the specified +/// operand. If it fails, it returns a constant expression of the specified +/// operands. +Constant *ConstantFoldUnaryOpOperand(unsigned Opcode, Constant *Op, + const DataLayout &DL); + /// Attempt to constant fold a binary operation with the specified /// operands. If it fails, it returns a constant expression of the specified /// operands. @@ -139,11 +143,11 @@ Constant *ConstantFoldLoadThroughGEPIndices(Constant *C, /// canConstantFoldCallTo - Return true if its even possible to fold a call to /// the specified function. -bool canConstantFoldCallTo(ImmutableCallSite CS, const Function *F); +bool canConstantFoldCallTo(const CallBase *Call, const Function *F); /// ConstantFoldCall - Attempt to constant fold a call to the specified function /// with the specified arguments, returning null if unsuccessful. -Constant *ConstantFoldCall(ImmutableCallSite CS, Function *F, +Constant *ConstantFoldCall(const CallBase *Call, Function *F, ArrayRef<Constant *> Operands, const TargetLibraryInfo *TLI = nullptr); @@ -155,7 +159,7 @@ Constant *ConstantFoldLoadThroughBitcast(Constant *C, Type *DestTy, /// Check whether the given call has no side-effects. /// Specifically checks for math routimes which sometimes set errno. -bool isMathLibCallNoop(CallSite CS, const TargetLibraryInfo *TLI); +bool isMathLibCallNoop(const CallBase *Call, const TargetLibraryInfo *TLI); } #endif |