|Maximal Munch instruction selection: how to connect tiles? firstname.lastname@example.org (=?UTF-8?B?Q8Opc2Fy?=) (2015-09-28)|
|Re: Maximal Munch instruction selection: how to connect tiles? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2015-09-29)|
|From:||Hans-Peter Diettrich <DrDiettrich1@netscape.net>|
|Date:||Tue, 29 Sep 2015 17:16:27 +0200|
|Posted-Date:||29 Sep 2015 11:53:13 EDT|
> Given the expression a = b + c; my compiler currently produces the
> following IR-tree:
> / \
> a + (_t1)
> / \
> b c
> I am trying to use the maximal munch strategy to produce assembly code
> for this tree but I'm stuck with the following questions: ...
You can consider many more cases, like the x86 addressing modes with
base, index and scaling, which can be used for some arithmetic
expressions in general.
In case the '+' operator stores the result in memory, a '+=' opcode (add
to memory) could be used in above expression. All that can end up in
multiple possible different instruction sequences, which have to be
"weighted" for the final selection of the "best" sequence. The sequences
then can map to different tree structures, which are created from the
AST. That means that modifications should be applied to copies of the
AST, and it's unpredictable how big the different trees for more complex
expressions will become.
Return to the
Search the comp.compilers archives again.