This commit adds required transformation pass for IPRA and a simple testcase to verify it. 1) lib/Target/X86/X86RegUsageInfoPropagate.cpp (Target Specific MachineFunction Pass) to update RegMasks of call instr in caller function based on the RegMask returned by immutable pass, scheduled at Pre-RegAlloc.
Details
Diff Detail
Event Timeline
Two very basic questions:
1.) Do we plan on supporting IPRA on other targets? My assumption is yes (please).
2.) Can the RegUsageInfoPropagate pass be written in a target-independent way and add target specific hooks as necessary?
I don't know why the pass is still X86 specific, I thought our conclusion before splitting the patch was that it is not and should be a generic pass?
The only reason it is X86 was that we thought we would have to handle calls in a target specific way, but it turned out we should be able to get away with that.
test/CodeGen/Generic/ipra-transform.ll | ||
---|---|---|
14 | trailing whitespace |
lib/CodeGen/RegUsageInfoPropagate.cpp | ||
---|---|---|
2 | This doesn't appear to be 80-column. | |
14 | MachineInstrs in a given | |
15 | RegisterUsageInfo.cpp -> RegisterUsageInfo | |
16 | of the callee Perhaps something like: | |
18 | used by the register allocator while allocating the current MachineFunction. | |
43 | I've seen this style in the past: #define RUIP_NAME "Register Usage Information Propagation" and then replace the strings with the #define. | |
54 | return RUIP_NAME; | |
76 | "Register Usage Information Propagation" -> RUIP_NAME | |
79 | "Register Usage Information Propagation" -> RUIP_NAME | |
103 | I'm not sure this comment is necessary, but I don't have any strong feelings for or against it. However, if you do decide to keep it, please write all comments using proper English prose (capitalization, puncuation, etc.). | |
104 | You can reduce the indent by changing this check to: if (!MI.isCall()) continue; I tend to think it also improves readability. |
lib/CodeGen/RegUsageInfoPropagate.cpp | ||
---|---|---|
75 | The second argument to INITIALIZE_PASS_BEGIN/END is used to specify the name of the command-line option passed to llc/opt to enable this pass. Generally, this is all lower case with dashes are used for spacing (e.g., "peephole-opt", "machine-sink", "if-converter"). We should decide upon a name that uses this convention (e.g., "reg-usage-propagation"). |
lib/CodeGen/RegUsageInfoPropagate.cpp | ||
---|---|---|
119 | No: Operand.getGlobal() already returns the Function *.... |
This doesn't appear to be 80-column.