// dimensions, extracts the size from the memref descriptor.
auto memrefSize = [int64Ty, pos, i64cst](MemRefType type, Value *memref,
int dim) -> Value * {
- assert(dim < type.getRank());
+ assert(static_cast<size_t>(dim) < type.getRank());
if (type.getShape()[dim] != -1) {
return i64cst(type.getShape()[dim]);
}
// FIXME: this seems like a bug in `cloneInto()` above?
auto &entryBlock = f->getBlocks().front();
int blockArgSize = entryBlock.getArguments().size();
- assert(blockArgSize == f->getType().getInputs().size());
+ assert(blockArgSize == static_cast<int>(f->getType().getInputs().size()));
entryBlock.addArguments(f->getType().getInputs());
auto argList = entryBlock.getArguments();
for (int argNum = 0; argNum < blockArgSize; ++argNum) {
// FIXME: this seems like a bug in `cloneInto()` above?
auto &entryBlock = f->getBlocks().front();
int blockArgSize = entryBlock.getArguments().size();
- assert(blockArgSize == f->getType().getInputs().size());
+ assert(blockArgSize == static_cast<int>(f->getType().getInputs().size()));
entryBlock.addArguments(f->getType().getInputs());
auto argList = entryBlock.getArguments();
for (int argNum = 0; argNum < blockArgSize; ++argNum) {
DenseElementsAttr DenseElementsAttr::get(VectorOrTensorType type,
ArrayRef<char> data) {
- assert((type.getSizeInBits() <= data.size() * APInt::APINT_WORD_SIZE) &&
+ assert((static_cast<uint64_t>(type.getSizeInBits()) <=
+ data.size() * APInt::APINT_WORD_SIZE) &&
"Input data bit size should be larger than that type requires");
switch (type.getElementType().getKind()) {
case StandardTypes::BF16:
nullptr;
int position = positionElementAttr.getInt();
if (llvmContainerType->isArrayTy()) {
- if (position < 0 || position >= llvmContainerType->getArrayNumElements())
+ if (position < 0 || static_cast<unsigned>(position) >=
+ llvmContainerType->getArrayNumElements())
return parser->emitError(attributeLoc, "position out of bounds"),
nullptr;
llvmContainerType = llvmContainerType->getArrayElementType();
} else if (llvmContainerType->isStructTy()) {
- if (position < 0 || position >= llvmContainerType->getStructNumElements())
+ if (position < 0 || static_cast<unsigned>(position) >=
+ llvmContainerType->getStructNumElements())
return parser->emitError(attributeLoc, "position out of bounds"),
nullptr;
llvmContainerType = llvmContainerType->getStructElementType(position);
ArrayRef<Value *> ivs,
ArrayRef<Value *> tileSizes,
PerFunctionState &state) {
- assert(ivs.size() == llvm::count_if(
+ assert(ivs.size() == static_cast<size_t>(llvm::count_if(
llvm::make_range(tileSizes.begin(), tileSizes.end()),
- [](Value *v) { return !isZero(v); }) &&
+ [](Value *v) { return !isZero(v); })) &&
"expected as many ivs as non-zero sizes");
auto *context = op->getContext();
break;
}
- if (requiredOperandCount != -1 && result.size() != requiredOperandCount)
+ if (requiredOperandCount != -1 &&
+ result.size() != static_cast<size_t>(requiredOperandCount))
return emitError(startLoc, "expected ")
<< requiredOperandCount << " operands";
return success();
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <iomanip>
+#include <sstream>
#define DEBUG_TYPE "affine-loop-fusion"
using llvm::SetVector;