diff options
| author | Craig Topper <craig.topper@intel.com> | 2018-07-28 18:21:45 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2018-07-28 18:21:45 +0000 |
| commit | ba208b07b64efba4045e3cc08d404e1038bcc480 (patch) | |
| tree | 7682f1df137fa9756434a36c55d50fc6f9ea9ac9 /llvm | |
| parent | fea073f4e64804f2b8cc6e2ca354049cc424d6e7 (diff) | |
| download | bcm5719-llvm-ba208b07b64efba4045e3cc08d404e1038bcc480.tar.gz bcm5719-llvm-ba208b07b64efba4045e3cc08d404e1038bcc480.zip | |
[X86] Use alignTo and divideCeil to make some code more readable. NFC
llvm-svn: 338203
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/X86/X86TargetTransformInfo.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp index bae2ef80c36..1b260d8d45d 100644 --- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp @@ -2274,8 +2274,8 @@ int X86TTIImpl::getIntImmCost(const APInt &Imm, Type *Ty) { // Sign-extend all constants to a multiple of 64-bit. APInt ImmVal = Imm; - if (BitSize & 0x3f) - ImmVal = Imm.sext((BitSize + 63) & ~0x3fU); + if (BitSize % 64 != 0) + ImmVal = Imm.sext(alignTo(BitSize, 64)); // Split the constant into 64-bit chunks and calculate the cost for each // chunk. @@ -2366,7 +2366,7 @@ int X86TTIImpl::getIntImmCost(unsigned Opcode, unsigned Idx, const APInt &Imm, } if (Idx == ImmIdx) { - int NumConstants = (BitSize + 63) / 64; + int NumConstants = divideCeil(BitSize, 64); int Cost = X86TTIImpl::getIntImmCost(Imm, Ty); return (Cost <= NumConstants * TTI::TCC_Basic) ? static_cast<int>(TTI::TCC_Free) |

