ScalarEvolutionNormalization.cpp (208954) | ScalarEvolutionNormalization.cpp (210299) |
---|---|
1//===- ScalarEvolutionNormalization.cpp - See below -------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 91 unchanged lines hidden (view full) --- 100 // An addrec. This is the interesting part. 101 const Loop *L = AR->getLoop(); 102 const SCEV *Result = SE.getAddRecExpr(Operands, L); 103 switch (Kind) { 104 default: llvm_unreachable("Unexpected transform name!"); 105 case NormalizeAutodetect: 106 if (Instruction *OI = dyn_cast<Instruction>(OperandValToReplace)) 107 if (IVUseShouldUsePostIncValue(User, OI, L, &DT)) { | 1//===- ScalarEvolutionNormalization.cpp - See below -------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 91 unchanged lines hidden (view full) --- 100 // An addrec. This is the interesting part. 101 const Loop *L = AR->getLoop(); 102 const SCEV *Result = SE.getAddRecExpr(Operands, L); 103 switch (Kind) { 104 default: llvm_unreachable("Unexpected transform name!"); 105 case NormalizeAutodetect: 106 if (Instruction *OI = dyn_cast<Instruction>(OperandValToReplace)) 107 if (IVUseShouldUsePostIncValue(User, OI, L, &DT)) { |
108 Result = SE.getMinusSCEV(Result, AR->getStepRecurrence(SE)); | 108 const SCEV *TransformedStep = 109 TransformForPostIncUse(Kind, AR->getStepRecurrence(SE), 110 User, OperandValToReplace, Loops, SE, DT); 111 Result = SE.getMinusSCEV(Result, TransformedStep); |
109 Loops.insert(L); 110 } 111 break; 112 case Normalize: | 112 Loops.insert(L); 113 } 114 break; 115 case Normalize: |
113 if (Loops.count(L)) 114 Result = SE.getMinusSCEV(Result, AR->getStepRecurrence(SE)); 115 break; 116 case Denormalize: | |
117 if (Loops.count(L)) { 118 const SCEV *TransformedStep = 119 TransformForPostIncUse(Kind, AR->getStepRecurrence(SE), 120 User, OperandValToReplace, Loops, SE, DT); | 116 if (Loops.count(L)) { 117 const SCEV *TransformedStep = 118 TransformForPostIncUse(Kind, AR->getStepRecurrence(SE), 119 User, OperandValToReplace, Loops, SE, DT); |
121 Result = SE.getAddExpr(Result, TransformedStep); | 120 Result = SE.getMinusSCEV(Result, TransformedStep); |
122 } 123 break; | 121 } 122 break; |
123 case Denormalize: 124 if (Loops.count(L)) 125 Result = SE.getAddExpr(Result, AR->getStepRecurrence(SE)); 126 break; |
|
124 } 125 return Result; 126 } 127 if (Changed) 128 switch (S->getSCEVType()) { 129 case scAddExpr: return SE.getAddExpr(Operands); 130 case scMulExpr: return SE.getMulExpr(Operands); 131 case scSMaxExpr: return SE.getSMaxExpr(Operands); --- 19 unchanged lines hidden --- | 127 } 128 return Result; 129 } 130 if (Changed) 131 switch (S->getSCEVType()) { 132 case scAddExpr: return SE.getAddExpr(Operands); 133 case scMulExpr: return SE.getMulExpr(Operands); 134 case scSMaxExpr: return SE.getSMaxExpr(Operands); --- 19 unchanged lines hidden --- |