This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ][z/OS] Remove register prefixes when printing out the register.
ClosedPublic

Authored by anirudhp on Apr 26 2021, 10:21 AM.

Details

Summary
  • This patch is the first part in enforcing prefix-less registers for the HLASM dialect in z/OS
  • This patch removes the "%[r|f|v]" prefix while printing registers
  • To achieve this, the AssemblerDialect field of MAI was used
  • There is also a bit of refactoring done to ensure code repetition is reduced.
  • Currently the LLVM assembler for SystemZ/z/OS accepts both prefixed registers and prefix-less registers. A subsequent follow-up patch will restrict the SystemZAsmParser to only accept prefix-less registers.

Crediting @kianm as an author as well.

Diff Detail

Event Timeline

anirudhp created this revision.Apr 26 2021, 10:21 AM
anirudhp requested review of this revision.Apr 26 2021, 10:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2021, 10:21 AM
anirudhp edited the summary of this revision. (Show Details)Apr 26 2021, 10:22 AM
anirudhp updated this revision to Diff 340589.Apr 26 2021, 11:06 AM
  • Rebase on latest master
anirudhp edited the summary of this revision. (Show Details)Apr 26 2021, 1:26 PM
anirudhp added a subscriber: kianm.

LGTM

llvm/lib/Target/SystemZ/MCTargetDesc/SystemZInstPrinter.cpp
59

minor comment: Could we just pass in the AssemblerDialect instead of the MAI object because it seems to be the only thing being used? If there are future changes coming that use MAI, then feel free to ignore.

This revision is now accepted and ready to land.Apr 27 2021, 5:44 AM
uweigand accepted this revision.Apr 27 2021, 5:47 AM

LGTM as well.

llvm/lib/Target/SystemZ/MCTargetDesc/SystemZInstPrinter.cpp
59

I actually prefer passing the MAI, this is more general and done everywhere else as well.

anirudhp marked 2 inline comments as done.Apr 27 2021, 10:26 AM