OLD | NEW |
1 //===- subzero/src/IceTargetLoweringX86Base.h - x86 lowering ----*- C++ -*-===// | 1 //===- subzero/src/IceTargetLoweringX86Base.h - x86 lowering ----*- C++ -*-===// |
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 using Machine::RegSet_FramePointer; | 89 using Machine::RegSet_FramePointer; |
90 using Machine::RegSet_None; | 90 using Machine::RegSet_None; |
91 using Machine::RegSet_StackPointer; | 91 using Machine::RegSet_StackPointer; |
92 using Machine::Context; | 92 using Machine::Context; |
93 using Machine::Ctx; | 93 using Machine::Ctx; |
94 using Machine::Func; | 94 using Machine::Func; |
95 using RegSetMask = typename Machine::RegSetMask; | 95 using RegSetMask = typename Machine::RegSetMask; |
96 | 96 |
97 using Machine::_bundle_lock; | 97 using Machine::_bundle_lock; |
98 using Machine::_bundle_unlock; | 98 using Machine::_bundle_unlock; |
| 99 using Machine::_set_dest_nonkillable; |
99 using Machine::getContext; | 100 using Machine::getContext; |
100 using Machine::getStackAdjustment; | 101 using Machine::getStackAdjustment; |
101 using Machine::regAlloc; | 102 using Machine::regAlloc; |
102 using Machine::resetStackAdjustment; | 103 using Machine::resetStackAdjustment; |
103 | 104 |
104 static TargetX86Base *create(Cfg *Func) { return new TargetX86Base(Func); } | 105 static TargetX86Base *create(Cfg *Func) { return new TargetX86Base(Func); } |
105 | 106 |
106 void translateOm1() override; | 107 void translateOm1() override; |
107 void translateO2() override; | 108 void translateO2() override; |
108 void doLoadOpt(); | 109 void doLoadOpt(); |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 InstFakeDef::create(Func, Src, llvm::dyn_cast<Variable>(Dest))); | 581 InstFakeDef::create(Func, Src, llvm::dyn_cast<Variable>(Dest))); |
581 _set_dest_nonkillable(); | 582 _set_dest_nonkillable(); |
582 Context.insert(InstFakeUse::create(Func, Src)); | 583 Context.insert(InstFakeUse::create(Func, Src)); |
583 } | 584 } |
584 void _xor(Variable *Dest, Operand *Src0) { | 585 void _xor(Variable *Dest, Operand *Src0) { |
585 Context.insert(Traits::Insts::Xor::create(Func, Dest, Src0)); | 586 Context.insert(Traits::Insts::Xor::create(Func, Dest, Src0)); |
586 } | 587 } |
587 void _xor_rmw(typename Traits::X86OperandMem *DestSrc0, Operand *Src1) { | 588 void _xor_rmw(typename Traits::X86OperandMem *DestSrc0, Operand *Src1) { |
588 Context.insert(Traits::Insts::XorRMW::create(Func, DestSrc0, Src1)); | 589 Context.insert(Traits::Insts::XorRMW::create(Func, DestSrc0, Src1)); |
589 } | 590 } |
590 void _set_dest_nonkillable() { | |
591 Context.getLastInserted()->setDestNonKillable(); | |
592 } | |
593 | 591 |
594 bool optimizeScalarMul(Variable *Dest, Operand *Src0, int32_t Src1); | 592 bool optimizeScalarMul(Variable *Dest, Operand *Src0, int32_t Src1); |
595 void findRMW(); | 593 void findRMW(); |
596 | 594 |
597 typename Traits::InstructionSet InstructionSet = | 595 typename Traits::InstructionSet InstructionSet = |
598 Traits::InstructionSet::Begin; | 596 Traits::InstructionSet::Begin; |
599 bool IsEbpBasedFrame = false; | 597 bool IsEbpBasedFrame = false; |
600 bool NeedsStackAlignment = false; | 598 bool NeedsStackAlignment = false; |
601 size_t SpillAreaSizeBytes = 0; | 599 size_t SpillAreaSizeBytes = 0; |
602 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; | 600 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; |
(...skipping 12 matching lines...) Expand all Loading... |
615 private: | 613 private: |
616 ~TargetX86Base() override {} | 614 ~TargetX86Base() override {} |
617 BoolFolding FoldingInfo; | 615 BoolFolding FoldingInfo; |
618 }; | 616 }; |
619 } // end of namespace X86Internal | 617 } // end of namespace X86Internal |
620 } // end of namespace Ice | 618 } // end of namespace Ice |
621 | 619 |
622 #include "IceTargetLoweringX86BaseImpl.h" | 620 #include "IceTargetLoweringX86BaseImpl.h" |
623 | 621 |
624 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H | 622 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H |
OLD | NEW |