Lines Matching refs:AddrMode
824 /// ExtAddrMode - This is an extended version of TargetLowering::AddrMode
826 struct ExtAddrMode : public TargetLowering::AddrMode {
894 /// AddrMode - This is the addressing mode that we're building up. This is
896 ExtAddrMode &AddrMode;
906 : AddrModeInsts(AMI), TLI(T), AccessTy(AT), MemoryInst(MI), AddrMode(AM) {
937 /// Return true and update AddrMode if this addr mode is legal for the target,
952 if (AddrMode.Scale != 0 && AddrMode.ScaledReg != ScaleReg)
955 ExtAddrMode TestAddrMode = AddrMode;
967 AddrMode = TestAddrMode;
969 // Okay, we decided that we can add ScaleReg+Scale to AddrMode. Check now
982 AddrMode = TestAddrMode;
1023 /// mode and return true, otherwise return false without modifying AddrMode.
1052 ExtAddrMode BackupAddrMode = AddrMode;
1059 AddrMode = BackupAddrMode;
1068 AddrMode = BackupAddrMode;
1120 AddrMode.BaseOffs += ConstantOffset;
1121 if (ConstantOffset == 0 || TLI.isLegalAddressingMode(AddrMode, AccessTy)){
1126 AddrMode.BaseOffs -= ConstantOffset;
1131 ExtAddrMode BackupAddrMode = AddrMode;
1135 AddrMode.BaseOffs += ConstantOffset;
1140 if (AddrMode.HasBaseReg) {
1141 AddrMode = BackupAddrMode;
1145 AddrMode.HasBaseReg = true;
1146 AddrMode.BaseReg = AddrInst->getOperand(0);
1154 AddrMode = BackupAddrMode;
1156 if (AddrMode.HasBaseReg)
1158 AddrMode.HasBaseReg = true;
1159 AddrMode.BaseReg = AddrInst->getOperand(0);
1160 AddrMode.BaseOffs += ConstantOffset;
1164 AddrMode = BackupAddrMode;
1177 /// addressing mode. If Addr can't be added to AddrMode this returns false and
1178 /// leaves AddrMode unmodified. This assumes that Addr is either a pointer type
1184 AddrMode.BaseOffs += CI->getSExtValue();
1185 if (TLI.isLegalAddressingMode(AddrMode, AccessTy))
1187 AddrMode.BaseOffs -= CI->getSExtValue();
1190 if (AddrMode.BaseGV == 0) {
1191 AddrMode.BaseGV = GV;
1192 if (TLI.isLegalAddressingMode(AddrMode, AccessTy))
1194 AddrMode.BaseGV = 0;
1197 ExtAddrMode BackupAddrMode = AddrMode;
1206 IsProfitableToFoldIntoAddressingMode(I, BackupAddrMode, AddrMode)) {
1213 AddrMode = BackupAddrMode;
1225 if (!AddrMode.HasBaseReg) {
1226 AddrMode.HasBaseReg = true;
1227 AddrMode.BaseReg = Addr;
1229 if (TLI.isLegalAddressingMode(AddrMode, AccessTy))
1231 AddrMode.HasBaseReg = false;
1232 AddrMode.BaseReg = 0;
1236 if (AddrMode.Scale == 0) {
1237 AddrMode.Scale = 1;
1238 AddrMode.ScaledReg = Addr;
1239 if (TLI.isLegalAddressingMode(AddrMode, AccessTy))
1241 AddrMode.Scale = 0;
1242 AddrMode.ScaledReg = 0;
1384 // If the BaseReg or ScaledReg was referenced by the previous addrmode, their
1479 ExtAddrMode AddrMode;
1509 AddrMode = NewAddrMode;
1512 } else if (NewAddrMode == AddrMode) {
1552 DEBUG(dbgs() << "CGP: Found local addrmode: " << AddrMode << "\n");
1567 DEBUG(dbgs() << "CGP: Reusing nonlocal addrmode: " << AddrMode << " for "
1572 DEBUG(dbgs() << "CGP: SINKING nonlocal addrmode: " << AddrMode << " for "
1584 if (AddrMode.BaseReg) {
1585 Value *V = AddrMode.BaseReg;
1594 if (AddrMode.Scale) {
1595 Value *V = AddrMode.ScaledReg;
1606 if (AddrMode.Scale != 1)
1607 V = Builder.CreateMul(V, ConstantInt::get(IntPtrTy, AddrMode.Scale),
1616 if (AddrMode.BaseGV) {
1617 Value *V = Builder.CreatePtrToInt(AddrMode.BaseGV, IntPtrTy, "sunkaddr");
1625 if (AddrMode.BaseOffs) {
1626 Value *V = ConstantInt::get(IntPtrTy, AddrMode.BaseOffs);