[PATCH] D20753: AArch64Subtarget: Check ARMProcFamily instead of CPU part of triple.

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri May 27 14:44:32 PDT 2016


MatzeB created this revision.
MatzeB added reviewers: t.p.northover, mcrosier, rengolin, jmolloy.
MatzeB added a subscriber: llvm-commits.
MatzeB set the repository for this revision to rL LLVM.
Herald added subscribers: mcrosier, rengolin, aemerson.

A bunch of isXXX() checks in AArch64Subtarget compare the CPU part of
the target triple. It seems like we can use the existing (but currently
unused) ARMProcFamily field instead and save the string comparison.

This is NFC, except for the case of CPU=="cortex-a72" which is reported
as ARMProcFamilty==CortexA57 which lets isCortexA57() report true after
this commit.

Repository:
  rL LLVM

http://reviews.llvm.org/D20753

Files:
  lib/Target/AArch64/AArch64Subtarget.h

Index: lib/Target/AArch64/AArch64Subtarget.h
===================================================================
--- lib/Target/AArch64/AArch64Subtarget.h
+++ lib/Target/AArch64/AArch64Subtarget.h
@@ -161,11 +161,11 @@
   bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }
 
   bool isGeneric() const { return CPUString == "generic"; }
-  bool isCyclone() const { return CPUString == "cyclone"; }
-  bool isCortexA57() const { return CPUString == "cortex-a57"; }
-  bool isCortexA53() const { return CPUString == "cortex-a53"; }
-  bool isExynosM1() const { return CPUString == "exynos-m1"; }
-  bool isKryo() const { return CPUString == "kryo"; }
+  bool isCyclone() const { return ARMProcFamily == Cyclone; }
+  bool isCortexA57() const { return ARMProcFamily == CortexA57; }
+  bool isCortexA53() const { return ARMProcFamily == CortexA53; }
+  bool isExynosM1() const { return ARMProcFamily == ExynosM1; }
+  bool isKryo() const { return ARMProcFamily == Kryo; }
 
   bool useAA() const override { return isCortexA53(); }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20753.58842.patch
Type: text/x-patch
Size: 1050 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160527/ba49a58f/attachment.bin>


More information about the llvm-commits mailing list