diff options
author | Craig Topper <craig.topper@intel.com> | 2020-05-12 09:43:24 -0700 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2020-05-12 10:06:40 -0700 |
commit | 8c72b0271b841c75e2f005b796fbdbbbbd143ad4 (patch) | |
tree | 1ccd01d0bedf8cdabbed6d433db999fe315f33d7 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | 93bd696347aa6348af8d2b042910d5e9226cfbd8 (diff) | |
download | llvm-8c72b0271b841c75e2f005b796fbdbbbbd143ad4.zip llvm-8c72b0271b841c75e2f005b796fbdbbbbd143ad4.tar.gz llvm-8c72b0271b841c75e2f005b796fbdbbbbd143ad4.tar.bz2 |
[CodeGen] Use Align in MachineConstantPool.
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 464f389..7a2d573 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -1176,8 +1176,7 @@ static bool CanShareConstantPoolEntry(const Constant *A, const Constant *B, /// Create a new entry in the constant pool or return an existing one. /// User must specify the log2 of the minimum required alignment for the object. unsigned MachineConstantPool::getConstantPoolIndex(const Constant *C, - unsigned Alignment) { - assert(Alignment && "Alignment must be specified!"); + Align Alignment) { if (Alignment > PoolAlignment) PoolAlignment = Alignment; // Check to see if we already have this constant. @@ -1186,7 +1185,7 @@ unsigned MachineConstantPool::getConstantPoolIndex(const Constant *C, for (unsigned i = 0, e = Constants.size(); i != e; ++i) if (!Constants[i].isMachineConstantPoolEntry() && CanShareConstantPoolEntry(Constants[i].Val.ConstVal, C, DL)) { - if ((unsigned)Constants[i].getAlignment() < Alignment) + if (Constants[i].getAlign() < Alignment) Constants[i].Alignment = Alignment; return i; } @@ -1196,8 +1195,7 @@ unsigned MachineConstantPool::getConstantPoolIndex(const Constant *C, } unsigned MachineConstantPool::getConstantPoolIndex(MachineConstantPoolValue *V, - unsigned Alignment) { - assert(Alignment && "Alignment must be specified!"); + Align Alignment) { if (Alignment > PoolAlignment) PoolAlignment = Alignment; // Check to see if we already have this constant. @@ -1223,7 +1221,7 @@ void MachineConstantPool::print(raw_ostream &OS) const { Constants[i].Val.MachineCPVal->print(OS); else Constants[i].Val.ConstVal->printAsOperand(OS, /*PrintType=*/false); - OS << ", align=" << Constants[i].getAlignment(); + OS << ", align=" << Constants[i].getAlign().value(); OS << "\n"; } } |