Treat TargetGlobalAddress as a constant for the purpose of matching pre-inc stores on PPC.

Thanks to Tobias von Koch for pointing out this problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158932 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Hal Finkel
2012-06-21 20:10:48 +00:00
parent 343c32a39c
commit 2bbc9193b4
2 changed files with 28 additions and 1 deletions

View File

@@ -111,7 +111,8 @@ namespace {
/// immediate field. Because preinc imms have already been validated, just
/// accept it.
bool SelectAddrImmOffs(SDValue N, SDValue &Out) const {
if (isa<ConstantSDNode>(N)) {
if (isa<ConstantSDNode>(N) || N.getOpcode() == PPCISD::Lo ||
N.getOpcode() == ISD::TargetGlobalAddress) {
Out = N;
return true;
}
@@ -123,6 +124,10 @@ namespace {
/// index field. Because preinc imms have already been validated, just
/// accept it.
bool SelectAddrIdxOffs(SDValue N, SDValue &Out) const {
if (isa<ConstantSDNode>(N) || N.getOpcode() == PPCISD::Lo ||
N.getOpcode() == ISD::TargetGlobalAddress)
return false;
Out = N;
return true;
}