labrinea wrote:

> might be worth adding tests covering a few additional corner cases and make 
> behaviour implicit:

> two versions with identical feature sets but different priorities

We have test for this already: 
https://github.com/llvm/llvm-project/blob/main/clang/test/CodeGen/AArch64/fmv-duplicate-mangled-name.c#L26

> can we make default unreachable

No, because the default version unlike any other version has empty 
`fmv-features` metatada, therefore AArch64::getCpuSupportsMask should return 
zero. No `LHS` can be subset of zero in this code:
```
+      for (auto I = Options.begin() + 1, E = Options.end(); I != E; ++I) {
+        llvm::APInt RHS = llvm::AArch64::getCpuSupportsMask(I->Features);
+        if (std::any_of(Options.begin(), I, [RHS](auto RO) {
+              llvm::APInt LHS = llvm::AArch64::getCpuSupportsMask(RO.Features);
+              return LHS.isSubsetOf(RHS);
+            })) {
```

https://github.com/llvm/llvm-project/pull/171496
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to