Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: src/IceTargetLoweringARM32.cpp

Issue 1368993004: Subzero: Improve usability of liveness-related tools. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceTargetLoweringARM32.h ('k') | src/IceTargetLoweringMIPS32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLoweringARM32.cpp - ARM32 lowering ------------===// 1 //===- subzero/src/IceTargetLoweringARM32.cpp - ARM32 lowering ------------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 Variable *T2 = makeReg(IceType_i32); 1497 Variable *T2 = makeReg(IceType_i32);
1498 Variable *TA_Hi = makeReg(IceType_i32); 1498 Variable *TA_Hi = makeReg(IceType_i32);
1499 Variable *TA_Lo = makeReg(IceType_i32); 1499 Variable *TA_Lo = makeReg(IceType_i32);
1500 _rsb(T0, Src1RLo, _32); 1500 _rsb(T0, Src1RLo, _32);
1501 _lsr(T1, Src0RLo, T0); 1501 _lsr(T1, Src0RLo, T0);
1502 _orr(TA_Hi, T1, OperandARM32FlexReg::create(Func, IceType_i32, Src0RHi, 1502 _orr(TA_Hi, T1, OperandARM32FlexReg::create(Func, IceType_i32, Src0RHi,
1503 OperandARM32::LSL, Src1RLo)); 1503 OperandARM32::LSL, Src1RLo));
1504 _sub(T2, Src1RLo, _32); 1504 _sub(T2, Src1RLo, _32);
1505 _cmp(T2, _0); 1505 _cmp(T2, _0);
1506 _lsl(TA_Hi, Src0RLo, T2, CondARM32::GE); 1506 _lsl(TA_Hi, Src0RLo, T2, CondARM32::GE);
1507 _set_dest_nonkillable(); 1507 _set_dest_redefined();
1508 _lsl(TA_Lo, Src0RLo, Src1RLo); 1508 _lsl(TA_Lo, Src0RLo, Src1RLo);
1509 _mov(DestLo, TA_Lo); 1509 _mov(DestLo, TA_Lo);
1510 _mov(DestHi, TA_Hi); 1510 _mov(DestHi, TA_Hi);
1511 return; 1511 return;
1512 } 1512 }
1513 case InstArithmetic::Lshr: 1513 case InstArithmetic::Lshr:
1514 case InstArithmetic::Ashr: { 1514 case InstArithmetic::Ashr: {
1515 // a=b>>c 1515 // a=b>>c
1516 // pnacl-llc does: 1516 // pnacl-llc does:
1517 // mov t_b.lo, b.lo 1517 // mov t_b.lo, b.lo
(...skipping 30 matching lines...) Expand all
1548 Variable *TA_Lo = makeReg(IceType_i32); 1548 Variable *TA_Lo = makeReg(IceType_i32);
1549 Variable *TA_Hi = makeReg(IceType_i32); 1549 Variable *TA_Hi = makeReg(IceType_i32);
1550 _lsr(T0, Src0RLo, Src1RLo); 1550 _lsr(T0, Src0RLo, Src1RLo);
1551 _rsb(T1, Src1RLo, _32); 1551 _rsb(T1, Src1RLo, _32);
1552 _orr(TA_Lo, T0, OperandARM32FlexReg::create(Func, IceType_i32, Src0RHi, 1552 _orr(TA_Lo, T0, OperandARM32FlexReg::create(Func, IceType_i32, Src0RHi,
1553 OperandARM32::LSL, T1)); 1553 OperandARM32::LSL, T1));
1554 _sub(T2, Src1RLo, _32); 1554 _sub(T2, Src1RLo, _32);
1555 _cmp(T2, _0); 1555 _cmp(T2, _0);
1556 if (IsAshr) { 1556 if (IsAshr) {
1557 _asr(TA_Lo, Src0RHi, T2, CondARM32::GE); 1557 _asr(TA_Lo, Src0RHi, T2, CondARM32::GE);
1558 _set_dest_nonkillable(); 1558 _set_dest_redefined();
1559 _asr(TA_Hi, Src0RHi, Src1RLo); 1559 _asr(TA_Hi, Src0RHi, Src1RLo);
1560 } else { 1560 } else {
1561 _lsr(TA_Lo, Src0RHi, T2, CondARM32::GE); 1561 _lsr(TA_Lo, Src0RHi, T2, CondARM32::GE);
1562 _set_dest_nonkillable(); 1562 _set_dest_redefined();
1563 _lsr(TA_Hi, Src0RHi, Src1RLo); 1563 _lsr(TA_Hi, Src0RHi, Src1RLo);
1564 } 1564 }
1565 _mov(DestLo, TA_Lo); 1565 _mov(DestLo, TA_Lo);
1566 _mov(DestHi, TA_Hi); 1566 _mov(DestHi, TA_Hi);
1567 return; 1567 return;
1568 } 1568 }
1569 case InstArithmetic::Fadd: 1569 case InstArithmetic::Fadd:
1570 case InstArithmetic::Fsub: 1570 case InstArithmetic::Fsub:
1571 case InstArithmetic::Fmul: 1571 case InstArithmetic::Fmul:
1572 case InstArithmetic::Fdiv: 1572 case InstArithmetic::Fdiv:
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
2297 lowerAssign(InstAssign::create(Func, Dest, T)); 2297 lowerAssign(InstAssign::create(Func, Dest, T));
2298 break; 2298 break;
2299 } 2299 }
2300 case IceType_v4i1: 2300 case IceType_v4i1:
2301 case IceType_v8i1: 2301 case IceType_v8i1:
2302 case IceType_v16i1: 2302 case IceType_v16i1:
2303 case IceType_v8i16: 2303 case IceType_v8i16:
2304 case IceType_v16i8: 2304 case IceType_v16i8:
2305 case IceType_v4f32: 2305 case IceType_v4f32:
2306 case IceType_v4i32: { 2306 case IceType_v4i32: {
2307 // avoid cryptic liveness errors 2307 // avoid liveness errors
2308 Variable *T = makeReg(DestType); 2308 Variable *T = makeReg(DestType);
2309 Context.insert(InstFakeDef::create(Func, T, legalizeToReg(Src0))); 2309 Context.insert(InstFakeDef::create(Func, T, legalizeToReg(Src0)));
2310 _mov(Dest, T); 2310 _mov(Dest, T);
2311 UnimplementedError(Func->getContext()->getFlags()); 2311 UnimplementedError(Func->getContext()->getFlags());
2312 break; 2312 break;
2313 } 2313 }
2314 } 2314 }
2315 break; 2315 break;
2316 } 2316 }
2317 } 2317 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
2381 _mov(T, Ctx->getConstantZero(IceType_i32)); 2381 _mov(T, Ctx->getConstantZero(IceType_i32));
2382 _vmrs(); 2382 _vmrs();
2383 Operand *One = Ctx->getConstantInt32(1); 2383 Operand *One = Ctx->getConstantInt32(1);
2384 InstFcmp::FCond Condition = Inst->getCondition(); 2384 InstFcmp::FCond Condition = Inst->getCondition();
2385 assert(Condition < llvm::array_lengthof(TableFcmp)); 2385 assert(Condition < llvm::array_lengthof(TableFcmp));
2386 CondARM32::Cond CC0 = TableFcmp[Condition].CC0; 2386 CondARM32::Cond CC0 = TableFcmp[Condition].CC0;
2387 CondARM32::Cond CC1 = TableFcmp[Condition].CC1; 2387 CondARM32::Cond CC1 = TableFcmp[Condition].CC1;
2388 if (CC0 != CondARM32::kNone) { 2388 if (CC0 != CondARM32::kNone) {
2389 _mov(T, One, CC0); 2389 _mov(T, One, CC0);
2390 // If this mov is not a maybe mov, but an actual mov (i.e., CC0 == AL), we 2390 // If this mov is not a maybe mov, but an actual mov (i.e., CC0 == AL), we
2391 // don't want to set_dest_nonkillable so that liveness + dead-code 2391 // don't want to _set_dest_redefined so that liveness + dead-code
2392 // elimination will get rid of the previous assignment (i.e., T = 0) above. 2392 // elimination will get rid of the previous assignment (i.e., T = 0) above.
2393 // TODO(stichnot,jpp): We should be able to conditionally create the "T=0"
2394 // instruction based on CC0, instead of relying on DCE to remove it.
2393 if (CC0 != CondARM32::AL) 2395 if (CC0 != CondARM32::AL)
2394 _set_dest_nonkillable(); 2396 _set_dest_redefined();
2395 } 2397 }
2396 if (CC1 != CondARM32::kNone) { 2398 if (CC1 != CondARM32::kNone) {
2397 assert(CC0 != CondARM32::kNone); 2399 assert(CC0 != CondARM32::kNone);
2398 assert(CC1 != CondARM32::AL); 2400 assert(CC1 != CondARM32::AL);
2399 _mov_nonkillable(T, One, CC1); 2401 _mov_redefined(T, One, CC1);
2400 } 2402 }
2401 _mov(Dest, T); 2403 _mov(Dest, T);
2402 } 2404 }
2403 2405
2404 void TargetARM32::lowerIcmp(const InstIcmp *Inst) { 2406 void TargetARM32::lowerIcmp(const InstIcmp *Inst) {
2405 Variable *Dest = Inst->getDest(); 2407 Variable *Dest = Inst->getDest();
2406 Operand *Src0 = legalizeUndef(Inst->getSrc(0)); 2408 Operand *Src0 = legalizeUndef(Inst->getSrc(0));
2407 Operand *Src1 = legalizeUndef(Inst->getSrc(1)); 2409 Operand *Src1 = legalizeUndef(Inst->getSrc(1));
2408 2410
2409 if (isVectorType(Dest->getType())) { 2411 if (isVectorType(Dest->getType())) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
2468 _cmp(Src0Lo, Src1LoRF); 2470 _cmp(Src0Lo, Src1LoRF);
2469 _sbcs(ScratchReg, Src0Hi, Src1HiRF); 2471 _sbcs(ScratchReg, Src0Hi, Src1HiRF);
2470 // ScratchReg isn't going to be used, but we need the side-effect of 2472 // ScratchReg isn't going to be used, but we need the side-effect of
2471 // setting flags from this operation. 2473 // setting flags from this operation.
2472 Context.insert(InstFakeUse::create(Func, ScratchReg)); 2474 Context.insert(InstFakeUse::create(Func, ScratchReg));
2473 } else { 2475 } else {
2474 _cmp(Src0Hi, Src1HiRF); 2476 _cmp(Src0Hi, Src1HiRF);
2475 _cmp(Src0Lo, Src1LoRF, CondARM32::EQ); 2477 _cmp(Src0Lo, Src1LoRF, CondARM32::EQ);
2476 } 2478 }
2477 _mov(T, One, TableIcmp64[Index].C1); 2479 _mov(T, One, TableIcmp64[Index].C1);
2478 _mov_nonkillable(T, Zero, TableIcmp64[Index].C2); 2480 _mov_redefined(T, Zero, TableIcmp64[Index].C2);
2479 _mov(Dest, T); 2481 _mov(Dest, T);
2480 return; 2482 return;
2481 } 2483 }
2482 2484
2483 // a=icmp cond b, c ==> 2485 // a=icmp cond b, c ==>
2484 // GCC does: 2486 // GCC does:
2485 // <u/s>xtb tb, b 2487 // <u/s>xtb tb, b
2486 // <u/s>xtb tc, c 2488 // <u/s>xtb tc, c
2487 // cmp tb, tc 2489 // cmp tb, tc
2488 // mov.C1 t, #0 2490 // mov.C1 t, #0
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
2524 _mov(T, Zero); 2526 _mov(T, Zero);
2525 if (ShiftAmt) { 2527 if (ShiftAmt) {
2526 Variable *Src1R = legalizeToReg(Src1); 2528 Variable *Src1R = legalizeToReg(Src1);
2527 OperandARM32FlexReg *Src1RShifted = OperandARM32FlexReg::create( 2529 OperandARM32FlexReg *Src1RShifted = OperandARM32FlexReg::create(
2528 Func, IceType_i32, Src1R, OperandARM32::LSL, ShiftConst); 2530 Func, IceType_i32, Src1R, OperandARM32::LSL, ShiftConst);
2529 _cmp(Src0R, Src1RShifted); 2531 _cmp(Src0R, Src1RShifted);
2530 } else { 2532 } else {
2531 Operand *Src1RF = legalize(Src1, Legal_Reg | Legal_Flex); 2533 Operand *Src1RF = legalize(Src1, Legal_Reg | Legal_Flex);
2532 _cmp(Src0R, Src1RF); 2534 _cmp(Src0R, Src1RF);
2533 } 2535 }
2534 _mov_nonkillable(T, One, getIcmp32Mapping(Inst->getCondition())); 2536 _mov_redefined(T, One, getIcmp32Mapping(Inst->getCondition()));
2535 _mov(Dest, T); 2537 _mov(Dest, T);
2536 return; 2538 return;
2537 } 2539 }
2538 2540
2539 void TargetARM32::lowerInsertElement(const InstInsertElement *Inst) { 2541 void TargetARM32::lowerInsertElement(const InstInsertElement *Inst) {
2540 (void)Inst; 2542 (void)Inst;
2541 UnimplementedError(Func->getContext()->getFlags()); 2543 UnimplementedError(Func->getContext()->getFlags());
2542 } 2544 }
2543 2545
2544 void TargetARM32::lowerIntrinsicCall(const InstIntrinsicCall *Instr) { 2546 void TargetARM32::lowerIntrinsicCall(const InstIntrinsicCall *Instr) {
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
2746 } 2748 }
2747 case Intrinsics::Stacksave: { 2749 case Intrinsics::Stacksave: {
2748 Variable *SP = getPhysicalRegister(RegARM32::Reg_sp); 2750 Variable *SP = getPhysicalRegister(RegARM32::Reg_sp);
2749 Variable *Dest = Instr->getDest(); 2751 Variable *Dest = Instr->getDest();
2750 _mov(Dest, SP); 2752 _mov(Dest, SP);
2751 return; 2753 return;
2752 } 2754 }
2753 case Intrinsics::Stackrestore: { 2755 case Intrinsics::Stackrestore: {
2754 Variable *SP = getPhysicalRegister(RegARM32::Reg_sp); 2756 Variable *SP = getPhysicalRegister(RegARM32::Reg_sp);
2755 Operand *Val = legalize(Instr->getArg(0), Legal_Reg | Legal_Flex); 2757 Operand *Val = legalize(Instr->getArg(0), Legal_Reg | Legal_Flex);
2756 _mov_nonkillable(SP, Val); 2758 _mov_redefined(SP, Val);
2757 return; 2759 return;
2758 } 2760 }
2759 case Intrinsics::Trap: 2761 case Intrinsics::Trap:
2760 _trap(); 2762 _trap();
2761 return; 2763 return;
2762 case Intrinsics::UnknownIntrinsic: 2764 case Intrinsics::UnknownIntrinsic:
2763 Func->setError("Should not be lowering UnknownIntrinsic"); 2765 Func->setError("Should not be lowering UnknownIntrinsic");
2764 return; 2766 return;
2765 } 2767 }
2766 return; 2768 return;
2767 } 2769 }
2768 2770
2769 void TargetARM32::lowerCLZ(Variable *Dest, Variable *ValLoR, Variable *ValHiR) { 2771 void TargetARM32::lowerCLZ(Variable *Dest, Variable *ValLoR, Variable *ValHiR) {
2770 Type Ty = Dest->getType(); 2772 Type Ty = Dest->getType();
2771 assert(Ty == IceType_i32 || Ty == IceType_i64); 2773 assert(Ty == IceType_i32 || Ty == IceType_i64);
2772 Variable *T = makeReg(IceType_i32); 2774 Variable *T = makeReg(IceType_i32);
2773 _clz(T, ValLoR); 2775 _clz(T, ValLoR);
2774 if (Ty == IceType_i64) { 2776 if (Ty == IceType_i64) {
2775 Variable *DestLo = llvm::cast<Variable>(loOperand(Dest)); 2777 Variable *DestLo = llvm::cast<Variable>(loOperand(Dest));
2776 Variable *DestHi = llvm::cast<Variable>(hiOperand(Dest)); 2778 Variable *DestHi = llvm::cast<Variable>(hiOperand(Dest));
2777 Operand *Zero = 2779 Operand *Zero =
2778 legalize(Ctx->getConstantZero(IceType_i32), Legal_Reg | Legal_Flex); 2780 legalize(Ctx->getConstantZero(IceType_i32), Legal_Reg | Legal_Flex);
2779 Operand *ThirtyTwo = 2781 Operand *ThirtyTwo =
2780 legalize(Ctx->getConstantInt32(32), Legal_Reg | Legal_Flex); 2782 legalize(Ctx->getConstantInt32(32), Legal_Reg | Legal_Flex);
2781 _cmp(ValHiR, Zero); 2783 _cmp(ValHiR, Zero);
2782 Variable *T2 = makeReg(IceType_i32); 2784 Variable *T2 = makeReg(IceType_i32);
2783 _add(T2, T, ThirtyTwo); 2785 _add(T2, T, ThirtyTwo);
2784 _clz(T2, ValHiR, CondARM32::NE); 2786 _clz(T2, ValHiR, CondARM32::NE);
2785 // T2 is actually a source as well when the predicate is not AL (since it 2787 // T2 is actually a source as well when the predicate is not AL (since it
2786 // may leave T2 alone). We use set_dest_nonkillable to prolong the liveness 2788 // may leave T2 alone). We use _set_dest_redefined to prolong the liveness
2787 // of T2 as if it was used as a source. 2789 // of T2 as if it was used as a source.
2788 _set_dest_nonkillable(); 2790 _set_dest_redefined();
2789 _mov(DestLo, T2); 2791 _mov(DestLo, T2);
2790 Variable *T3 = makeReg(Zero->getType()); 2792 Variable *T3 = makeReg(Zero->getType());
2791 _mov(T3, Zero); 2793 _mov(T3, Zero);
2792 _mov(DestHi, T3); 2794 _mov(DestHi, T3);
2793 return; 2795 return;
2794 } 2796 }
2795 _mov(Dest, T); 2797 _mov(Dest, T);
2796 return; 2798 return;
2797 } 2799 }
2798 2800
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
2886 static constexpr CondARM32::Cond Cond = CondARM32::NE; 2888 static constexpr CondARM32::Cond Cond = CondARM32::NE;
2887 if (DestTy == IceType_i64) { 2889 if (DestTy == IceType_i64) {
2888 SrcT = legalizeUndef(SrcT); 2890 SrcT = legalizeUndef(SrcT);
2889 SrcF = legalizeUndef(SrcF); 2891 SrcF = legalizeUndef(SrcF);
2890 // Set the low portion. 2892 // Set the low portion.
2891 Variable *DestLo = llvm::cast<Variable>(loOperand(Dest)); 2893 Variable *DestLo = llvm::cast<Variable>(loOperand(Dest));
2892 Operand *SrcFLo = legalize(loOperand(SrcF), Legal_Reg | Legal_Flex); 2894 Operand *SrcFLo = legalize(loOperand(SrcF), Legal_Reg | Legal_Flex);
2893 Variable *TLo = makeReg(SrcFLo->getType()); 2895 Variable *TLo = makeReg(SrcFLo->getType());
2894 _mov(TLo, SrcFLo); 2896 _mov(TLo, SrcFLo);
2895 Operand *SrcTLo = legalize(loOperand(SrcT), Legal_Reg | Legal_Flex); 2897 Operand *SrcTLo = legalize(loOperand(SrcT), Legal_Reg | Legal_Flex);
2896 _mov_nonkillable(TLo, SrcTLo, Cond); 2898 _mov_redefined(TLo, SrcTLo, Cond);
2897 _mov(DestLo, TLo); 2899 _mov(DestLo, TLo);
2898 // Set the high portion. 2900 // Set the high portion.
2899 Variable *DestHi = llvm::cast<Variable>(hiOperand(Dest)); 2901 Variable *DestHi = llvm::cast<Variable>(hiOperand(Dest));
2900 Operand *SrcFHi = legalize(hiOperand(SrcF), Legal_Reg | Legal_Flex); 2902 Operand *SrcFHi = legalize(hiOperand(SrcF), Legal_Reg | Legal_Flex);
2901 Variable *THi = makeReg(SrcFHi->getType()); 2903 Variable *THi = makeReg(SrcFHi->getType());
2902 _mov(THi, SrcFHi); 2904 _mov(THi, SrcFHi);
2903 Operand *SrcTHi = legalize(hiOperand(SrcT), Legal_Reg | Legal_Flex); 2905 Operand *SrcTHi = legalize(hiOperand(SrcT), Legal_Reg | Legal_Flex);
2904 _mov_nonkillable(THi, SrcTHi, Cond); 2906 _mov_redefined(THi, SrcTHi, Cond);
2905 _mov(DestHi, THi); 2907 _mov(DestHi, THi);
2906 return; 2908 return;
2907 } 2909 }
2908 2910
2909 if (isFloatingType(DestTy)) { 2911 if (isFloatingType(DestTy)) {
2910 Variable *T = makeReg(DestTy); 2912 Variable *T = makeReg(DestTy);
2911 SrcF = legalizeToReg(SrcF); 2913 SrcF = legalizeToReg(SrcF);
2912 assert(DestTy == SrcF->getType()); 2914 assert(DestTy == SrcF->getType());
2913 _mov(T, SrcF); 2915 _mov(T, SrcF);
2914 SrcT = legalizeToReg(SrcT); 2916 SrcT = legalizeToReg(SrcT);
2915 assert(DestTy == SrcT->getType()); 2917 assert(DestTy == SrcT->getType());
2916 _mov(T, SrcT, Cond); 2918 _mov(T, SrcT, Cond);
2917 _set_dest_nonkillable(); 2919 _set_dest_redefined();
2918 _mov(Dest, T); 2920 _mov(Dest, T);
2919 return; 2921 return;
2920 } 2922 }
2921 2923
2922 SrcF = legalize(SrcF, Legal_Reg | Legal_Flex); 2924 SrcF = legalize(SrcF, Legal_Reg | Legal_Flex);
2923 Variable *T = makeReg(SrcF->getType()); 2925 Variable *T = makeReg(SrcF->getType());
2924 _mov(T, SrcF); 2926 _mov(T, SrcF);
2925 SrcT = legalize(SrcT, Legal_Reg | Legal_Flex); 2927 SrcT = legalize(SrcT, Legal_Reg | Legal_Flex);
2926 _mov_nonkillable(T, SrcT, Cond); 2928 _mov_redefined(T, SrcT, Cond);
2927 _mov(Dest, T); 2929 _mov(Dest, T);
2928 } 2930 }
2929 2931
2930 void TargetARM32::lowerStore(const InstStore *Inst) { 2932 void TargetARM32::lowerStore(const InstStore *Inst) {
2931 Operand *Value = Inst->getData(); 2933 Operand *Value = Inst->getData();
2932 Operand *Addr = Inst->getAddr(); 2934 Operand *Addr = Inst->getAddr();
2933 OperandARM32Mem *NewAddr = formMemoryOperand(Addr, Value->getType()); 2935 OperandARM32Mem *NewAddr = formMemoryOperand(Addr, Value->getType());
2934 Type Ty = NewAddr->getType(); 2936 Type Ty = NewAddr->getType();
2935 2937
2936 if (Ty == IceType_i64) { 2938 if (Ty == IceType_i64) {
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
3252 _bic(Reg, Reg, Mask); 3254 _bic(Reg, Reg, Mask);
3253 } else { 3255 } else {
3254 Mask = legalize(Ctx->getConstantInt32(-Align), Legal_Reg | Legal_Flex); 3256 Mask = legalize(Ctx->getConstantInt32(-Align), Legal_Reg | Legal_Flex);
3255 _and(Reg, Reg, Mask); 3257 _and(Reg, Reg, Mask);
3256 } 3258 }
3257 } 3259 }
3258 3260
3259 void TargetARM32::postLower() { 3261 void TargetARM32::postLower() {
3260 if (Ctx->getFlags().getOptLevel() == Opt_m1) 3262 if (Ctx->getFlags().getOptLevel() == Opt_m1)
3261 return; 3263 return;
3262 inferTwoAddress(); 3264 markRedefinitions();
3263 } 3265 }
3264 3266
3265 void TargetARM32::makeRandomRegisterPermutation( 3267 void TargetARM32::makeRandomRegisterPermutation(
3266 llvm::SmallVectorImpl<int32_t> &Permutation, 3268 llvm::SmallVectorImpl<int32_t> &Permutation,
3267 const llvm::SmallBitVector &ExcludeRegisters, uint64_t Salt) const { 3269 const llvm::SmallBitVector &ExcludeRegisters, uint64_t Salt) const {
3268 (void)Permutation; 3270 (void)Permutation;
3269 (void)ExcludeRegisters; 3271 (void)ExcludeRegisters;
3270 (void)Salt; 3272 (void)Salt;
3271 UnimplementedError(Func->getContext()->getFlags()); 3273 UnimplementedError(Func->getContext()->getFlags());
3272 } 3274 }
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
3483 << ".eabi_attribute 68, 1 @ Tag_Virtualization_use\n"; 3485 << ".eabi_attribute 68, 1 @ Tag_Virtualization_use\n";
3484 if (CPUFeatures.hasFeature(TargetARM32Features::HWDivArm)) { 3486 if (CPUFeatures.hasFeature(TargetARM32Features::HWDivArm)) {
3485 Str << ".eabi_attribute 44, 2 @ Tag_DIV_use\n"; 3487 Str << ".eabi_attribute 44, 2 @ Tag_DIV_use\n";
3486 } 3488 }
3487 // Technically R9 is used for TLS with Sandboxing, and we reserve it. 3489 // Technically R9 is used for TLS with Sandboxing, and we reserve it.
3488 // However, for compatibility with current NaCl LLVM, don't claim that. 3490 // However, for compatibility with current NaCl LLVM, don't claim that.
3489 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; 3491 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n";
3490 } 3492 }
3491 3493
3492 } // end of namespace Ice 3494 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringARM32.h ('k') | src/IceTargetLoweringMIPS32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698