mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-31 09:25:42 +00:00
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/trunk@197089 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user