Lines Matching refs:AddrMode
2023 /// This is an extended version of TargetLowering::AddrMode
2025 struct ExtAddrMode : public TargetLowering::AddrMode {
2539 ExtAddrMode &AddrMode;
2562 MemoryInst(MI), AddrMode(AM), InsertedInsts(InsertedInsts),
2604 /// Return true and update AddrMode if this addr mode is legal for the target,
2619 if (AddrMode.Scale != 0 && AddrMode.ScaledReg != ScaleReg)
2622 ExtAddrMode TestAddrMode = AddrMode;
2634 AddrMode = TestAddrMode;
2636 // Okay, we decided that we can add ScaleReg+Scale to AddrMode. Check now
2649 AddrMode = TestAddrMode;
3077 /// true, otherwise return false without modifying AddrMode.
3129 ExtAddrMode BackupAddrMode = AddrMode;
3143 AddrMode = BackupAddrMode;
3153 AddrMode = BackupAddrMode;
3206 AddrMode.BaseOffs += ConstantOffset;
3208 TLI.isLegalAddressingMode(DL, AddrMode, AccessTy, AddrSpace)) {
3213 AddrMode.BaseOffs -= ConstantOffset;
3218 ExtAddrMode BackupAddrMode = AddrMode;
3222 AddrMode.BaseOffs += ConstantOffset;
3227 if (AddrMode.HasBaseReg) {
3228 AddrMode = BackupAddrMode;
3232 AddrMode.HasBaseReg = true;
3233 AddrMode.BaseReg = AddrInst->getOperand(0);
3241 AddrMode = BackupAddrMode;
3243 if (AddrMode.HasBaseReg)
3245 AddrMode.HasBaseReg = true;
3246 AddrMode.BaseReg = AddrInst->getOperand(0);
3247 AddrMode.BaseOffs += ConstantOffset;
3251 AddrMode = BackupAddrMode;
3295 ExtAddrMode BackupAddrMode = AddrMode;
3306 AddrMode = BackupAddrMode;
3319 /// If Addr can't be added to AddrMode this returns false and leaves AddrMode
3330 AddrMode.BaseOffs += CI->getSExtValue();
3331 if (TLI.isLegalAddressingMode(DL, AddrMode, AccessTy, AddrSpace))
3333 AddrMode.BaseOffs -= CI->getSExtValue();
3336 if (!AddrMode.BaseGV) {
3337 AddrMode.BaseGV = GV;
3338 if (TLI.isLegalAddressingMode(DL, AddrMode, AccessTy, AddrSpace))
3340 AddrMode.BaseGV = nullptr;
3343 ExtAddrMode BackupAddrMode = AddrMode;
3357 isProfitableToFoldIntoAddressingMode(I, BackupAddrMode, AddrMode)) {
3364 AddrMode = BackupAddrMode;
3378 if (!AddrMode.HasBaseReg) {
3379 AddrMode.HasBaseReg = true;
3380 AddrMode.BaseReg = Addr;
3382 if (TLI.isLegalAddressingMode(DL, AddrMode, AccessTy, AddrSpace))
3384 AddrMode.HasBaseReg = false;
3385 AddrMode.BaseReg = nullptr;
3389 if (AddrMode.Scale == 0) {
3390 AddrMode.Scale = 1;
3391 AddrMode.ScaledReg = Addr;
3392 if (TLI.isLegalAddressingMode(DL, AddrMode, AccessTy, AddrSpace))
3394 AddrMode.Scale = 0;
3395 AddrMode.ScaledReg = nullptr;
3540 // If the BaseReg or ScaledReg was referenced by the previous addrmode, their
3643 ExtAddrMode AddrMode;
3676 AddrMode = NewAddrMode;
3679 } else if (NewAddrMode == AddrMode) {
3723 DEBUG(dbgs() << "CGP: Found local addrmode: " << AddrMode << "\n");
3738 DEBUG(dbgs() << "CGP: Reusing nonlocal addrmode: " << AddrMode << " for "
3748 DEBUG(dbgs() << "CGP: SINKING nonlocal addrmode: " << AddrMode << " for "
3754 if (AddrMode.BaseReg && AddrMode.BaseReg->getType()->isPointerTy()) {
3755 ResultPtr = AddrMode.BaseReg;
3756 AddrMode.BaseReg = nullptr;
3759 if (AddrMode.Scale && AddrMode.ScaledReg->getType()->isPointerTy()) {
3762 if (ResultPtr || AddrMode.Scale != 1)
3765 ResultPtr = AddrMode.ScaledReg;
3766 AddrMode.Scale = 0;
3769 if (AddrMode.BaseGV) {
3773 ResultPtr = AddrMode.BaseGV;
3779 if (!ResultPtr && AddrMode.BaseReg) {
3781 Builder.CreateIntToPtr(AddrMode.BaseReg, Addr->getType(), "sunkaddr");
3782 AddrMode.BaseReg = nullptr;
3783 } else if (!ResultPtr && AddrMode.Scale == 1) {
3785 Builder.CreateIntToPtr(AddrMode.ScaledReg, Addr->getType(), "sunkaddr");
3786 AddrMode.Scale = 0;
3790 !AddrMode.BaseReg && !AddrMode.Scale && !AddrMode.BaseOffs) {
3804 if (AddrMode.BaseReg) {
3805 Value *V = AddrMode.BaseReg;
3813 if (AddrMode.Scale) {
3814 Value *V = AddrMode.ScaledReg;
3824 // the AddrMode was created we need to bail out gracefully if widths
3827 if (I && (ResultIndex != AddrMode.BaseReg))
3832 if (AddrMode.Scale != 1)
3833 V = Builder.CreateMul(V, ConstantInt::get(IntPtrTy, AddrMode.Scale),
3842 if (AddrMode.BaseOffs) {
3843 Value *V = ConstantInt::get(IntPtrTy, AddrMode.BaseOffs);
3867 DEBUG(dbgs() << "CGP: SINKING nonlocal addrmode: " << AddrMode << " for "
3877 if (AddrMode.BaseReg) {
3878 Value *V = AddrMode.BaseReg;
3887 if (AddrMode.Scale) {
3888 Value *V = AddrMode.ScaledReg;
3900 // the AddrMode was created we need to bail out gracefully if widths
3903 if (I && (Result != AddrMode.BaseReg))
3907 if (AddrMode.Scale != 1)
3908 V = Builder.CreateMul(V, ConstantInt::get(IntPtrTy, AddrMode.Scale),
3917 if (AddrMode.BaseGV) {
3918 Value *V = Builder.CreatePtrToInt(AddrMode.BaseGV, IntPtrTy, "sunkaddr");
3926 if (AddrMode.BaseOffs) {
3927 Value *V = ConstantInt::get(IntPtrTy, AddrMode.BaseOffs);