[llvm] [AArch64][GlobalISel] Look into array's element (PR #74109)

David Green via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 02:33:48 PST 2023


================
@@ -621,6 +621,17 @@ bool AArch64RegisterBankInfo::isLoadFromFPType(const MachineInstr &MI) const {
   Type *EltTy = nullptr;
   if (const GlobalValue *GV = dyn_cast<GlobalValue>(LdVal)) {
     EltTy = GV->getValueType();
+    // Look at the first element of the struct to determine its type
+    if (StructType *StructEltTy = dyn_cast<StructType>(EltTy)) {
----------------
davemgreen wrote:

Can this just do something like 
```
while (StructType *StructEltTy = dyn_cast<StructType>(EltTy))
  EltTy = StructEltTy->getTypeAtIndex(0);
```
?

https://github.com/llvm/llvm-project/pull/74109


More information about the llvm-commits mailing list