This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by thopre on Nov 22 2017, 10:41 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

thopre created this revision.Nov 22 2017, 10:41 AM

Ping? Would be nice to reduce complexity in this area.

Best regards.

thopre abandoned this revision.Feb 5 2019, 3:40 AM

No longer working for Arm. This would need to be rebased first if anybody picks it up.

Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2019, 3:40 AM