@@ -664,20 +664,22 @@ bool AArch64FastISel::computeAddress(const Value *Obj, Address &Addr, Type *Ty)
664
664
Addr.setExtendType (AArch64_AM::LSL);
665
665
666
666
const Value *Src = U->getOperand (0 );
667
- if (const auto *I = dyn_cast<Instruction>(Src))
668
- if (FuncInfo.MBBMap [I->getParent ()] == FuncInfo.MBB )
669
- Src = I;
670
-
671
- // Fold the zext or sext when it won't become a noop.
672
- if (const auto *ZE = dyn_cast<ZExtInst>(Src)) {
673
- if (!isIntExtFree (ZE) && ZE->getOperand (0 )->getType ()->isIntegerTy (32 )) {
674
- Addr.setExtendType (AArch64_AM::UXTW);
675
- Src = ZE->getOperand (0 );
676
- }
677
- } else if (const auto *SE = dyn_cast<SExtInst>(Src)) {
678
- if (!isIntExtFree (SE) && SE->getOperand (0 )->getType ()->isIntegerTy (32 )) {
679
- Addr.setExtendType (AArch64_AM::SXTW);
680
- Src = SE->getOperand (0 );
667
+ if (const auto *I = dyn_cast<Instruction>(Src)) {
668
+ if (FuncInfo.MBBMap [I->getParent ()] == FuncInfo.MBB ) {
669
+ // Fold the zext or sext when it won't become a noop.
670
+ if (const auto *ZE = dyn_cast<ZExtInst>(I)) {
671
+ if (!isIntExtFree (ZE) &&
672
+ ZE->getOperand (0 )->getType ()->isIntegerTy (32 )) {
673
+ Addr.setExtendType (AArch64_AM::UXTW);
674
+ Src = ZE->getOperand (0 );
675
+ }
676
+ } else if (const auto *SE = dyn_cast<SExtInst>(I)) {
677
+ if (!isIntExtFree (SE) &&
678
+ SE->getOperand (0 )->getType ()->isIntegerTy (32 )) {
679
+ Addr.setExtendType (AArch64_AM::SXTW);
680
+ Src = SE->getOperand (0 );
681
+ }
682
+ }
681
683
}
682
684
}
683
685
@@ -746,21 +748,22 @@ bool AArch64FastISel::computeAddress(const Value *Obj, Address &Addr, Type *Ty)
746
748
Addr.setExtendType (AArch64_AM::LSL);
747
749
748
750
const Value *Src = LHS;
749
- if (const auto *I = dyn_cast<Instruction>(Src))
750
- if (FuncInfo.MBBMap [I->getParent ()] == FuncInfo.MBB )
751
- Src = I;
752
-
753
-
754
- // Fold the zext or sext when it won't become a noop.
755
- if (const auto *ZE = dyn_cast<ZExtInst>(Src)) {
756
- if (!isIntExtFree (ZE) && ZE->getOperand (0 )->getType ()->isIntegerTy (32 )) {
757
- Addr.setExtendType (AArch64_AM::UXTW);
758
- Src = ZE->getOperand (0 );
759
- }
760
- } else if (const auto *SE = dyn_cast<SExtInst>(Src)) {
761
- if (!isIntExtFree (SE) && SE->getOperand (0 )->getType ()->isIntegerTy (32 )) {
762
- Addr.setExtendType (AArch64_AM::SXTW);
763
- Src = SE->getOperand (0 );
751
+ if (const auto *I = dyn_cast<Instruction>(Src)) {
752
+ if (FuncInfo.MBBMap [I->getParent ()] == FuncInfo.MBB ) {
753
+ // Fold the zext or sext when it won't become a noop.
754
+ if (const auto *ZE = dyn_cast<ZExtInst>(I)) {
755
+ if (!isIntExtFree (ZE) &&
756
+ ZE->getOperand (0 )->getType ()->isIntegerTy (32 )) {
757
+ Addr.setExtendType (AArch64_AM::UXTW);
758
+ Src = ZE->getOperand (0 );
759
+ }
760
+ } else if (const auto *SE = dyn_cast<SExtInst>(I)) {
761
+ if (!isIntExtFree (SE) &&
762
+ SE->getOperand (0 )->getType ()->isIntegerTy (32 )) {
763
+ Addr.setExtendType (AArch64_AM::SXTW);
764
+ Src = SE->getOperand (0 );
765
+ }
766
+ }
764
767
}
765
768
}
766
769
0 commit comments