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

Side by Side Diff: src/IceTargetLoweringX86BaseImpl.h

Issue 1426933003: Subzero: Force ebp-based frame when an alloca has a large alignment. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/alloc.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==// 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==//
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 /// \file 10 /// \file
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 // bit-manipulation problems below. 949 // bit-manipulation problems below.
950 AlignmentParam = std::max(AlignmentParam, 1u); 950 AlignmentParam = std::max(AlignmentParam, 1u);
951 951
952 // LLVM enforces power of 2 alignment. 952 // LLVM enforces power of 2 alignment.
953 assert(llvm::isPowerOf2_32(AlignmentParam)); 953 assert(llvm::isPowerOf2_32(AlignmentParam));
954 assert(llvm::isPowerOf2_32(Traits::X86_STACK_ALIGNMENT_BYTES)); 954 assert(llvm::isPowerOf2_32(Traits::X86_STACK_ALIGNMENT_BYTES));
955 955
956 uint32_t Alignment = 956 uint32_t Alignment =
957 std::max(AlignmentParam, Traits::X86_STACK_ALIGNMENT_BYTES); 957 std::max(AlignmentParam, Traits::X86_STACK_ALIGNMENT_BYTES);
958 if (Alignment > Traits::X86_STACK_ALIGNMENT_BYTES) { 958 if (Alignment > Traits::X86_STACK_ALIGNMENT_BYTES) {
959 IsEbpBasedFrame = true;
959 _and(esp, Ctx->getConstantInt32(-Alignment)); 960 _and(esp, Ctx->getConstantInt32(-Alignment));
960 } 961 }
961 if (const auto *ConstantTotalSize = 962 if (const auto *ConstantTotalSize =
962 llvm::dyn_cast<ConstantInteger32>(TotalSize)) { 963 llvm::dyn_cast<ConstantInteger32>(TotalSize)) {
963 uint32_t Value = ConstantTotalSize->getValue(); 964 uint32_t Value = ConstantTotalSize->getValue();
964 Value = Utils::applyAlignment(Value, Alignment); 965 Value = Utils::applyAlignment(Value, Alignment);
965 if (Inst->getKnownFrameOffset()) { 966 if (Inst->getKnownFrameOffset()) {
966 _adjust_stack(Value); 967 _adjust_stack(Value);
967 FixedAllocaSizeBytes += Value; 968 FixedAllocaSizeBytes += Value;
968 } else { 969 } else {
(...skipping 4888 matching lines...) Expand 10 before | Expand all | Expand 10 after
5857 } 5858 }
5858 // the offset is not eligible for blinding or pooling, return the original 5859 // the offset is not eligible for blinding or pooling, return the original
5859 // mem operand 5860 // mem operand
5860 return MemOperand; 5861 return MemOperand;
5861 } 5862 }
5862 5863
5863 } // end of namespace X86Internal 5864 } // end of namespace X86Internal
5864 } // end of namespace Ice 5865 } // end of namespace Ice
5865 5866
5866 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H 5867 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H
OLDNEW
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/alloc.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698