[PATCH] D40368: [PATCH 2/2] Centralize info about spill areas in data structures

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 22 10:42:08 PST 2017


thopre created this revision.
Herald added a subscriber: javed.absar.

Context
-------

This patch is part of a patch series to make code for spilling/restoring
callee-saved register more data driven and with less code duplication.
Its purpose is to centralize properties about spill areas away from
various location in code and into data structures.

Patch description
-----------------

A number of properties of spill areas is currently written in code, for
instance whether spilling non contiguous registers can be done in one
instruction or not. This means adding a new spill area or changing
properties of a spill area (for instance if a new instruction is
introduced that can improve spilling) code needs to be updated rather
than a well identified data structure. Worse off, that info is
duplicated in many places.

This patch builds on the spill area enumeration introduced in previous
patch to associate a SpillAreaProperty structure to each spill area
enumeration via an array whose index match the enumerators values. This
is done using an X-macro to avoid hardcoding the order of enumerator
declaration into the array initialization and because designated array
and structure initializer are not available in C++.

The rest of the patch updates the code to make use of these structures,
thereby making the code a bit more spill area independent and closer to
iterate over spill areas using loops.

Testing: Ran llvm_regr which shows no regression.


Repository:
  rL LLVM

https://reviews.llvm.org/D40368

Files:
  lib/Target/ARM/ARMBaseRegisterInfo.h
  lib/Target/ARM/ARMFrameLowering.cpp
  lib/Target/ARM/ARMFrameLowering.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40368.123984.patch
Type: text/x-patch
Size: 11434 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171122/8e66a809/attachment.bin>


More information about the llvm-commits mailing list