mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
Convert the first batch of passes to use LLVMContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74748 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include "llvm/BasicBlock.h"
|
||||
#include "llvm/Constants.h"
|
||||
#include "llvm/Instructions.h"
|
||||
#include "llvm/LLVMContext.h"
|
||||
#include "llvm/Type.h"
|
||||
#include "llvm/Analysis/Dominators.h"
|
||||
#include "llvm/Analysis/IVUsers.h"
|
||||
@@ -711,18 +712,18 @@ void IndVarSimplify::HandleFloatingPointIV(Loop *L, PHINode *PH) {
|
||||
// Insert new integer induction variable.
|
||||
PHINode *NewPHI = PHINode::Create(Type::Int32Ty,
|
||||
PH->getName()+".int", PH);
|
||||
NewPHI->addIncoming(ConstantInt::get(Type::Int32Ty, newInitValue),
|
||||
NewPHI->addIncoming(Context->getConstantInt(Type::Int32Ty, newInitValue),
|
||||
PH->getIncomingBlock(IncomingEdge));
|
||||
|
||||
Value *NewAdd = BinaryOperator::CreateAdd(NewPHI,
|
||||
ConstantInt::get(Type::Int32Ty,
|
||||
Context->getConstantInt(Type::Int32Ty,
|
||||
newIncrValue),
|
||||
Incr->getName()+".int", Incr);
|
||||
NewPHI->addIncoming(NewAdd, PH->getIncomingBlock(BackEdge));
|
||||
|
||||
// The back edge is edge 1 of newPHI, whatever it may have been in the
|
||||
// original PHI.
|
||||
ConstantInt *NewEV = ConstantInt::get(Type::Int32Ty, intEV);
|
||||
ConstantInt *NewEV = Context->getConstantInt(Type::Int32Ty, intEV);
|
||||
Value *LHS = (EVIndex == 1 ? NewPHI->getIncomingValue(1) : NewEV);
|
||||
Value *RHS = (EVIndex == 1 ? NewEV : NewPHI->getIncomingValue(1));
|
||||
ICmpInst *NewEC = new ICmpInst(NewPred, LHS, RHS, EC->getNameStart(),
|
||||
@@ -738,7 +739,7 @@ void IndVarSimplify::HandleFloatingPointIV(Loop *L, PHINode *PH) {
|
||||
RecursivelyDeleteTriviallyDeadInstructions(EC);
|
||||
|
||||
// Delete old, floating point, increment instruction.
|
||||
Incr->replaceAllUsesWith(UndefValue::get(Incr->getType()));
|
||||
Incr->replaceAllUsesWith(Context->getUndef(Incr->getType()));
|
||||
RecursivelyDeleteTriviallyDeadInstructions(Incr);
|
||||
|
||||
// Replace floating induction variable, if it isn't already deleted.
|
||||
|
||||
Reference in New Issue
Block a user