OLD | NEW |
1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// | 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 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 // This file implements the TargetLoweringX8632 class, which | 10 // This file implements the TargetLoweringX8632 class, which |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 ~BoolFlagSaver() { Flag = OldValue; } | 258 ~BoolFlagSaver() { Flag = OldValue; } |
259 | 259 |
260 private: | 260 private: |
261 const bool OldValue; | 261 const bool OldValue; |
262 bool &Flag; | 262 bool &Flag; |
263 }; | 263 }; |
264 | 264 |
265 } // end of anonymous namespace | 265 } // end of anonymous namespace |
266 | 266 |
267 BoolFoldingEntry::BoolFoldingEntry(Inst *I) | 267 BoolFoldingEntry::BoolFoldingEntry(Inst *I) |
268 : Instr(I), IsComplex(BoolFolding::hasComplexLowering(I)), IsLiveOut(true), | 268 : Instr(I), IsComplex(BoolFolding::hasComplexLowering(I)) {} |
269 NumUses(0) {} | |
270 | 269 |
271 BoolFolding::BoolFoldingProducerKind | 270 BoolFolding::BoolFoldingProducerKind |
272 BoolFolding::getProducerKind(const Inst *Instr) { | 271 BoolFolding::getProducerKind(const Inst *Instr) { |
273 if (llvm::isa<InstIcmp>(Instr)) { | 272 if (llvm::isa<InstIcmp>(Instr)) { |
274 if (Instr->getSrc(0)->getType() != IceType_i64) | 273 if (Instr->getSrc(0)->getType() != IceType_i64) |
275 return PK_Icmp32; | 274 return PK_Icmp32; |
276 return PK_None; // TODO(stichnot): actually PK_Icmp64; | 275 return PK_None; // TODO(stichnot): actually PK_Icmp64; |
277 } | 276 } |
278 return PK_None; // TODO(stichnot): remove this | 277 return PK_None; // TODO(stichnot): remove this |
279 | 278 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 I.second.Instr->dump(Func); | 402 I.second.Instr->dump(Func); |
404 Str << "\n"; | 403 Str << "\n"; |
405 } | 404 } |
406 } | 405 } |
407 | 406 |
408 void TargetX8632::initNodeForLowering(CfgNode *Node) { | 407 void TargetX8632::initNodeForLowering(CfgNode *Node) { |
409 FoldingInfo.init(Node); | 408 FoldingInfo.init(Node); |
410 FoldingInfo.dump(Func); | 409 FoldingInfo.dump(Func); |
411 } | 410 } |
412 | 411 |
413 TargetX8632::TargetX8632(Cfg *Func) | 412 TargetX8632::TargetX8632(Cfg *Func) : TargetLowering(Func) { |
414 : TargetLowering(Func), InstructionSet(X86InstructionSet::Begin), | |
415 IsEbpBasedFrame(false), NeedsStackAlignment(false), SpillAreaSizeBytes(0), | |
416 RandomizationPoolingPaused(false) { | |
417 static_assert((X86InstructionSet::End - X86InstructionSet::Begin) == | 413 static_assert((X86InstructionSet::End - X86InstructionSet::Begin) == |
418 (TargetInstructionSet::X86InstructionSet_End - | 414 (TargetInstructionSet::X86InstructionSet_End - |
419 TargetInstructionSet::X86InstructionSet_Begin), | 415 TargetInstructionSet::X86InstructionSet_Begin), |
420 "X86InstructionSet range different from TargetInstructionSet"); | 416 "X86InstructionSet range different from TargetInstructionSet"); |
421 if (Func->getContext()->getFlags().getTargetInstructionSet() != | 417 if (Func->getContext()->getFlags().getTargetInstructionSet() != |
422 TargetInstructionSet::BaseInstructionSet) { | 418 TargetInstructionSet::BaseInstructionSet) { |
423 InstructionSet = static_cast<X86InstructionSet>( | 419 InstructionSet = static_cast<X86InstructionSet>( |
424 (Func->getContext()->getFlags().getTargetInstructionSet() - | 420 (Func->getContext()->getFlags().getTargetInstructionSet() - |
425 TargetInstructionSet::X86InstructionSet_Begin) + | 421 TargetInstructionSet::X86InstructionSet_Begin) + |
426 X86InstructionSet::Begin); | 422 X86InstructionSet::Begin); |
(...skipping 5286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5713 } | 5709 } |
5714 assert("Unsupported -randomize-pool-immediates option" && false); | 5710 assert("Unsupported -randomize-pool-immediates option" && false); |
5715 } | 5711 } |
5716 } | 5712 } |
5717 // the offset is not eligible for blinding or pooling, return the original | 5713 // the offset is not eligible for blinding or pooling, return the original |
5718 // mem operand | 5714 // mem operand |
5719 return MemOperand; | 5715 return MemOperand; |
5720 } | 5716 } |
5721 | 5717 |
5722 } // end of namespace Ice | 5718 } // end of namespace Ice |
OLD | NEW |