diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-12-12 04:28:52 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-12-12 04:28:52 +0000 |
commit | b29de8ba0044548f0259b5eca180e07bdba992bc (patch) | |
tree | e8233125cab5128c2e57fadd8f12a0d5473cf887 /lib | |
parent | 7bcb2e0a6f6d169691a1bb4f93ad3ad2ab9686ee (diff) | |
download | external_llvm-b29de8ba0044548f0259b5eca180e07bdba992bc.zip external_llvm-b29de8ba0044548f0259b5eca180e07bdba992bc.tar.gz external_llvm-b29de8ba0044548f0259b5eca180e07bdba992bc.tar.bz2 |
Merging r197089:
------------------------------------------------------------------------
r197089 | hfinkel | 2013-12-11 15:12:25 -0800 (Wed, 11 Dec 2013) | 6 lines
Fix the PPC subsumes-predicate check
For one predicate to subsume another, they must both check the same condition
register. Failure to check this prerequisite was causing miscompiles.
Fixes PR18003.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@197126 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/PowerPC/PPCInstrInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCInstrInfo.cpp b/lib/Target/PowerPC/PPCInstrInfo.cpp index 87e13ef..315ad04 100644 --- a/lib/Target/PowerPC/PPCInstrInfo.cpp +++ b/lib/Target/PowerPC/PPCInstrInfo.cpp @@ -988,6 +988,10 @@ bool PPCInstrInfo::SubsumesPredicate( if (Pred2[1].getReg() == PPC::CTR8 || Pred2[1].getReg() == PPC::CTR) return false; + // P1 can only subsume P2 if they test the same condition register. + if (Pred1[1].getReg() != Pred2[1].getReg()) + return false; + PPC::Predicate P1 = (PPC::Predicate) Pred1[0].getImm(); PPC::Predicate P2 = (PPC::Predicate) Pred2[0].getImm(); |