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

Side by Side Diff: src/IceTargetLowering.cpp

Issue 1169493002: Subzero: Improve/refactor folding loads into the next instruction. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 5 years, 6 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
OLDNEW
1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// 1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===//
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 // This file implements the skeleton of the TargetLowering class, 10 // This file implements the skeleton of the TargetLowering class,
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 } 244 }
245 } 245 }
246 246
247 void TargetLowering::sortVarsByAlignment(VarList &Dest, 247 void TargetLowering::sortVarsByAlignment(VarList &Dest,
248 const VarList &Source) const { 248 const VarList &Source) const {
249 Dest = Source; 249 Dest = Source;
250 // Instead of std::sort, we could do a bucket sort with log2(alignment) 250 // Instead of std::sort, we could do a bucket sort with log2(alignment)
251 // as the buckets, if performance is an issue. 251 // as the buckets, if performance is an issue.
252 std::sort(Dest.begin(), Dest.end(), 252 std::sort(Dest.begin(), Dest.end(),
253 [this](const Variable *V1, const Variable *V2) { 253 [this](const Variable *V1, const Variable *V2) {
254 return typeWidthInBytesOnStack(V1->getType()) > 254 return typeWidthInBytesOnStack(V1->getType()) >
255 typeWidthInBytesOnStack(V2->getType()); 255 typeWidthInBytesOnStack(V2->getType());
256 }); 256 });
257 } 257 }
258 258
259 void TargetLowering::getVarStackSlotParams( 259 void TargetLowering::getVarStackSlotParams(
260 VarList &SortedSpilledVariables, llvm::SmallBitVector &RegsUsed, 260 VarList &SortedSpilledVariables, llvm::SmallBitVector &RegsUsed,
261 size_t *GlobalsSize, size_t *SpillAreaSizeBytes, 261 size_t *GlobalsSize, size_t *SpillAreaSizeBytes,
262 uint32_t *SpillAreaAlignmentBytes, uint32_t *LocalsSlotsAlignmentBytes, 262 uint32_t *SpillAreaAlignmentBytes, uint32_t *LocalsSlotsAlignmentBytes,
263 std::function<bool(Variable *)> TargetVarHook) { 263 std::function<bool(Variable *)> TargetVarHook) {
264 const VariablesMetadata *VMetadata = Func->getVMetadata(); 264 const VariablesMetadata *VMetadata = Func->getVMetadata();
265 llvm::BitVector IsVarReferenced(Func->getNumVariables()); 265 llvm::BitVector IsVarReferenced(Func->getNumVariables());
266 for (CfgNode *Node : Func->getNodes()) { 266 for (CfgNode *Node : Func->getNodes()) {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 return std::unique_ptr<TargetDataLowering>(TargetData##X::create(Ctx)); 438 return std::unique_ptr<TargetDataLowering>(TargetData##X::create(Ctx));
439 #include "llvm/Config/SZTargets.def" 439 #include "llvm/Config/SZTargets.def"
440 440
441 llvm_unreachable("Unsupported target data lowering"); 441 llvm_unreachable("Unsupported target data lowering");
442 return nullptr; 442 return nullptr;
443 } 443 }
444 444
445 TargetDataLowering::~TargetDataLowering() {} 445 TargetDataLowering::~TargetDataLowering() {}
446 446
447 } // end of namespace Ice 447 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceTargetLoweringX8632.h » ('j') | src/IceTargetLoweringX8632.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698