Movatterモバイル変換


[0]ホーム

URL:


Next:, Up:On-the-Side SSA Form for RTL   [Contents][Index]


13.21.1 Using RTL SSA in a pass

A pass that wants to use the RTL SSA form should start with the following:

#define INCLUDE_ALGORITHM#define INCLUDE_FUNCTIONAL#define INCLUDE_ARRAY#include "config.h"#include "system.h"#include "coretypes.h"#include "backend.h"#include "rtl.h"#include "df.h"#include "rtl-ssa.h"

All the RTL SSA code is contained in thertl_ssa namespace,so most passes will then want to do:

using namespace rtl_ssa;

However, this is purely a matter of taste, and the examples in the rest ofthis section do not require it.

The RTL SSA represention is an optional on-the-side feature that applieson top of the normal RTL instructions. It is currently local to individualRTL passes and is not maintained across passes.

However, in order to allow the RTL SSA information to be preserved acrosspasses in future, ‘crtl->ssa’ points to the current function’sSSA form (if any). Passes that want to use the RTL SSA form shouldfirst do:

crtl->ssa = new rtl_ssa::function_info (fn);

wherefn is the function that the pass is processing.(Passes that areusing namespace rtl_ssa do not needthe ‘rtl_ssa::’.)

Once the pass has finished with the SSA form, it should do the following:

free_dominance_info (CDI_DOMINATORS);if (crtl->ssa->perform_pending_updates ())  cleanup_cfg (0);delete crtl->ssa;crtl->ssa = nullptr;

Thefree_dominance_info call is necessary becausedominance information is not currently maintained between RTL passes.The next two lines commit any changes to the RTL instructions thatwere queued for later; see the comment above the declaration ofperform_pending_updates for details. The final two linesdiscard the RTL SSA form and free the associated memory.


Next:RTL SSA Instructions, Up:On-the-Side SSA Form for RTL   [Contents][Index]


[8]ページ先頭

©2009-2026 Movatter.jp