Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/CodeGen/TypePromotion.cpp
Show First 20 Lines • Show All 946 Lines • ▼ Show 20 Lines | for (Instruction &I : BB) { | ||||
continue; | continue; | ||||
if (isa<ZExtInst>(&I) && isa<PHINode>(I.getOperand(0)) && | if (isa<ZExtInst>(&I) && isa<PHINode>(I.getOperand(0)) && | ||||
isa<IntegerType>(I.getType()) && BBIsInLoop(&BB)) { | isa<IntegerType>(I.getType()) && BBIsInLoop(&BB)) { | ||||
LLVM_DEBUG(dbgs() << "IR Promotion: Searching from: " << I.getOperand(0) | LLVM_DEBUG(dbgs() << "IR Promotion: Searching from: " << I.getOperand(0) | ||||
<< "\n"); | << "\n"); | ||||
EVT ZExtVT = TLI->getValueType(DL, I.getType()); | EVT ZExtVT = TLI->getValueType(DL, I.getType()); | ||||
Instruction *Phi = static_cast<Instruction *>(I.getOperand(0)); | Instruction *Phi = static_cast<Instruction *>(I.getOperand(0)); | ||||
MadeChange |= TryToPromote(Phi, ZExtVT.getFixedSizeInBits()); | auto PromoteWidth = ZExtVT.getFixedSizeInBits(); | ||||
if (RegisterBitWidth < PromoteWidth) { | |||||
LLVM_DEBUG(dbgs() << "IR Promotion: Couldn't find target " | |||||
<< "register for ZExt type\n"); | |||||
continue; | |||||
} | |||||
MadeChange |= TryToPromote(Phi, PromoteWidth); | |||||
} else if (auto *ICmp = dyn_cast<ICmpInst>(&I)) { | } else if (auto *ICmp = dyn_cast<ICmpInst>(&I)) { | ||||
// Search up from icmps to try to promote their operands. | // Search up from icmps to try to promote their operands. | ||||
// Skip signed or pointer compares | // Skip signed or pointer compares | ||||
if (ICmp->isSigned()) | if (ICmp->isSigned()) | ||||
continue; | continue; | ||||
LLVM_DEBUG(dbgs() << "IR Promotion: Searching from: " << *ICmp << "\n"); | LLVM_DEBUG(dbgs() << "IR Promotion: Searching from: " << *ICmp << "\n"); | ||||
Show All 30 Lines |