Add (currently disabled) code for canFoldSetCC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18820 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Brian Gaeke 2004-12-12 06:22:30 +00:00
parent 077f1a8292
commit 81cf150b5d
2 changed files with 20 additions and 0 deletions

View File

@ -1016,6 +1016,16 @@ static inline BasicBlock *getBlockAfter(BasicBlock *BB) {
///
static SetCondInst *canFoldSetCCIntoBranch(Value *V) {
return 0; // disable.
if (SetCondInst *SCI = dyn_cast<SetCondInst>(V))
if (SCI->hasOneUse()) {
BranchInst *User = dyn_cast<BranchInst>(SCI->use_back());
if (User
&& (SCI->getNext() == User)
&& (getClassB(SCI->getOperand(0)->getType()) != cLong)
&& User->isConditional() && (User->getCondition() == V))
return SCI;
}
return 0;
}
/// visitBranchInst - Handles conditional and unconditional branches.

View File

@ -1016,6 +1016,16 @@ static inline BasicBlock *getBlockAfter(BasicBlock *BB) {
///
static SetCondInst *canFoldSetCCIntoBranch(Value *V) {
return 0; // disable.
if (SetCondInst *SCI = dyn_cast<SetCondInst>(V))
if (SCI->hasOneUse()) {
BranchInst *User = dyn_cast<BranchInst>(SCI->use_back());
if (User
&& (SCI->getNext() == User)
&& (getClassB(SCI->getOperand(0)->getType()) != cLong)
&& User->isConditional() && (User->getCondition() == V))
return SCI;
}
return 0;
}
/// visitBranchInst - Handles conditional and unconditional branches.