This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Asm: Report SVE parsing diagnostics only once
ClosedPublic

Authored by sdesmalen on Nov 10 2017, 3:28 AM.

Details

Summary

Prevent an issue where a diagnostic is reported multiple times by bailing out with a ParseFail if an invalid SVE register element qualifier/suffix is specified, for example:

<stdin>:10:18: error: invalid sve vector kind qualifier
add z20.h, z2.h, z31.x

^

<stdin>:10:18: error: invalid sve vector kind qualifier
add z20.h, z2.h, z31.x

...

<stdin>:10:18: error: invalid sve vector kind qualifier
add z20.h, z2.h, z31.x

^

Diff Detail

Event Timeline

sdesmalen created this revision.Nov 10 2017, 3:28 AM
sdesmalen edited the summary of this revision. (Show Details)Nov 10 2017, 3:28 AM
sdesmalen updated this revision to Diff 122439.Nov 10 2017, 8:05 AM

Reverted a change to the diagnostic for 'invalid vector kind qualifier'.

rengolin edited edge metadata.Nov 10 2017, 10:26 PM

Is the VEDataVectorRegister` to SVERegister change meaningful?

Is the VEDataVectorRegister` to SVERegister change meaningful?

The change from 'tryParseSVEDataVectorRegister' to 'tryParseSVERegister' is there because when I applied this patch onto our downstream branch (to ensure this patch would work for our entire test set with more instructions than unpredicated add/sub), I found that tryParseSVEDataVectorRegister() and tryParsePredicateVectorRegister() were the practically same after backporting our changes to matchRegisterNameAlias() from the previous patch. tryParseSVERegister() will also handle Predicates when we extend matchRegisterNameAlias with SVE predicates in a later patch, similar to how we did it for data vectors and so there is no need for having the 'DataVector' part in the name.

tryParseSVERegister() will also handle Predicates when we extend matchRegisterNameAlias with SVE predicates in a later patch, similar to how we did it for data vectors and so there is no need for having the 'DataVector' part in the name.

Ah, excellent! Normally, such a change would need to be done in a separate patch, but it should be fine for such a small and preparatory patch.

I'll review the changes soon. Sorry, I'm at SC17 now.

rengolin accepted this revision.Nov 14 2017, 6:45 PM

Right, ok, you'll reuse the parser with a different kind later, that makes sense and the code is cleaner this way.

LGTM. Thanks!

This revision is now accepted and ready to land.Nov 14 2017, 6:45 PM
sdesmalen closed this revision.Nov 15 2017, 7:44 AM