This is an archive of the discontinued LLVM Phabricator instance.

Restrict ARM IT Blocks on Windows
AbandonedPublic

Authored by dpaoliello on Aug 24 2021, 6:06 PM.

Details

Reviewers
samparker
Summary

Per Microsoft's documentation (https://docs.microsoft.com/en-us/cpp/build/overview-of-arm-abi-conventions?view=msvc-160#it-instructions) ARM IT Blocks should be restricted as if targeting ARMv8, even on older versions of ARM.

Diff Detail

Event Timeline

dpaoliello created this revision.Aug 24 2021, 6:06 PM
dpaoliello requested review of this revision.Aug 24 2021, 6:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2021, 6:06 PM

This change seems fine to me, but can we add some sort of testcase for it? Do we have an existing testcase that check for the default behaviour when targeting armv8 somewhere?

The performance deprecation of certain forms of IT blocks has been reverted.
The performance deprecation notes are being removed from the Arm ARM.
I am expecting that in the near future, code generation for Arm will be adapted to not enable -mrestrict-it by default at all, following what was already done in gcc at https://gcc.gnu.org/legacy-ml/gcc-patches/2019-12/msg00134.html.

As such, I'm not sure if this patch is a good thing to implement.
Maybe the guidelines in Microsoft's document you point to (https://docs.microsoft.com/en-us/cpp/build/overview-of-arm-abi-conventions?view=msvc-160#it-instructions) should be adapted to take into account the above described changes to the ArmARM?

The performance deprecation of certain forms of IT blocks has been reverted.
The performance deprecation notes are being removed from the Arm ARM.
I am expecting that in the near future, code generation for Arm will be adapted to not enable -mrestrict-it by default at all, following what was already done in gcc at https://gcc.gnu.org/legacy-ml/gcc-patches/2019-12/msg00134.html.

As such, I'm not sure if this patch is a good thing to implement.
Maybe the guidelines in Microsoft's document you point to (https://docs.microsoft.com/en-us/cpp/build/overview-of-arm-abi-conventions?view=msvc-160#it-instructions) should be adapted to take into account the above described changes to the ArmARM?

@kristof.beyls Can you please point me to any official documentation or announcement from ARM about this (I've tried looking myself but couldn't see anything)?
I'd be happy to abandon this change and get the Microsoft docs updated if these instructions are no longer deprecated.

Added tests for Restricting IT blocks for v7 vs v8, optimizing for size and Windows.

This change seems fine to me, but can we add some sort of testcase for it? Do we have an existing testcase that check for the default behaviour when targeting armv8 somewhere?

I could not find any existing tests specifically checking if IT blocks are restricted or not, so I added tests for the existing behavior and the new Windows behavior.

The performance deprecation of certain forms of IT blocks has been reverted.
The performance deprecation notes are being removed from the Arm ARM.
I am expecting that in the near future, code generation for Arm will be adapted to not enable -mrestrict-it by default at all, following what was already done in gcc at https://gcc.gnu.org/legacy-ml/gcc-patches/2019-12/msg00134.html.

As such, I'm not sure if this patch is a good thing to implement.
Maybe the guidelines in Microsoft's document you point to (https://docs.microsoft.com/en-us/cpp/build/overview-of-arm-abi-conventions?view=msvc-160#it-instructions) should be adapted to take into account the above described changes to the ArmARM?

@kristof.beyls Can you please point me to any official documentation or announcement from ARM about this (I've tried looking myself but couldn't see anything)?
I'd be happy to abandon this change and get the Microsoft docs updated if these instructions are no longer deprecated.

I have not found a direct public announcement from Arm about this.
The "performance deprecation for certain forms of IT blocks" notes in the Arm Architecture Reference Manual (ArmARM) should have been all removed from the latest version at https://developer.arm.com/documentation/ddi0487/latest
I've found that a few places were missed and raised a defect against the Arm Architecture Reference Manual to get them all removed.
AFAIK, not having these "performance deprecation" notes in the ArmARM may end up being the only documentation about this.

dpaoliello abandoned this revision.Aug 31 2021, 2:06 PM

The performance deprecation of certain forms of IT blocks has been reverted.
The performance deprecation notes are being removed from the Arm ARM.
I am expecting that in the near future, code generation for Arm will be adapted to not enable -mrestrict-it by default at all, following what was already done in gcc at https://gcc.gnu.org/legacy-ml/gcc-patches/2019-12/msg00134.html.

As such, I'm not sure if this patch is a good thing to implement.
Maybe the guidelines in Microsoft's document you point to (https://docs.microsoft.com/en-us/cpp/build/overview-of-arm-abi-conventions?view=msvc-160#it-instructions) should be adapted to take into account the above described changes to the ArmARM?

@kristof.beyls Can you please point me to any official documentation or announcement from ARM about this (I've tried looking myself but couldn't see anything)?
I'd be happy to abandon this change and get the Microsoft docs updated if these instructions are no longer deprecated.

I have not found a direct public announcement from Arm about this.
The "performance deprecation for certain forms of IT blocks" notes in the Arm Architecture Reference Manual (ArmARM) should have been all removed from the latest version at https://developer.arm.com/documentation/ddi0487/latest
I've found that a few places were missed and raised a defect against the Arm Architecture Reference Manual to get them all removed.
AFAIK, not having these "performance deprecation" notes in the ArmARM may end up being the only documentation about this.

Looks like you're right: I'm going to go ahead and abandon this change.

Looks like you're right: I'm going to go ahead and abandon this change.

@dpaoliello Should the Windows ARM ABI docs be updated to stop discouraging those forms then too? And I guess armasm should stop warnings on such forms? Can you file requests internally to get that started?