[llvm][AArch64] Simplify reverse iteration fix in #217752. NFC - #217979
[llvm][AArch64] Simplify reverse iteration fix in #217752. NFC#217979jroelofs wants to merge 1 commit into
Conversation
This is a follow-up to ab0b549 where vhscampos noticed that we were skipping MBBI in the backward search for SP adjustment FrameDestroy instructions. Since MBB always points at the PAUTH_EPILOGUE pseudo, there is no functional difference in this change, but it's worth simplifying that because the intent does not look obvious from construction, and we don't lose much from iterating over one extra instruction.
|
@llvm/pr-subscribers-backend-aarch64 Author: Jon Roelofs (jroelofs) ChangesThis is a follow-up to ab0b549 where vhscampos noticed that we were skipping MBBI in the backward search for SP adjustment FrameDestroy instructions. Since MBB always points at the PAUTH_EPILOGUE pseudo, there is no functional difference in this change, but it's worth simplifying that because the intent does not look obvious from construction, and we don't lose much from iterating over one extra instruction. Full diff: https://github.com/llvm/llvm-project/pull/217979.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AArch64/AArch64PointerAuth.cpp b/llvm/lib/Target/AArch64/AArch64PointerAuth.cpp
index 374f42a02cc08..0e4a51286cf54 100644
--- a/llvm/lib/Target/AArch64/AArch64PointerAuth.cpp
+++ b/llvm/lib/Target/AArch64/AArch64PointerAuth.cpp
@@ -327,7 +327,7 @@ void AArch64PointerAuthImpl::authenticateLR(
int64_t Offset = -ArgumentStackToRestore;
SmallVector<MachineInstr *, 2> SPMods;
if (ArgumentStackToRestore > 0) {
- for (MachineInstr &MI : reverse(make_range(MBB.begin(), MBBI))) {
+ for (MachineInstr &MI : make_range(MBBI.getReverse(), MBB.rend())) {
if (!MI.getFlag(MachineInstr::FrameDestroy))
break;
if ((MI.getOpcode() == AArch64::ADDXri ||
|
🐧 Linux x64 Test Results
Failed Tests(click on a test name to see its output) ClangClang.Modules/GH204633.cppmIf these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the |
🪟 Windows x64 Test Results
Failed Tests(click on a test name to see its output) ClangClang.Modules/GH204633.cppmIf these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the |
This is a follow-up to ab0b549 where vhscampos noticed that we were skipping MBBI in the backward search for SP adjustment FrameDestroy instructions. Since MBB always points at the PAUTH_EPILOGUE pseudo, there is no functional difference in this change, but it's worth simplifying that because the intent does not look obvious from construction, and we don't lose much from iterating over one extra instruction.