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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInstX86BaseImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX86Base.h
diff --git a/src/IceTargetLoweringX86Base.h b/src/IceTargetLoweringX86Base.h
index d89d74753dfab9f136338a4895051c6b9b256b6b..c0a2d4239c8cf8250eab973bfd0f3e951e9ae11e 100644
--- a/src/IceTargetLoweringX86Base.h
+++ b/src/IceTargetLoweringX86Base.h
@@ -582,6 +582,37 @@ protected:
Context.insert(Traits::Insts::XorRMW::create(Func, DestSrc0, Src1));
}
+ void _iaca_start() {
+ if (!BuildDefs::minimal())
+ Context.insert(Traits::Insts::IacaStart::create(Func));
+ }
+ void _iaca_end() {
+ if (!BuildDefs::minimal())
+ Context.insert(Traits::Insts::IacaEnd::create(Func));
+ }
+
+ /// This class helps wrap IACA markers around the code generated by the
+ /// current scope. It means you don't need to put an end before each return.
+ class ScopedIacaMark {
+ ScopedIacaMark(const ScopedIacaMark &) = delete;
+ ScopedIacaMark &operator=(const ScopedIacaMark &) = delete;
+
+ public:
+ ScopedIacaMark(TargetX86Base *Lowering) : Lowering(Lowering) {
+ Lowering->_iaca_start();
+ }
+ ~ScopedIacaMark() { end(); }
+ void end() {
+ if (!Lowering)
+ return;
+ Lowering->_iaca_end();
+ Lowering = nullptr;
+ }
+
+ private:
+ TargetX86Base *Lowering;
+ };
+
bool optimizeScalarMul(Variable *Dest, Operand *Src0, int32_t Src1);
void findRMW();
« 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