mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
rotate CallInst operands, i.e. move callee to the back
of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101364 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -123,14 +123,14 @@ static Value *getPointerOperand(Instruction *I) {
|
||||
if (StoreInst *SI = dyn_cast<StoreInst>(I))
|
||||
return SI->getPointerOperand();
|
||||
if (MemIntrinsic *MI = dyn_cast<MemIntrinsic>(I))
|
||||
return MI->getOperand(1);
|
||||
return MI->getOperand(0);
|
||||
|
||||
switch (cast<IntrinsicInst>(I)->getIntrinsicID()) {
|
||||
default: assert(false && "Unexpected intrinsic!");
|
||||
case Intrinsic::init_trampoline:
|
||||
return I->getOperand(1);
|
||||
return I->getOperand(0);
|
||||
case Intrinsic::lifetime_end:
|
||||
return I->getOperand(2);
|
||||
return I->getOperand(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ static unsigned getStoreSize(Instruction *I, const TargetData *TD) {
|
||||
case Intrinsic::init_trampoline:
|
||||
return -1u;
|
||||
case Intrinsic::lifetime_end:
|
||||
Len = I->getOperand(1);
|
||||
Len = I->getOperand(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -287,7 +287,7 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) {
|
||||
|
||||
/// handleFreeWithNonTrivialDependency - Handle frees of entire structures whose
|
||||
/// dependency is a store to a field of that structure.
|
||||
bool DSE::handleFreeWithNonTrivialDependency(Instruction *F, MemDepResult Dep) {
|
||||
bool DSE::handleFreeWithNonTrivialDependency(/*FIXME: Call*/Instruction *F, MemDepResult Dep) {
|
||||
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
|
||||
|
||||
Instruction *Dependency = Dep.getInst();
|
||||
@@ -297,7 +297,7 @@ bool DSE::handleFreeWithNonTrivialDependency(Instruction *F, MemDepResult Dep) {
|
||||
Value *DepPointer = getPointerOperand(Dependency)->getUnderlyingObject();
|
||||
|
||||
// Check for aliasing.
|
||||
if (AA.alias(F->getOperand(1), 1, DepPointer, 1) !=
|
||||
if (AA.alias(F->getOperand(0), 1, DepPointer, 1) !=
|
||||
AliasAnalysis::MustAlias)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user