OLD | NEW |
1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===// | 1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 assert(GeneratingTargetHelpers && | 504 assert(GeneratingTargetHelpers && |
505 "scalarizeInstruction called during incorrect phase"); | 505 "scalarizeInstruction called during incorrect phase"); |
506 const Type DestTy = Dest->getType(); | 506 const Type DestTy = Dest->getType(); |
507 assert(isVectorType(DestTy)); | 507 assert(isVectorType(DestTy)); |
508 const Type DestElementTy = typeElementType(DestTy); | 508 const Type DestElementTy = typeElementType(DestTy); |
509 const SizeT NumElements = typeNumElements(DestTy); | 509 const SizeT NumElements = typeNumElements(DestTy); |
510 | 510 |
511 Variable *T = Func->makeVariable(DestTy); | 511 Variable *T = Func->makeVariable(DestTy); |
512 if (auto *VarVecOn32 = llvm::dyn_cast<VariableVecOn32>(T)) { | 512 if (auto *VarVecOn32 = llvm::dyn_cast<VariableVecOn32>(T)) { |
513 VarVecOn32->initVecElement(Func); | 513 VarVecOn32->initVecElement(Func); |
| 514 auto *Undef = ConstantUndef::create(Ctx, DestTy); |
| 515 Context.insert<InstAssign>(T, Undef); |
| 516 } else { |
| 517 Context.insert<InstFakeDef>(T); |
514 } | 518 } |
515 Context.insert<InstFakeDef>(T); | |
516 | 519 |
517 for (SizeT I = 0; I < NumElements; ++I) { | 520 for (SizeT I = 0; I < NumElements; ++I) { |
518 auto *Index = Ctx->getConstantInt32(I); | 521 auto *Index = Ctx->getConstantInt32(I); |
519 | 522 |
520 auto makeExtractThunk = [this, Index, NumElements](Operand *Src) { | 523 auto makeExtractThunk = [this, Index, NumElements](Operand *Src) { |
521 return [this, Index, NumElements, Src]() { | 524 return [this, Index, NumElements, Src]() { |
522 assert(typeNumElements(Src->getType()) == NumElements); | 525 assert(typeNumElements(Src->getType()) == NumElements); |
523 | 526 |
524 const auto ElementTy = typeElementType(Src->getType()); | 527 const auto ElementTy = typeElementType(Src->getType()); |
525 auto *Op = Func->makeVariable(ElementTy); | 528 auto *Op = Func->makeVariable(ElementTy); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 virtual void lower() {} | 645 virtual void lower() {} |
643 | 646 |
644 protected: | 647 protected: |
645 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 648 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
646 GlobalContext *Ctx; | 649 GlobalContext *Ctx; |
647 }; | 650 }; |
648 | 651 |
649 } // end of namespace Ice | 652 } // end of namespace Ice |
650 | 653 |
651 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 654 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
OLD | NEW |