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

Unified Diff: src/IceInst.h

Issue 1897243002: Subzero. Rematerializes shufflevector instructions. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 4 years, 8 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/IceDefs.h ('k') | src/IceInst.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.h
diff --git a/src/IceInst.h b/src/IceInst.h
index db273aa500c7f17e8eadb38bae559aaabe9d7a8c..ad62e0966a5fc096c760ed41fed45b6b9d6515c4 100644
--- a/src/IceInst.h
+++ b/src/IceInst.h
@@ -22,6 +22,7 @@
#include "IceDefs.h"
#include "IceInst.def"
#include "IceIntrinsics.h"
+#include "IceOperand.h"
#include "IceSwitchLowering.h"
#include "IceTypes.h"
@@ -61,14 +62,15 @@ public:
Select,
Store,
Switch,
- Assign, // not part of LLVM/PNaCl bitcode
- Breakpoint, // not part of LLVM/PNaCl bitcode
- BundleLock, // not part of LLVM/PNaCl bitcode
- BundleUnlock, // not part of LLVM/PNaCl bitcode
- FakeDef, // not part of LLVM/PNaCl bitcode
- FakeUse, // not part of LLVM/PNaCl bitcode
- FakeKill, // not part of LLVM/PNaCl bitcode
- JumpTable, // not part of LLVM/PNaCl bitcode
+ Assign, // not part of LLVM/PNaCl bitcode
+ Breakpoint, // not part of LLVM/PNaCl bitcode
+ BundleLock, // not part of LLVM/PNaCl bitcode
+ BundleUnlock, // not part of LLVM/PNaCl bitcode
+ FakeDef, // not part of LLVM/PNaCl bitcode
+ FakeUse, // not part of LLVM/PNaCl bitcode
+ FakeKill, // not part of LLVM/PNaCl bitcode
+ JumpTable, // not part of LLVM/PNaCl bitcode
+ ShuffleVector, // not part of LLVM/PNaCl bitcode
// Anything >= Target is an InstTarget subclass. Note that the value-spaces
// are shared across targets. To avoid confusion over the definition of
// shared values, an object specific to one target should never be passed
@@ -917,6 +919,52 @@ private:
const Inst *Linked;
};
+/// ShuffleVector instruction. This represents a shuffle operation on vector
+/// types. This instruction is not part of the PNaCl bitcode: it is generated
+/// by Subzero when it matches the pattern used by pnacl-clang when compiling
+/// to bitcode.
+class InstShuffleVector : public InstHighLevel {
+ InstShuffleVector() = delete;
+ InstShuffleVector(const InstShuffleVector &) = delete;
+ InstShuffleVector &operator=(const InstShuffleVector &) = delete;
+
+public:
+ static InstShuffleVector *create(Cfg *Func, Variable *Dest, Variable *Src0,
+ Variable *Src1) {
+ return new (Func->allocate<InstShuffleVector>())
+ InstShuffleVector(Func, Dest, Src0, Src1);
+ }
+
+ SizeT getNumIndexes() const { return NumIndexes; }
+
+ void addIndex(ConstantInteger32 *Index) {
+ assert(CurrentIndex < NumIndexes);
+ Indexes[CurrentIndex++] = Index;
+ }
+
+ ConstantInteger32 *getIndex(SizeT Pos) const {
+ assert(Pos < NumIndexes);
+ return Indexes[Pos];
+ }
+
+ void dump(const Cfg *Func) const override;
+ static bool classof(const Inst *Instr) {
+ return Instr->getKind() == ShuffleVector;
+ }
+
+private:
+ InstShuffleVector(Cfg *Func, Variable *Dest, Variable *Src0, Variable *Src1);
+
+ void destroy(Cfg *Func) override {
+ Func->deallocateArrayOf<ConstantInteger32 *>(Indexes);
+ Inst::destroy(Func);
+ }
+
+ ConstantInteger32 **Indexes;
+ SizeT CurrentIndex = 0;
+ const SizeT NumIndexes;
+};
+
/// JumpTable instruction. This represents a jump table that will be stored in
/// the .rodata section. This is used to track and repoint the target CfgNodes
/// which may change, for example due to splitting for phi lowering.
« no previous file with comments | « src/IceDefs.h ('k') | src/IceInst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698