[PATCH] D134353: [AArch64] Add all predecessor archs in target info

David Spickett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 01:24:03 PDT 2022


DavidSpickett added inline comments.


================
Comment at: clang/lib/Basic/Targets/AArch64.cpp:541
+       --i)
+    Features[llvm::AArch64::getSubArch(i)] = Enabled;
+}
----------------
It's not clear to me that you need 2 loops or the conditional here. What prevents you from just having:
```
llvm::AArch64::ArchKind AK = llvm::AArch64::getSubArchArchKind(Name);
for (llvm::AArch64::ArchKind i = llvm::AArch64::convertV9toV8(AK);
  i != llvm::AArch64::ArchKind::INVALID; --i)
    Features[llvm::AArch64::getSubArch(i)] = Enabled;
```

Given that converting anything that isn't v9 returns itself, then you walk backwards to all the previous architectures. Seems like you only need to do that once but tell me what I'm missing.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134353/new/

https://reviews.llvm.org/D134353



More information about the llvm-commits mailing list