Skip to content

Commit

Permalink
AArch64: Remove Bad optimization
Browse files Browse the repository at this point in the history
Removes the code responsible for causing https://bugs.llvm.org/show_bug.cgi?id=49357.
A fix is in progress upstream, but I don't think it's easy, so this
fixes the bug in the meantime. The optimization it does is minor.

(cherry picked from commit e4f1085)
  • Loading branch information
Keno authored and vchuravy committed Feb 7, 2022
1 parent aaf2d27 commit 7627d61
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions llvm/lib/Target/AArch64/AArch64FastISel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4496,23 +4496,6 @@ bool AArch64FastISel::selectIntExt(const Instruction *I) {

// Try to optimize already sign-/zero-extended values from function arguments.
bool IsZExt = isa<ZExtInst>(I);
if (const auto *Arg = dyn_cast<Argument>(I->getOperand(0))) {
if ((IsZExt && Arg->hasZExtAttr()) || (!IsZExt && Arg->hasSExtAttr())) {
if (RetVT == MVT::i64 && SrcVT != MVT::i64) {
unsigned ResultReg = createResultReg(&AArch64::GPR64RegClass);
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
TII.get(AArch64::SUBREG_TO_REG), ResultReg)
.addImm(0)
.addReg(SrcReg)
.addImm(AArch64::sub_32);
SrcReg = ResultReg;
}

updateValueMap(I, SrcReg);
return true;
}
}

unsigned ResultReg = emitIntExt(SrcVT, SrcReg, RetVT, IsZExt);
if (!ResultReg)
return false;
Expand Down

0 comments on commit 7627d61

Please sign in to comment.