[LLVMdev] Issue with Machine Verifier and earlyclobber

Jakob Stoklund Olesen stoklund at 2pi.dk
Sun Jul 15 20:25:01 PDT 2012


On Jul 15, 2012, at 4:50 PM, Borja Ferrer <borja.ferav at gmail.com> wrote:

> I think I'm getting a bit closer to the problem. I've found that the call to InlineSpiller::foldMemoryOperand() inside InlineSpiller::spillAroundUses() is causing the problems. 
> As a test, I removed that call and with your yesterday's patch I'm not getting any errors at all, the code generated is the same one as with the call. This is happening when InlineSpiller::foldMemoryOperand() returns true, so a very wild guess is that maybe when calling LIS.ReplaceMachineInstrInMaps() the new SlotIndex created is not of type Slot_EarlyClobber since the MI being replaced is a COPY with no EC ops.

OK, I see what is happening. We don't expect foldMemoryOperand to turn a normal def into an early-clobber and vice versa.

This is not easy to fix, could you file a PR, please?

As a workaround, you can use a pseudo-instruction in loadRegFromStackSlot() that doesn't have the early-clobber flag. Then replace it with the real instruction in expandPostRAPseudo().

/jakob





More information about the llvm-dev mailing list