diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp --- a/llvm/lib/CodeGen/MachineCSE.cpp +++ b/llvm/lib/CodeGen/MachineCSE.cpp @@ -782,11 +782,8 @@ // checks inside ProcessBlockCSE(), not only inside isCSECandidate(). This helps // to exclude instrs created by PRE that won't be CSEed later. bool MachineCSE::isPRECandidate(MachineInstr *MI) { - if (!isCSECandidate(MI) || - MI->isNotDuplicable() || - MI->mayLoad() || - MI->isAsCheapAsAMove() || - MI->getNumDefs() != 1 || + if (!isCSECandidate(MI) || MI->isNotDuplicable() || MI->mayLoad() || + TII->isAsCheapAsAMove(*MI) || MI->getNumDefs() != 1 || MI->getNumExplicitDefs() != 1) return false;