This is an archive of the discontinued LLVM Phabricator instance.

AArch64: classify Triple::aarch64_32 as AArch64
ClosedPublic

Authored by t.p.northover on Nov 10 2020, 3:37 AM.

Details

Reviewers
Gerolf
Summary

We want arm64_32 to omit leaf frame pointers. At the moment this is predicated on isAArch64 and fails because Triple::aarch64_32 doesn't count. That's logically incorrect, and fortunately that function is used infrequently enough that we can update its callers where appropriate, as here.

Diff Detail

Event Timeline

t.p.northover created this revision.Nov 10 2020, 3:37 AM
t.p.northover requested review of this revision.Nov 10 2020, 3:37 AM
dexonsmith added inline comments.Nov 11 2020, 12:21 PM
clang/lib/Driver/ToolChain.cpp
1066

Is there a short-form we'd want for this?

Here are two ideas:

// getTriple().isAArch64_64() and getTriple().isAArch64_32()
bool Triple::isAArch64_64() { return isAArch64() && isArch64Bit(); }
bool Triple::isAArch64_32() { return isAArch64() && isArch32Bit(); }

// getTriple().isAArch64(64) and getTriple().isAArch64(32)
bool Triple::isAArch64(int Bits) {
  assert(Bits == 32 || Bits == 64);
  if (!isAArch64())
    return false;
  return isArch64Bit() ? Bits == 64 : Bits == 32;
}

Or do you think it's better as-is?

llvm/include/llvm/ADT/Triple.h
715

Should the comment be changed?

t.p.northover added inline comments.Nov 13 2020, 2:33 AM
clang/lib/Driver/ToolChain.cpp
1066

Tricky one. The bare "64" and "32" are a bit non-descript, but having both isAArch64 and isArch64 in the same line seems just slightly worse to me so I'll update the patch.

Gerolf accepted this revision.Dec 2 2020, 10:49 PM
Gerolf added a subscriber: Gerolf.

LGTM.

This revision is now accepted and ready to land.Dec 2 2020, 10:49 PM
t.p.northover closed this revision.Dec 3 2020, 3:10 AM

Thanks Gerolf. Committed:

To github.com:llvm/llvm-project.git

ae9d96a656a1..152df3add156  master -> master