On Jun 2, 2011, at 9:11 AM, Jim Grosbach wrote:> > On Jun 2, 2011, at 6:20 AM, Rafael Ávila de Espíndola wrote: > >> On 11-06-02 6:56 AM, Anton Korobeynikov wrote: >>> Hi Chip, >>> >>>> Because of all this, it's hard to reconstruct the SEH information from >>>> the MachineMove array. I have thought about adding a new array specific >>>> to SEH information, but I'm not sure how you guys would feel about that. >>>> Any ideas on how to solve this problem? >>> Same problem with ARM-specific EH. I ended with own information >>> scheme, where instructions are marked as "frame related" during all >>> prologue& epilogue emission and later are "recognized" during the MI >>> => MCInst lowering. You might want to look into ARM backend, maybe we >>> can somehow "generalize" this approach. >>> >> >> Yes, the current model of producing a on the side vector of machine >> moves doesn't look like the best thing to do now that we produce cfi >> directives. >> >> I was thinking about just creating pseudo instructions that map 1:1 to >> the cfi directives (and ARM, and SEH). Codegen would create the >> appropriate one depending on the target. This would also avoid the silly >> labels that we still create when producing cfi. >> > > Pseudo instructions are problematic. That means every function pass that iterates over the instructions has to explicitly check for them to make sure they don't affect optimization. We already have to do that for debug_value instructions, and it's really unpleasant and error prone.How many passes are there this late in chain ? In any case, they all know how to deal with PROLOG_LABEL anyway. Personally, I'd like to make dwarf writer free of MachineModuleInfo. - Devang
Hi Devang,> How many passes are there this late in chain ? In any case, they all know how to deal with PROLOG_LABEL anyway. Personally, I'd like to make dwarf writer free of MachineModuleInfo.Quite a lot. Especially on ARM where we have all sorts of expansion and transformation passes at MI level. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Well, I've mulled it over for a while, and I've decided to take the ARM EH approach of marking frame instructions and recognizing them later during MachineInstr -> MCInst lowering. Given the trouble of teaching the various late passes about pseudo-instructions, it just seemed like the best choice to me. Thanks for all your help. Chip
---------- Forwarded message ---------- From: Anton Korobeynikov <anton at korobeynikov.info> Date: Sun, Jun 5, 2011 at 11:20 Subject: Re: [LLVMdev] Advice on MachineMoves and SEH To: Charles Davis <cdavis at mymail.mines.edu> Chip,> Well, I've mulled it over for a while, and I've decided to take the ARM > EH approach of marking frame instructions and recognizing them later > during MachineInstr -> MCInst lowering. Given the trouble of teaching > the various late passes about pseudo-instructions, it just seemed like > the best choice to me.Note that you will still have to preserve the "frame-related" marker during various expansion phases. E.g. in ARM case this was true for formation of multiple load/store instructions, etc. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University