Skip to content

Commit

Permalink
[lanai] Expand findClosestSuitableAluInstr check to consider offset r…
Browse files Browse the repository at this point in the history
…egister.

Previously findClosestSuitableAluInstr was only considering the base register when checking the current instruction for suitability. Expand check to consider the offset if the offset is a register.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267424 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
jpienaar committed Apr 25, 2016
1 parent e7311dc commit be88b88
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/Target/Lanai/LanaiMemAluCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,12 @@ MbbIterator LanaiMemAluCombiner::findClosestSuitableAluInstr(
return First;
}

// Usage of the base register of a form not suitable for merging
if (First != Last && InstrUsesReg(First, Base)) {
break;
// Usage of the base or offset register is not a form suitable for merging.
if (First != Last) {
if (InstrUsesReg(First, Base))
break;
if (Offset->isReg() && InstrUsesReg(First, Offset))
break;
}
}

Expand Down

0 comments on commit be88b88

Please sign in to comment.