This is an archive of the discontinued LLVM Phabricator instance.

[COFF, ARM64] Add MS builtins __dmb, __dsb, __isb
ClosedPublic

Authored by mstorsjo on Oct 11 2017, 2:09 PM.

Details

Summary

This is an update to D36111 by @mgrang, taking over finishing of this patch. Compared to his version, this makes the intrinsics conditional to ALL_MS_LANGUAGES.

Diff Detail

Event Timeline

mstorsjo created this revision.Oct 11 2017, 2:09 PM
compnerd edited edge metadata.Oct 11 2017, 8:12 PM

Don't you need a change to the intrinsics to actually map the builtin?

Don't you need a change to the intrinsics to actually map the builtin?

Apparently, this change is all that's needed since the tests pass. I can of course try to look closer and see what actually makes it work.

Don't you need a change to the intrinsics to actually map the builtin?

This seems to be automatically mapped via this piece of code in CGBuiltin.cpp:

// See if we have a target specific intrinsic.
const char *Name = getContext().BuiltinInfo.getName(BuiltinID);
Intrinsic::ID IntrinsicID = Intrinsic::not_intrinsic;
StringRef Prefix =
    llvm::Triple::getArchTypePrefix(getTarget().getTriple().getArch());
if (!Prefix.empty()) {
  IntrinsicID = Intrinsic::getIntrinsicForGCCBuiltin(Prefix.data(), Name);
  // NOTE we dont need to perform a compatibility flag check here since the
  // intrinsics are declared in Builtins*.def via LANGBUILTIN which filter the
  // MS builtins via ALL_MS_LANGUAGES and are filtered earlier.
  if (IntrinsicID == Intrinsic::not_intrinsic)
    IntrinsicID = Intrinsic::getIntrinsicForMSBuiltin(Prefix.data(), Name);
}

And these target specific intrinsics are already hooked up on the LLVM side in SVN r310502.

This revision was automatically updated to reflect the committed changes.