LSR fix: "Special" users are just like "Basic" users but allow -1 scale.

llvm-svn: 158536
This commit is contained in:
Andrew Trick 2012-06-15 20:07:26 +00:00
parent 4fd966347a
commit aca8fb3c45
1 changed files with 2 additions and 2 deletions

View File

@ -1308,8 +1308,8 @@ static bool isLegalUse(const TargetLowering::AddrMode &AM,
return !AM.BaseGV && AM.Scale == 0 && AM.BaseOffs == 0;
case LSRUse::Special:
// Only handle -1 scales, or no scale.
return AM.Scale == 0 || AM.Scale == -1;
// Special case Basic to handle -1 scales.
return !AM.BaseGV && (AM.Scale == 0 || AM.Scale == -1) && AM.BaseOffs == 0;
}
llvm_unreachable("Invalid LSRUse Kind!");