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

Unified Diff: src/IcePhiLoweringImpl.h

Issue 2619943003: [SubZero] Fix code generation issues occurred in Cross-test and PNaCL smoke-tests (Closed)
Patch Set: Addressed review comments Created 3 years, 11 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/IceInstMIPS32.cpp ('k') | src/IceTargetLoweringMIPS32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IcePhiLoweringImpl.h
diff --git a/src/IcePhiLoweringImpl.h b/src/IcePhiLoweringImpl.h
index d6a12b200021d1c36382d347d3b8beec58c2e4bd..b602e8152f99ad206f4305c39a6132a2df61aca8 100644
--- a/src/IcePhiLoweringImpl.h
+++ b/src/IcePhiLoweringImpl.h
@@ -36,7 +36,8 @@ void prelowerPhis32Bit(TargetT *Target, CfgNode *Node, Cfg *Func) {
if (Phi->isDeleted())
continue;
Variable *Dest = Phi->getDest();
- if (Dest->getType() == IceType_i64) {
+ Type DestTy = Dest->getType();
+ if (DestTy == IceType_i64) {
auto *DestLo = llvm::cast<Variable>(Target->loOperand(Dest));
auto *DestHi = llvm::cast<Variable>(Target->hiOperand(Dest));
auto *PhiLo = InstPhi::create(Func, Phi->getSrcSize(), DestLo);
@@ -51,6 +52,23 @@ void prelowerPhis32Bit(TargetT *Target, CfgNode *Node, Cfg *Func) {
Node->getPhis().push_back(PhiLo);
Node->getPhis().push_back(PhiHi);
Phi->setDeleted();
+ } else if (isVectorType(DestTy) &&
+ Target->shouldSplitToVariableVecOn32(DestTy)) {
+ auto *DstVec = llvm::cast<VariableVecOn32>(Dest);
+ SizeT Idx = 0;
+ for (Variable *DestElem : DstVec->getContainers()) {
+ auto *PhiElem = InstPhi::create(Func, Phi->getSrcSize(), DestElem);
+ for (SizeT I = 0; I < Phi->getSrcSize(); ++I) {
+ Operand *Src = Phi->getSrc(I);
+ CfgNode *Label = Phi->getLabel(I);
+ Src = Target->legalizeUndef(Src);
+ auto *SrcVec = llvm::cast<VariableVecOn32>(Src);
+ PhiElem->addArgument(SrcVec->getContainers()[Idx], Label);
+ }
+ ++Idx;
+ Node->getPhis().push_back(PhiElem);
+ }
+ Phi->setDeleted();
}
}
}
« no previous file with comments | « src/IceInstMIPS32.cpp ('k') | src/IceTargetLoweringMIPS32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698