This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Enable DiagnosticPredicates for SVE LD1 instructions.
ClosedPublic

Authored by sdesmalen on Apr 20 2018, 6:33 AM.

Details

Summary

This patch extends the PredicateMethod of AsmOperands used in SVE's
LD1 instructions with a DiagnosticPredicate. This makes them 'context
sensitive' to the operand that has been parsed and tells the user to
use the right register (with expected shift/extend), rather than telling
the immediate is out of range when it actually parsed a register.

Patch [2/2] in a series to improve assembler diagnostics for SVE:

Diff Detail

Repository
rL LLVM

Event Timeline

sdesmalen created this revision.Apr 20 2018, 6:33 AM
fhahn accepted this revision.Apr 20 2018, 8:13 AM

LGTM

lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
509 ↗(On Diff #143306)

Do we need this change for the patch?

This revision is now accepted and ready to land.Apr 20 2018, 8:13 AM
sdesmalen added inline comments.Apr 20 2018, 8:20 AM
lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
509 ↗(On Diff #143306)

This keeps the diagnostic behaviour the same for instructions that use MemoryIndexSImm7. The intention of this patch is to only change the diagnostics for SVE LD1.

rengolin added inline comments.Apr 24 2018, 2:04 AM
lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
527 ↗(On Diff #143306)

I think this would be more explicit on how it returns math/no-match instead of converting a boolean to an enum.

this would prevent future changes of the enum class and implicit assumptions. same down there.

sdesmalen updated this revision to Diff 143701.Apr 24 2018, 3:15 AM
  • Made return values explicit (Match/NoMatch/NearMatch)
sdesmalen marked an inline comment as done.Apr 24 2018, 3:15 AM
This revision was automatically updated to reflect the committed changes.