This is an archive of the discontinued LLVM Phabricator instance.

[IR] Update llvm.prefetch to match docs
ClosedPublic

Authored by lenary on Aug 17 2022, 10:48 AM.

Details

Summary

The current llvm.prefetch intrinsic docs state "The rw, locality and
cache type arguments must be constant integers."

This change:

  • Makes arg 3 (cache type) an ImmArg
  • Improves the verifier error messages to reference the incorrect argument.
  • Fixes two tests which contradict the docs.

This is needed as the lowering to GlobalISel is different for ImmArgs
compared to other constants. The non-ImmArgs create a G_CONSTANT MIR
instruction, the for ImmArgs the constant is put directly on the
intrinsic's MIR instruction as an immediate.

Diff Detail

Event Timeline

lenary created this revision.Aug 17 2022, 10:48 AM
lenary requested review of this revision.Aug 17 2022, 10:48 AM

I'm not sure who the right reviewers are for this, adding a few based on CODE_OWNERS and previous changes to intrinsics.

This revision is now accepted and ready to land.Aug 17 2022, 12:11 PM

I'll fix the MLIR test when I land this.

This revision was landed with ongoing or failed builds.Aug 19 2022, 1:12 AM
This revision was automatically updated to reflect the committed changes.
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript