This is an archive of the discontinued LLVM Phabricator instance.

[ARM] processInstruction must return true if it makes a change
AbandonedPublic

Authored by olista01 on Oct 23 2017, 9:57 AM.

Details

Summary

This function must return true if it makes a change, because MatchAndEmitInstruction calls it repeatedly until no further change are made.

No tests because we happen to not hit any of these cases at the moment, but that's just luck.

Diff Detail

Repository
rL LLVM

Event Timeline

olista01 created this revision.Oct 23 2017, 9:57 AM
rengolin edited edge metadata.Oct 23 2017, 2:08 PM

We don't hit it by luck is not a good reason. Is it possible to exercise that with a simple MC pattern or not?

Should be simple to add those to existing tests, and it's odd that we have those patterns for years and they have never been tested.

I'm not aware of any test case that can trigger this at the moment, because we get lucky with the ordering of opcodes in the assembly matcher table. However, other patches that I'm working on change that.

Right, it would be nice to have that as a precursor to the patch set that you're working on, so that you can claim that this is necessary (and show proof with following patches), instead of having it loose like that.

It will probably take me a while to get the patch that uncovers this out, as it's quite complex (adding optional operands in the asm matcher, to remove some hacks like shouldOmitCCOutOperand in the asm parser and get more precise diagnostics), and I'm only working on this as a side project. Since this "bug" isn't observable at the moment I'm fine to leave this in review until the optional operands patch is published, so that it's clear why it is necessary. However, I think it should still be a separate patch, as it's not really related to the optional operands change, and would need to go in before it to avoid test failures.

rengolin requested changes to this revision.Oct 23 2017, 3:01 PM

It can go in as part of a patch set and it will still avoid the failures.

Sorry, this patch is not obvious enough to just take it at face value.

This revision now requires changes to proceed.Oct 23 2017, 3:01 PM
olista01 abandoned this revision.Nov 27 2017, 2:38 AM