[PATCH] D113885: [MachineCSE] Use isAsCheapAsAMove in TargetInstrInfo
wangpc via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 15 05:09:08 PST 2021
pcwang-thead updated this revision to Diff 387222.
pcwang-thead added a comment.
Format code.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113885/new/
https://reviews.llvm.org/D113885
Files:
llvm/lib/CodeGen/MachineCSE.cpp
Index: llvm/lib/CodeGen/MachineCSE.cpp
===================================================================
--- llvm/lib/CodeGen/MachineCSE.cpp
+++ 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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113885.387222.patch
Type: text/x-patch
Size: 743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211115/843f3f7f/attachment.bin>
More information about the llvm-commits
mailing list