[PATCH] D143117: [BOLT][NFC] Simplify SW::checkStackPointerRestore
Amir Ayupov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 2 12:04:28 PST 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG726ba8255413: [BOLT][NFC] Simplify SW::checkStackPointerRestore (authored by Amir).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143117/new/
https://reviews.llvm.org/D143117
Files:
bolt/lib/Passes/ShrinkWrapping.cpp
Index: bolt/lib/Passes/ShrinkWrapping.cpp
===================================================================
--- bolt/lib/Passes/ShrinkWrapping.cpp
+++ bolt/lib/Passes/ShrinkWrapping.cpp
@@ -265,17 +265,11 @@
// value may need to be updated depending on our stack layout changes
const MCInstrDesc &InstInfo = BC.MII->get(Point.getOpcode());
unsigned NumDefs = InstInfo.getNumDefs();
- bool UsesFP = false;
- for (unsigned I = NumDefs, E = MCPlus::getNumPrimeOperands(Point); I < E;
- ++I) {
- MCOperand &Operand = Point.getOperand(I);
- if (!Operand.isReg())
- continue;
- if (Operand.getReg() == BC.MIB->getFramePointer()) {
- UsesFP = true;
- break;
- }
- }
+ bool UsesFP = llvm::any_of(
+ llvm::drop_begin(MCPlus::primeOperands(Point), NumDefs),
+ [&](MCOperand &Op) {
+ return Op.isReg() && Op.getReg() == BC.MIB->getFramePointer();
+ });
if (!UsesFP)
return;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143117.494395.patch
Type: text/x-patch
Size: 943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230202/27ece1be/attachment.bin>
More information about the llvm-commits
mailing list