[NFC] Add the getSizeInBytes() interface for MachineConstantPoolValue
authorQingShan Zhang <qshanz@cn.ibm.com>
Tue, 5 Jan 2021 03:22:45 +0000 (03:22 +0000)
committerQingShan Zhang <qshanz@cn.ibm.com>
Tue, 5 Jan 2021 03:22:45 +0000 (03:22 +0000)
commit2962f1149c8fccf8e865654ce11b3f1312165651
tree1e19ec743603f72e95872967f905fef28d8fb265
parentd51d72bbb91bf1179e58a40998efb3be6bb1ca6f
[NFC] Add the getSizeInBytes() interface for MachineConstantPoolValue

Current implementation assumes that, each MachineConstantPoolValue takes
up sizeof(MachineConstantPoolValue::Ty) bytes. For PowerPC, we want to
lump all the constants with the same type as one MachineConstantPoolValue
to save the cost that calculate the TOC entry for each const. So, we need
to extend the MachineConstantPoolValue that break this assumption.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D89108
llvm/include/llvm/CodeGen/MachineConstantPool.h
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/CodeGen/MachineFunction.cpp
llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
llvm/lib/Target/Mips/MipsConstantIslandPass.cpp
llvm/lib/Target/X86/X86MCInstLower.cpp