Skip to content

Commit 04a6dd6

Browse files
committed
Remove const qualifiers from mlir value
1 parent c6df5f8 commit 04a6dd6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,12 +1932,12 @@ mlir::LogicalResult CIRToLLVMVecSplatOpLowering::matchAndRewrite(
19321932
// element in the vector. Start with an undef vector. Insert the value into
19331933
// the first element. Then use a `shufflevector` with a mask of all 0 to
19341934
// fill out the entire vector with that value.
1935-
const cir::VectorType vecTy = op.getType();
1936-
const mlir::Type llvmTy = typeConverter->convertType(vecTy);
1937-
const mlir::Location loc = op.getLoc();
1938-
const mlir::Value poison = rewriter.create<mlir::LLVM::PoisonOp>(loc, llvmTy);
1935+
cir::VectorType vecTy = op.getType();
1936+
mlir::Type llvmTy = typeConverter->convertType(vecTy);
1937+
mlir::Location loc = op.getLoc();
1938+
mlir::Value poison = rewriter.create<mlir::LLVM::PoisonOp>(loc, llvmTy);
19391939

1940-
const mlir::Value elementValue = adaptor.getValue();
1940+
mlir::Value elementValue = adaptor.getValue();
19411941
if (mlir::isa<mlir::LLVM::PoisonOp>(elementValue.getDefiningOp())) {
19421942
// If the splat value is poison, then we can just use poison value
19431943
// for the entire vector.
@@ -1964,11 +1964,11 @@ mlir::LogicalResult CIRToLLVMVecSplatOpLowering::matchAndRewrite(
19641964
}
19651965
}
19661966

1967-
const mlir::Value indexValue =
1967+
mlir::Value indexValue =
19681968
rewriter.create<mlir::LLVM::ConstantOp>(loc, rewriter.getI64Type(), 0);
1969-
const mlir::Value oneElement = rewriter.create<mlir::LLVM::InsertElementOp>(
1969+
mlir::Value oneElement = rewriter.create<mlir::LLVM::InsertElementOp>(
19701970
loc, poison, elementValue, indexValue);
1971-
const SmallVector<int32_t> zeroValues(vecTy.getSize(), 0);
1971+
SmallVector<int32_t> zeroValues(vecTy.getSize(), 0);
19721972
rewriter.replaceOpWithNewOp<mlir::LLVM::ShuffleVectorOp>(op, oneElement,
19731973
poison, zeroValues);
19741974
return mlir::success();

0 commit comments

Comments
 (0)