This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Convert test to opaque pointers
ClosedPublic

Authored by nikic on Apr 4 2023, 2:31 AM.

Details

Summary

When converting this test to opaque pointers, we get a register move between the call and the inline asm. However, the test comment specifically says that there should be nothing between them.

As far as I can tell, this is fine, both in that the inline asm doesn't use the relevant registers, but also more generally because the inline asm doesn't declare any clobbers, so really LLVM can do whatever, side effects or not. The test was added by 618ce3e85ed1c68e89dc696b7c9ab94a6a910797 with a singularly unhelpful reference to Apple's internal issue tracker.

Diff Detail

Event Timeline

nikic created this revision.Apr 4 2023, 2:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2023, 2:31 AM
nikic requested review of this revision.Apr 4 2023, 2:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2023, 2:31 AM
dmgreen accepted this revision.Apr 5 2023, 12:44 AM
dmgreen added a reviewer: ostannard.

If we want something that is closer to the original, it could hoist the call into a constant:

define void @test_inline_asm_sideeffect(%0* %call) {
  call void @bar()
  call void asm sideeffect "mov\09r7, r7\09\09@ marker", ""()
  %hoist = bitcast ptr @foo to ptr
  %1 = call ptr %hoist(ptr %call)
  ret void
}

I agree that the new codegen shouldnt be a problem though. I think this LGTM

This revision is now accepted and ready to land.Apr 5 2023, 12:44 AM
This revision was automatically updated to reflect the committed changes.