llvm.org GIT mirror llvm / 25e9405
Rename ValuePropagation to a more descriptive CorrelatedValuePropagation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112591 91177308-0d34-0410-b5e6-96231b3b80d8 Owen Anderson 10 years ago
4 changed file(s) with 15 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
145145 (void) llvm::createLintPass();
146146 (void) llvm::createSinkingPass();
147147 (void) llvm::createLowerAtomicPass();
148 (void) llvm::createValuePropagationPass();
148 (void) llvm::createCorrelatedValuePropagationPass();
149149
150150 (void)new llvm::IntervalPartition();
151151 (void)new llvm::FindUsedTypes();
326326 //
327327 // ValuePropagation - Propagate CFG-derived value information
328328 //
329 Pass *createValuePropagationPass();
329 Pass *createCorrelatedValuePropagationPass();
330330
331331 } // End llvm namespace
332332
None //===- ValuePropagation.cpp - Propagate information derived control flow --===//
0 //===- CorrelatedValuePropagation.cpp - Propagate CFG-derived info --------===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
66 //
77 //===----------------------------------------------------------------------===//
88 //
9 // This file implements the Value Propagation pass.
9 // This file implements the Correlated Value Propagation pass.
1010 //
1111 //===----------------------------------------------------------------------===//
1212
13 #define DEBUG_TYPE "value-propagation"
13 #define DEBUG_TYPE "correlated-value-propagation"
1414 #include "llvm/Transforms/Scalar.h"
1515 #include "llvm/Function.h"
1616 #include "llvm/Instructions.h"
2424 STATISTIC(NumSelects, "Number of selects propagated");
2525
2626 namespace {
27 class ValuePropagation : public FunctionPass {
27 class CorrelatedValuePropagation : public FunctionPass {
2828 LazyValueInfo *LVI;
2929
3030 bool processSelect(SelectInst *SI);
3232
3333 public:
3434 static char ID;
35 ValuePropagation(): FunctionPass(ID) { }
35 CorrelatedValuePropagation(): FunctionPass(ID) { }
3636
3737 bool runOnFunction(Function &F);
3838
4242 };
4343 }
4444
45 char ValuePropagation::ID = 0;
46 INITIALIZE_PASS(ValuePropagation, "value-propagation",
45 char CorrelatedValuePropagation::ID = 0;
46 INITIALIZE_PASS(CorrelatedValuePropagation, "correlated-propagation",
4747 "Value Propagation", false, false);
4848
4949 // Public interface to the Value Propagation pass
50 Pass *llvm::createValuePropagationPass() {
51 return new ValuePropagation();
50 Pass *llvm::createCorrelatedValuePropagationPass() {
51 return new CorrelatedValuePropagation();
5252 }
5353
54 bool ValuePropagation::processSelect(SelectInst *S) {
54 bool CorrelatedValuePropagation::processSelect(SelectInst *S) {
5555 if (S->getType()->isVectorTy()) return false;
5656
5757 Constant *C = LVI->getConstant(S->getOperand(0), S->getParent());
6868 return true;
6969 }
7070
71 bool ValuePropagation::processPHI(PHINode *P) {
71 bool CorrelatedValuePropagation::processPHI(PHINode *P) {
7272 bool Changed = false;
7373
7474 BasicBlock *BB = P->getParent();
9696 return Changed;
9797 }
9898
99 bool ValuePropagation::runOnFunction(Function &F) {
99 bool CorrelatedValuePropagation::runOnFunction(Function &F) {
100100 LVI = &getAnalysis();
101101
102102 bool Changed = false;
None ; RUN: opt < %s -value-propagation -S | FileCheck %s
0 ; RUN: opt < %s -correlated-propagation -S | FileCheck %s
11 ; PR2581
22
33 ; CHECK: @test1