From 7fa27ce4a07f19b07799a767fc29416f3b625afb Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 26 Jul 2023 21:03:47 +0200 Subject: Vendor import of llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the last commit before the upstream release/17.x branch was created. --- llvm/lib/CodeGen/TypePromotion.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'llvm/lib/CodeGen/TypePromotion.cpp') diff --git a/llvm/lib/CodeGen/TypePromotion.cpp b/llvm/lib/CodeGen/TypePromotion.cpp index e6c0b3242d67..426292345a14 100644 --- a/llvm/lib/CodeGen/TypePromotion.cpp +++ b/llvm/lib/CodeGen/TypePromotion.cpp @@ -235,8 +235,6 @@ bool TypePromotionImpl::isSource(Value *V) { return true; else if (isa(V)) return true; - else if (isa(V)) - return true; else if (auto *Call = dyn_cast(V)) return Call->hasRetAttr(Attribute::AttrKind::ZExt); else if (auto *Trunc = dyn_cast(V)) @@ -724,8 +722,9 @@ bool TypePromotionImpl::isSupportedValue(Value *V) { case Instruction::Ret: case Instruction::Load: case Instruction::Trunc: - case Instruction::BitCast: return isSupportedType(I); + case Instruction::BitCast: + return I->getOperand(0)->getType() == I->getType(); case Instruction::ZExt: return isSupportedType(I->getOperand(0)); case Instruction::ICmp: @@ -960,8 +959,8 @@ bool TypePromotionImpl::run(Function &F, const TargetMachine *TM, if (isa(&I) && isa(I.getOperand(0)) && isa(I.getType()) && BBIsInLoop(&BB)) { - LLVM_DEBUG(dbgs() << "IR Promotion: Searching from: " << I.getOperand(0) - << "\n"); + LLVM_DEBUG(dbgs() << "IR Promotion: Searching from: " + << *I.getOperand(0) << "\n"); EVT ZExtVT = TLI->getValueType(DL, I.getType()); Instruction *Phi = static_cast(I.getOperand(0)); auto PromoteWidth = ZExtVT.getFixedSizeInBits(); -- cgit v1.2.3