This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Correct features on pacbti tests. NFC
ClosedPublic

Authored by dmgreen on Jul 13 2022, 1:47 PM.

Details

Summary

Given a patch like D129506, using instructions not valid for the current feature set becomes an error. This updates the Arm tests for pac/bti to use a thumbv8.1-m.main to make the instructions they produce valid. It requires altering some of the tests for the updated codegen.

Diff Detail

Event Timeline

dmgreen created this revision.Jul 13 2022, 1:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2022, 1:47 PM
dmgreen requested review of this revision.Jul 13 2022, 1:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2022, 1:47 PM
chill added a subscriber: chill.Jul 14 2022, 6:14 AM

Is something breaking somewhere?
The compiler ought to generate valid PACBTI-M code for the v7-m architecture too, choosing only instructions from the NOP-space.

Oh I had that backwards then. The issue is that the instructions that it uses are all marked as requiring Armv8.1-m, so cannot be used validly in a Armv7-m build.

Should the instructions be available when assembling for thumbv7m? If so I can just change the predicates on the PACBTIHintSpaceInst instructions. If not they may need to use HINT's or use some pseudos.

Oh I had that backwards then. The issue is that the instructions that it uses are all marked as requiring Armv8.1-m, so cannot be used validly in a Armv7-m build.

Should the instructions be available when assembling for thumbv7m? If so I can just change the predicates on the PACBTIHintSpaceInst instructions. If not they may need to use HINT's or use some pseudos.

Ideally, we would like mnemonics (for NOP-space instructions only) to be available in v-7m and up, even though they were introduced in v8.1-m.

dmgreen updated this revision to Diff 445413.Jul 18 2022, 1:28 AM

Thanks - then this patch now sets the predicate on the Hint Space PACBTI instructions to thumbv7m. The test has been adjusted too, to show the instructions assembling/disassembling.

LGTM, but let Victor take a look too.

vhscampos accepted this revision.Jul 25 2022, 1:37 AM

It LGTM too. Thanks.

This revision is now accepted and ready to land.Jul 25 2022, 1:37 AM
This revision was landed with ongoing or failed builds.Jul 27 2022, 1:15 AM
This revision was automatically updated to reflect the committed changes.