Skip to content

Commit f407be3

Browse files
committed
[X86] X86FixupVectorConstants - rename FixupEntry::BitWidth to FixupEntry::MemBitWidth NFC.
Make it clearer that this refers to the width of the constant element stored in memory - which won't match the register element width after a sext/zextload
1 parent eb85c8e commit f407be3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/Target/X86/X86FixupVectorConstants.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,31 +324,31 @@ bool X86FixupVectorConstantsPass::processInstruction(MachineFunction &MF,
324324
struct FixupEntry {
325325
int Op;
326326
int NumCstElts;
327-
int BitWidth;
327+
int MemBitWidth;
328328
std::function<Constant *(const Constant *, unsigned, unsigned, unsigned)>
329329
RebuildConstant;
330330
};
331331
auto FixupConstant = [&](ArrayRef<FixupEntry> Fixups, unsigned OperandNo) {
332332
#ifdef EXPENSIVE_CHECKS
333333
assert(llvm::is_sorted(Fixups,
334334
[](const FixupEntry &A, const FixupEntry &B) {
335-
return (A.NumCstElts * A.BitWidth) <
336-
(B.NumCstElts * B.BitWidth);
335+
return (A.NumCstElts * A.MemBitWidth) <
336+
(B.NumCstElts * B.MemBitWidth);
337337
}) &&
338338
"Constant fixup table not sorted in ascending constant size");
339339
#endif
340340
assert(MI.getNumOperands() >= (OperandNo + X86::AddrNumOperands) &&
341341
"Unexpected number of operands!");
342342
if (auto *C = X86::getConstantFromPool(MI, OperandNo)) {
343-
unsigned NumBits = C->getType()->getPrimitiveSizeInBits();
343+
unsigned RegBitWidth = C->getType()->getPrimitiveSizeInBits();
344344
for (const FixupEntry &Fixup : Fixups) {
345345
if (Fixup.Op) {
346346
// Construct a suitable constant and adjust the MI to use the new
347347
// constant pool entry.
348348
if (Constant *NewCst = Fixup.RebuildConstant(
349-
C, NumBits, Fixup.NumCstElts, Fixup.BitWidth)) {
349+
C, RegBitWidth, Fixup.NumCstElts, Fixup.MemBitWidth)) {
350350
unsigned NewCPI =
351-
CP->getConstantPoolIndex(NewCst, Align(Fixup.BitWidth / 8));
351+
CP->getConstantPoolIndex(NewCst, Align(Fixup.MemBitWidth / 8));
352352
MI.setDesc(TII->get(Fixup.Op));
353353
MI.getOperand(OperandNo + X86::AddrDisp).setIndex(NewCPI);
354354
return true;

0 commit comments

Comments
 (0)