[PATCH] D24228: [Thumb] Save/restore high registers in Thumb1 pro/epilogues
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 26 03:11:42 PDT 2016
t.p.northover added inline comments.
================
Comment at: lib/Target/ARM/Thumb1FrameLowering.cpp:641-643
@@ +640,5 @@
+ } else {
+ // FIXME: This gets hit when using SjLj exceptions, as
+ // ARM::Int_eh_sjlj_dispatchsetup clobbers the FP registers.
+ //llvm_unreachable("callee-saved register of unexpected class");
+ }
----------------
Stale comment? Certainly a scary one.
================
Comment at: lib/Target/ARM/Thumb1FrameLowering.cpp:688-690
@@ +687,5 @@
+ // Find the first register to save.
+ auto HiRegToSave = AllHighRegs.begin();
+ while (HiRegToSave != AllHighRegs.end() && !HiRegsToSave.count(*HiRegToSave))
+ ++HiRegToSave;
+
----------------
This 3-line fragment seems to be an extremely common idiom in this stretch of code. Might be worth factoring into a `findNextOrderedReg`, or even using sorted vectors of registers to sidestep the issue entirely.
https://reviews.llvm.org/D24228
More information about the llvm-commits
mailing list