[clang] [llvm] [llvm:ir] Add support for constant data exceeding 4GiB (PR #126481)
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 10 14:14:19 PST 2025
================
@@ -1583,7 +1583,7 @@ static void printConstant(const Constant *COp, unsigned BitWidth,
bool IsInteger = EltTy->isIntegerTy();
bool IsFP = EltTy->isHalfTy() || EltTy->isFloatTy() || EltTy->isDoubleTy();
unsigned EltBits = EltTy->getPrimitiveSizeInBits();
- unsigned E = std::min(BitWidth / EltBits, CDS->getNumElements());
+ unsigned E = std::min(BitWidth / EltBits, (unsigned)CDS->getNumElements());
----------------
efriedma-quic wrote:
```suggestion
uint64_t E = std::min((uint64_t)(BitWidth / EltBits), CDS->getNumElements());
```
https://github.com/llvm/llvm-project/pull/126481
More information about the llvm-commits
mailing list