[PATCH] D51148: [RISCV] Fix std::advance slowness

Ana Pazos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 24 15:58:28 PDT 2018


apazos updated this revision to Diff 162494.
apazos added a subscriber: llvm-commits.

https://reviews.llvm.org/D51148

Files:
  lib/Target/RISCV/RISCVFrameLowering.cpp


Index: lib/Target/RISCV/RISCVFrameLowering.cpp
===================================================================
--- lib/Target/RISCV/RISCVFrameLowering.cpp
+++ lib/Target/RISCV/RISCVFrameLowering.cpp
@@ -148,8 +148,7 @@
   // Skip to before the restores of callee-saved registers
   // FIXME: assumes exactly one instruction is used to restore each
   // callee-saved register.
-  MachineBasicBlock::iterator LastFrameDestroy = MBBI;
-  std::advance(LastFrameDestroy, -MFI.getCalleeSavedInfo().size());
+  auto LastFrameDestroy = std::prev(MBBI, MFI.getCalleeSavedInfo().size());
 
   uint64_t StackSize = MFI.getStackSize();
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51148.162494.patch
Type: text/x-patch
Size: 631 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180824/39ddab8e/attachment.bin>


More information about the llvm-commits mailing list