mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1858 91177308-0d34-0410-b5e6-96231b3b80d8
39 lines
1.3 KiB
C++
39 lines
1.3 KiB
C++
//===-- ConstantProp.h - Functions for Constant Propogation ------*- C++ -*--=//
|
|
//
|
|
// This family of functions are useful for performing constant propogation.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_TRANSFORMS_SCALAR_CONSTANT_PROPOGATION_H
|
|
#define LLVM_TRANSFORMS_SCALAR_CONSTANT_PROPOGATION_H
|
|
|
|
#include "llvm/BasicBlock.h"
|
|
class TerminatorInst;
|
|
class Pass;
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Normal Constant Propogation Pass
|
|
//
|
|
Pass *createConstantPropogationPass();
|
|
|
|
// doConstantPropogation - Constant prop a specific instruction. Returns true
|
|
// and potentially moves the iterator if constant propogation was performed.
|
|
//
|
|
bool doConstantPropogation(BasicBlock *BB, BasicBlock::iterator &I);
|
|
|
|
// ConstantFoldTerminator - If a terminator instruction is predicated on a
|
|
// constant value, convert it into an unconditional branch to the constant
|
|
// destination. This is a nontrivial operation because the successors of this
|
|
// basic block must have their PHI nodes updated.
|
|
//
|
|
bool ConstantFoldTerminator(BasicBlock *BB, BasicBlock::iterator &I,
|
|
TerminatorInst *T);
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Sparse Conditional Constant Propogation Pass
|
|
//
|
|
Pass *createSCCPPass();
|
|
|
|
#endif
|