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

Side by Side Diff: src/IceTargetLoweringX86Base.h

Issue 1260093003: Introduce the ability to insert IACA (Intel Architecture Code Analyzer) marks to (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 4 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/IceInstX86BaseImpl.h ('k') | no next file » | 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/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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 _set_dest_nonkillable(); 575 _set_dest_nonkillable();
576 Context.insert(InstFakeUse::create(Func, Src)); 576 Context.insert(InstFakeUse::create(Func, Src));
577 } 577 }
578 void _xor(Variable *Dest, Operand *Src0) { 578 void _xor(Variable *Dest, Operand *Src0) {
579 Context.insert(Traits::Insts::Xor::create(Func, Dest, Src0)); 579 Context.insert(Traits::Insts::Xor::create(Func, Dest, Src0));
580 } 580 }
581 void _xor_rmw(typename Traits::X86OperandMem *DestSrc0, Operand *Src1) { 581 void _xor_rmw(typename Traits::X86OperandMem *DestSrc0, Operand *Src1) {
582 Context.insert(Traits::Insts::XorRMW::create(Func, DestSrc0, Src1)); 582 Context.insert(Traits::Insts::XorRMW::create(Func, DestSrc0, Src1));
583 } 583 }
584 584
585 void _iaca_start() {
586 if (!BuildDefs::minimal())
587 Context.insert(Traits::Insts::IacaStart::create(Func));
588 }
589 void _iaca_end() {
590 if (!BuildDefs::minimal())
591 Context.insert(Traits::Insts::IacaEnd::create(Func));
592 }
593
594 /// This class helps wrap IACA markers around the code generated by the
595 /// current scope. It means you don't need to put an end before each return.
596 class ScopedIacaMark {
597 ScopedIacaMark(const ScopedIacaMark &) = delete;
598 ScopedIacaMark &operator=(const ScopedIacaMark &) = delete;
599
600 public:
601 ScopedIacaMark(TargetX86Base *Lowering) : Lowering(Lowering) {
602 Lowering->_iaca_start();
603 }
604 ~ScopedIacaMark() { end(); }
605 void end() {
606 if (!Lowering)
607 return;
608 Lowering->_iaca_end();
609 Lowering = nullptr;
610 }
611
612 private:
613 TargetX86Base *Lowering;
614 };
615
585 bool optimizeScalarMul(Variable *Dest, Operand *Src0, int32_t Src1); 616 bool optimizeScalarMul(Variable *Dest, Operand *Src0, int32_t Src1);
586 void findRMW(); 617 void findRMW();
587 618
588 typename Traits::InstructionSet InstructionSet = 619 typename Traits::InstructionSet InstructionSet =
589 Traits::InstructionSet::Begin; 620 Traits::InstructionSet::Begin;
590 bool IsEbpBasedFrame = false; 621 bool IsEbpBasedFrame = false;
591 bool NeedsStackAlignment = false; 622 bool NeedsStackAlignment = false;
592 size_t SpillAreaSizeBytes = 0; 623 size_t SpillAreaSizeBytes = 0;
593 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; 624 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM];
594 llvm::SmallBitVector ScratchRegs; 625 llvm::SmallBitVector ScratchRegs;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 } 658 }
628 659
629 BoolFolding FoldingInfo; 660 BoolFolding FoldingInfo;
630 }; 661 };
631 } // end of namespace X86Internal 662 } // end of namespace X86Internal
632 } // end of namespace Ice 663 } // end of namespace Ice
633 664
634 #include "IceTargetLoweringX86BaseImpl.h" 665 #include "IceTargetLoweringX86BaseImpl.h"
635 666
636 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H 667 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
OLDNEW
« no previous file with comments | « src/IceInstX86BaseImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698