Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: jyknight, sdardis, nemanjai, javed.absar, hiraditya, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67229
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371200
91177308-0d34-0410-b5e6-
96231b3b80d8
TargetDAGCombineArray[NT >> 3] |= 1 << (NT&7);
}
- /// Set the target's minimum function alignment (in log2(bytes))
- void setMinFunctionLogAlignment(unsigned LogAlign) {
- MinFunctionAlignment = llvm::Align(1ULL << LogAlign);
+ /// Set the target's minimum function alignment.
+ void setMinFunctionAlignment(llvm::Align Align) {
+ MinFunctionAlignment = Align;
}
/// Set the target's preferred function alignment. This should be set if
EnableExtLdPromotion = true;
// Set required alignment.
- setMinFunctionLogAlignment(2);
+ setMinFunctionAlignment(llvm::Align(4));
// Set preferred alignments.
setPrefFunctionLogAlignment(STI.getPrefFunctionLogAlignment());
setPrefLoopLogAlignment(STI.getPrefLoopLogAlignment());
setPrefLoopLogAlignment(Subtarget->getPrefLoopLogAlignment());
- setMinFunctionLogAlignment(Subtarget->isThumb() ? 1 : 2);
+ setMinFunctionAlignment(Subtarget->isThumb() ? llvm::Align(2)
+ : llvm::Align(4));
if (Subtarget->isThumb() || Subtarget->isThumb2())
setTargetDAGCombine(ISD::ABS);
setBooleanContents(ZeroOrOneBooleanContent);
// Function alignments (log2)
- setMinFunctionLogAlignment(3);
+ setMinFunctionAlignment(llvm::Align(8));
setPrefFunctionLogAlignment(3);
if (BPFExpandMemcpyInOrder) {
setPrefLoopLogAlignment(4);
setPrefFunctionLogAlignment(4);
- setMinFunctionLogAlignment(2);
+ setMinFunctionAlignment(llvm::Align(4));
setStackPointerRegisterToSaveRestore(HRI.getStackRegister());
setBooleanContents(TargetLoweringBase::UndefinedBooleanContent);
setBooleanVectorContents(TargetLoweringBase::UndefinedBooleanContent);
setTargetDAGCombine(ISD::XOR);
// Function alignments (log2)
- setMinFunctionLogAlignment(2);
+ setMinFunctionAlignment(llvm::Align(4));
setPrefFunctionLogAlignment(2);
setJumpIsExpensive(true);
setLibcallCallingConv(RTLIB::OGT_F64, CallingConv::MSP430_BUILTIN);
// TODO: __mspabi_srall, __mspabi_srlll, __mspabi_sllll
- setMinFunctionLogAlignment(1);
+ setMinFunctionAlignment(llvm::Align(2));
setPrefFunctionLogAlignment(1);
}
setLibcallName(RTLIB::SRA_I128, nullptr);
}
- setMinFunctionLogAlignment(Subtarget.isGP64bit() ? 3 : 2);
+ setMinFunctionAlignment(Subtarget.isGP64bit() ? llvm::Align(8)
+ : llvm::Align(4));
// The arguments on the stack are defined in terms of 4-byte slots on O32
// and 8-byte slots on N32/N64.
setJumpIsExpensive();
}
- setMinFunctionLogAlignment(2);
+ setMinFunctionAlignment(llvm::Align(4));
if (Subtarget.isDarwin())
setPrefFunctionLogAlignment(4);
setBooleanContents(ZeroOrOneBooleanContent);
// Function alignments (log2).
- unsigned FunctionAlignment = Subtarget.hasStdExtC() ? 1 : 2;
- setMinFunctionLogAlignment(FunctionAlignment);
- setPrefFunctionLogAlignment(FunctionAlignment);
+ const llvm::Align FunctionAlignment(Subtarget.hasStdExtC() ? 2 : 4);
+ setMinFunctionAlignment(FunctionAlignment);
+ setPrefFunctionLogAlignment(Log2(FunctionAlignment));
// Effectively disable jump table generation.
setMinimumJumpTableEntries(INT_MAX);
setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom);
- setMinFunctionLogAlignment(2);
+ setMinFunctionAlignment(llvm::Align(4));
computeRegisterProperties(Subtarget->getRegisterInfo());
}
setBooleanVectorContents(ZeroOrNegativeOneBooleanContent);
// Instructions are strings of 2-byte aligned 2-byte values.
- setMinFunctionLogAlignment(2);
+ setMinFunctionAlignment(llvm::Align(4));
// For performance reasons we prefer 16-byte alignment.
setPrefFunctionLogAlignment(4);
setTargetDAGCombine(ISD::INTRINSIC_VOID);
setTargetDAGCombine(ISD::INTRINSIC_W_CHAIN);
- setMinFunctionLogAlignment(1);
+ setMinFunctionAlignment(llvm::Align(2));
setPrefFunctionLogAlignment(2);
}