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

Unified Diff: src/IceInst.cpp

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/IceInst.h ('k') | src/IceTargetLowering.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.cpp
diff --git a/src/IceInst.cpp b/src/IceInst.cpp
index aac42c3bd2f98823a6a1a0d622c6f4558210f1d2..6eb805846007bd4d7191b71a5645b1ac0cd9cf70 100644
--- a/src/IceInst.cpp
+++ b/src/IceInst.cpp
@@ -112,6 +112,7 @@ const char *Inst::getInstName() const {
X(FakeUse, "fakeuse");
X(FakeKill, "fakekill");
X(JumpTable, "jumptable");
+ X(ShuffleVector, "shufflevector");
#undef X
default:
assert(Kind >= Target);
@@ -574,6 +575,15 @@ InstFakeUse::InstFakeUse(Cfg *Func, Variable *Src, uint32_t Weight)
InstFakeKill::InstFakeKill(Cfg *Func, const Inst *Linked)
: InstHighLevel(Func, Inst::FakeKill, 0, nullptr), Linked(Linked) {}
+InstShuffleVector::InstShuffleVector(Cfg *Func, Variable *Dest, Variable *Src0,
+ Variable *Src1)
+ : InstHighLevel(Func, Inst::ShuffleVector, 2, Dest),
+ NumIndexes(typeNumElements(Dest->getType())) {
+ addSource(Src0);
+ addSource(Src1);
+ Indexes = Func->allocateArrayOf<ConstantInteger32 *>(NumIndexes);
+}
+
namespace {
GlobalString makeName(Cfg *Func, const SizeT Id) {
const auto FuncName = Func->getFunctionName();
@@ -1032,6 +1042,21 @@ void InstFakeKill::dump(const Cfg *Func) const {
Str << "kill.pseudo scratch_regs";
}
+void InstShuffleVector::dump(const Cfg *Func) const {
+ if (!BuildDefs::dump())
+ return;
+ Ostream &Str = Func->getContext()->getStrDump();
+ Str << "shufflevector ";
+ dumpDest(Func);
+ Str << " = ";
+ dumpSources(Func);
+ for (SizeT I = 0; I < NumIndexes; ++I) {
+ Str << ", ";
+ Indexes[I]->dump(Func);
+ }
+ Str << "\n";
+}
+
void InstJumpTable::dump(const Cfg *Func) const {
if (!BuildDefs::dump())
return;
« no previous file with comments | « src/IceInst.h ('k') | src/IceTargetLowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698