[compiler-rt] [flang] [llvm] [clang] [clang-tools-extra] [PowerPC][CodeGen] Exploit STMW and LMW in 32-bit big-endian mode. (PR #74415)

Qiu Chaofan via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 4 22:42:57 PST 2023


================
@@ -2399,6 +2405,30 @@ bool PPCFrameLowering::assignCalleeSavedSpillSlots(
   return AllSpilledToReg;
 }
 
+static void findContinuousLoadStore(ArrayRef<CalleeSavedInfo> CSI,
+                                    Register &MergeFrom) {
+  CalleeSavedInfo BeginI = CSI[0];
+  unsigned I = 1, E = CSI.size();
+  for (; I < E; ++I) {
+    // Find continuous store/load.
+    unsigned RegDiff = CSI[I].getReg() - CSI[I - 1].getReg();
+    unsigned FrameIdxDiff = CSI[I - 1].getFrameIdx() - CSI[I].getFrameIdx();
----------------
ecnelises wrote:

Is it guaranteed safe to store `? - ?` into `unsigned` value?

https://github.com/llvm/llvm-project/pull/74415


More information about the cfe-commits mailing list