[PATCH] D101778: [CPG][ARM] Optimize towards branch on zero in codegenprepare
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 13 02:50:48 PDT 2021
nikic added inline comments.
================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:7710
+ Value *X = Cmp->getOperand(0);
+ unsigned CmpC = cast<ConstantInt>(Cmp->getOperand(1))->getZExtValue();
+
----------------
This is going to assert for large (> 64-bit) icmps.
================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:7731
+ if ((Cmp->getPredicate() == ICmpInst::ICMP_EQ ||
+ Cmp->getPredicate() == ICmpInst::ICMP_NE) &&
+ (match(UI, m_Add(m_Specific(X), m_SpecificInt(-CmpC))) ||
----------------
Style nit: `Cmp->isEquality()`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101778/new/
https://reviews.llvm.org/D101778
More information about the llvm-commits
mailing list