OLD | NEW |
1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===// | 1 //===- subzero/src/IceCfg.cpp - Control flow graph 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 /// \file | 10 /// \file |
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 // Adjust the size of the allocation up to the next multiple of the | 932 // Adjust the size of the allocation up to the next multiple of the |
933 // object's alignment. | 933 // object's alignment. |
934 uint32_t Alignment = std::max(Alloca->getAlignInBytes(), 1u); | 934 uint32_t Alignment = std::max(Alloca->getAlignInBytes(), 1u); |
935 auto *ConstSize = | 935 auto *ConstSize = |
936 llvm::dyn_cast<ConstantInteger32>(Alloca->getSizeInBytes()); | 936 llvm::dyn_cast<ConstantInteger32>(Alloca->getSizeInBytes()); |
937 uint32_t Size = Utils::applyAlignment(ConstSize->getValue(), Alignment); | 937 uint32_t Size = Utils::applyAlignment(ConstSize->getValue(), Alignment); |
938 if (BaseVariableType == BVT_FramePointer) { | 938 if (BaseVariableType == BVT_FramePointer) { |
939 // Addressing is relative to the frame pointer. Subtract the offset after | 939 // Addressing is relative to the frame pointer. Subtract the offset after |
940 // adding the size of the alloca, because it grows downwards from the | 940 // adding the size of the alloca, because it grows downwards from the |
941 // frame pointer. | 941 // frame pointer. |
942 Offsets.push_back(-(CurrentOffset + Size)); | 942 Offsets.push_back(Target->getOffset(CurrentOffset, Size)); |
943 } else { | 943 } else { |
944 // Addressing is relative to the stack pointer or to a user pointer. Add | 944 // Addressing is relative to the stack pointer or to a user pointer. Add |
945 // the offset before adding the size of the object, because it grows | 945 // the offset before adding the size of the object, because it grows |
946 // upwards from the stack pointer. In addition, if the addressing is | 946 // upwards from the stack pointer. In addition, if the addressing is |
947 // relative to the stack pointer, we need to add the pre-computed max out | 947 // relative to the stack pointer, we need to add the pre-computed max out |
948 // args size bytes. | 948 // args size bytes. |
949 const uint32_t OutArgsOffsetOrZero = | 949 const uint32_t OutArgsOffsetOrZero = |
950 (BaseVariableType == BVT_StackPointer) | 950 (BaseVariableType == BVT_StackPointer) |
951 ? getTarget()->maxOutArgsSizeBytes() | 951 ? getTarget()->maxOutArgsSizeBytes() |
952 : 0; | 952 : 0; |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1881 } | 1881 } |
1882 } | 1882 } |
1883 // Print each basic block | 1883 // Print each basic block |
1884 for (CfgNode *Node : Nodes) | 1884 for (CfgNode *Node : Nodes) |
1885 Node->dump(this); | 1885 Node->dump(this); |
1886 if (isVerbose(IceV_Instructions)) | 1886 if (isVerbose(IceV_Instructions)) |
1887 Str << "}\n"; | 1887 Str << "}\n"; |
1888 } | 1888 } |
1889 | 1889 |
1890 } // end of namespace Ice | 1890 } // end of namespace Ice |
OLD | NEW |