<div dir="ltr">This isn't a commit to `main`, it comes from a PR. I freaked out as well thinking I screwed up something...<div>It is a bug in the bot that emails llvm-commits@, a bug was filed: <a href="https://github.com/llvm/llvm-project/issues/71185">https://github.com/llvm/llvm-project/issues/71185</a><div>I don't know where the code for the bot is to fix it myself just now, but we'll figure it out!</div></div><div><br></div><div>Sorry for the confusion!</div><div><br></div><div>-- </div><div>Mehdi</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 3, 2023 at 7:45 AM Philip Reames <<a href="mailto:listmail@philipreames.com">listmail@philipreames.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Er, what? Can you give some context here? What is SPR? What are you <br>
rebasing?<br>
<br>
Philip<br>
<br>
On 11/3/23 03:24, Mehdi Amini via llvm-commits wrote:<br>
> Author: Mehdi Amini<br>
> Date: 2023-11-03T03:23:43-07:00<br>
> New Revision: 3289ecff8e8f5022cb6a40777392c98f1bcf5780<br>
><br>
> URL: <a href="https://github.com/llvm/llvm-project/commit/3289ecff8e8f5022cb6a40777392c98f1bcf5780" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/3289ecff8e8f5022cb6a40777392c98f1bcf5780</a><br>
> DIFF: <a href="https://github.com/llvm/llvm-project/commit/3289ecff8e8f5022cb6a40777392c98f1bcf5780.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/3289ecff8e8f5022cb6a40777392c98f1bcf5780.diff</a><br>
><br>
> LOG: [𝘀𝗽𝗿] changes introduced through rebase<br>
><br>
> Created using spr 1.3.4<br>
><br>
> [skip ci]<br>
><br>
> Added:<br>
> <br>
><br>
> Modified:<br>
> clang/test/OpenMP/cancel_codegen.cpp<br>
> clang/test/OpenMP/parallel_codegen.cpp<br>
> llvm/lib/IR/ConstantFold.cpp<br>
> mlir/include/mlir/Conversion/Passes.td<br>
> mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp<br>
> mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVMPass.cpp<br>
> mlir/test/Conversion/VectorToLLVM/vector-mask-to-llvm.mlir<br>
> mlir/test/Conversion/VectorToLLVM/vector-reduction-to-llvm.mlir<br>
> mlir/test/Conversion/VectorToLLVM/vector-scalable-memcpy.mlir<br>
> mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir<br>
><br>
> Removed:<br>
> mlir/test/Conversion/VectorToLLVM/typed-pointers.mlir<br>
><br>
><br>
> ################################################################################<br>
> diff --git a/clang/test/OpenMP/cancel_codegen.cpp b/clang/test/OpenMP/cancel_codegen.cpp<br>
> index 53580e0c2b0293f..03024cf331b2717 100644<br>
> --- a/clang/test/OpenMP/cancel_codegen.cpp<br>
> +++ b/clang/test/OpenMP/cancel_codegen.cpp<br>
> @@ -1026,25 +1026,25 @@ for (int i = 0; i < argc; ++i) {<br>
> // CHECK3-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META8:![0-9]+]])<br>
> // CHECK3-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META10:![0-9]+]])<br>
> // CHECK3-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata [[META12:![0-9]+]])<br>
> -// CHECK3-NEXT: store i32 [[TMP2]], ptr [[DOTGLOBAL_TID__ADDR_I]], align 4, !noalias !14<br>
> -// CHECK3-NEXT: store ptr [[TMP5]], ptr [[DOTPART_ID__ADDR_I]], align 8, !noalias !14<br>
> -// CHECK3-NEXT: store ptr null, ptr [[DOTPRIVATES__ADDR_I]], align 8, !noalias !14<br>
> -// CHECK3-NEXT: store ptr null, ptr [[DOTCOPY_FN__ADDR_I]], align 8, !noalias !14<br>
> -// CHECK3-NEXT: store ptr [[TMP3]], ptr [[DOTTASK_T__ADDR_I]], align 8, !noalias !14<br>
> -// CHECK3-NEXT: store ptr [[TMP7]], ptr [[__CONTEXT_ADDR_I]], align 8, !noalias !14<br>
> -// CHECK3-NEXT: [[TMP8:%.*]] = load ptr, ptr [[__CONTEXT_ADDR_I]], align 8, !noalias !14<br>
> +// CHECK3-NEXT: store i32 [[TMP2]], ptr [[DOTGLOBAL_TID__ADDR_I]], align 4, !noalias ![[NOALIAS0:[0-9]+]]<br>
> +// CHECK3-NEXT: store ptr [[TMP5]], ptr [[DOTPART_ID__ADDR_I]], align 8, !noalias ![[NOALIAS0]]<br>
> +// CHECK3-NEXT: store ptr null, ptr [[DOTPRIVATES__ADDR_I]], align 8, !noalias ![[NOALIAS0]]<br>
> +// CHECK3-NEXT: store ptr null, ptr [[DOTCOPY_FN__ADDR_I]], align 8, !noalias ![[NOALIAS0]]<br>
> +// CHECK3-NEXT: store ptr [[TMP3]], ptr [[DOTTASK_T__ADDR_I]], align 8, !noalias ![[NOALIAS0]]<br>
> +// CHECK3-NEXT: store ptr [[TMP7]], ptr [[__CONTEXT_ADDR_I]], align 8, !noalias ![[NOALIAS0]]<br>
> +// CHECK3-NEXT: [[TMP8:%.*]] = load ptr, ptr [[__CONTEXT_ADDR_I]], align 8, !noalias ![[NOALIAS0]]<br>
> // CHECK3-NEXT: [[OMP_GLOBAL_THREAD_NUM_I:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB12:[0-9]+]])<br>
> // CHECK3-NEXT: [[TMP9:%.*]] = call i32 @__kmpc_cancel(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM_I]], i32 4)<br>
> // CHECK3-NEXT: [[TMP10:%.*]] = icmp ne i32 [[TMP9]], 0<br>
> // CHECK3-NEXT: br i1 [[TMP10]], label [[DOTCANCEL_EXIT_I:%.*]], label [[DOTCANCEL_CONTINUE_I:%.*]]<br>
> // CHECK3: .cancel.exit.i:<br>
> -// CHECK3-NEXT: store i32 1, ptr [[CLEANUP_DEST_SLOT_I]], align 4, !noalias !14<br>
> +// CHECK3-NEXT: store i32 1, ptr [[CLEANUP_DEST_SLOT_I]], align 4, !noalias ![[NOALIAS1:[0-9]+]]<br>
> // CHECK3-NEXT: br label [[DOTOMP_OUTLINED__EXIT:%.*]]<br>
> // CHECK3: .cancel.continue.i:<br>
> -// CHECK3-NEXT: store i32 0, ptr [[CLEANUP_DEST_SLOT_I]], align 4, !noalias !14<br>
> +// CHECK3-NEXT: store i32 0, ptr [[CLEANUP_DEST_SLOT_I]], align 4, !noalias ![[NOALIAS1]]<br>
> // CHECK3-NEXT: br label [[DOTOMP_OUTLINED__EXIT]]<br>
> // CHECK3: .omp_outlined..exit:<br>
> -// CHECK3-NEXT: [[CLEANUP_DEST_I:%.*]] = load i32, ptr [[CLEANUP_DEST_SLOT_I]], align 4, !noalias !14<br>
> +// CHECK3-NEXT: [[CLEANUP_DEST_I:%.*]] = load i32, ptr [[CLEANUP_DEST_SLOT_I]], align 4, !noalias ![[NOALIAS1]]<br>
> // CHECK3-NEXT: ret i32 0<br>
> //<br>
> //<br>
><br>
> diff --git a/clang/test/OpenMP/parallel_codegen.cpp b/clang/test/OpenMP/parallel_codegen.cpp<br>
> index 5c98761be0808ef..d545b4a9d9fa887 100644<br>
> --- a/clang/test/OpenMP/parallel_codegen.cpp<br>
> +++ b/clang/test/OpenMP/parallel_codegen.cpp<br>
> @@ -812,7 +812,7 @@ int main (int argc, char **argv) {<br>
> //<br>
> //<br>
> // CHECK3-LABEL: define {{[^@]+}}@_Z5tmainIPPcEiT_..omp_par<br>
> -// CHECK3-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR1]] {<br>
> +// CHECK3-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR2:[0-9]+]]<br>
> // CHECK3-NEXT: omp.par.entry:<br>
> // CHECK3-NEXT: [[GEP__RELOADED:%.*]] = getelementptr { ptr, ptr }, ptr [[TMP0]], i32 0, i32 0<br>
> // CHECK3-NEXT: [[LOADGEP__RELOADED:%.*]] = load ptr, ptr [[GEP__RELOADED]], align 8<br>
> @@ -956,7 +956,7 @@ int main (int argc, char **argv) {<br>
> //<br>
> //<br>
> // CHECK4-LABEL: define {{[^@]+}}@_Z5tmainIPPcEiT_..omp_par<br>
> -// CHECK4-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR1]] !dbg [[DBG57:![0-9]+]] {<br>
> +// CHECK4-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR2:[0-9]+]] !dbg [[DBG57:![0-9]+]] {<br>
> // CHECK4-NEXT: omp.par.entry:<br>
> // CHECK4-NEXT: [[GEP__RELOADED:%.*]] = getelementptr { ptr, ptr }, ptr [[TMP0]], i32 0, i32 0<br>
> // CHECK4-NEXT: [[LOADGEP__RELOADED:%.*]] = load ptr, ptr [[GEP__RELOADED]], align 8<br>
><br>
> diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp<br>
> index 81691a5f69aa0a6..4651767d0655a06 100644<br>
> --- a/llvm/lib/IR/ConstantFold.cpp<br>
> +++ b/llvm/lib/IR/ConstantFold.cpp<br>
> @@ -37,45 +37,6 @@ using namespace llvm::PatternMatch;<br>
> // ConstantFold*Instruction Implementations<br>
> //===----------------------------------------------------------------------===//<br>
> <br>
> -/// Convert the specified vector Constant node to the specified vector type.<br>
> -/// At this point, we know that the elements of the input vector constant are<br>
> -/// all simple integer or FP values.<br>
> -static Constant *BitCastConstantVector(Constant *CV, VectorType *DstTy) {<br>
> -<br>
> - if (CV->isAllOnesValue()) return Constant::getAllOnesValue(DstTy);<br>
> - if (CV->isNullValue()) return Constant::getNullValue(DstTy);<br>
> -<br>
> - // Do not iterate on scalable vector. The num of elements is unknown at<br>
> - // compile-time.<br>
> - if (isa<ScalableVectorType>(DstTy))<br>
> - return nullptr;<br>
> -<br>
> - // If this cast changes element count then we can't handle it here:<br>
> - // doing so requires endianness information. This should be handled by<br>
> - // Analysis/ConstantFolding.cpp<br>
> - unsigned NumElts = cast<FixedVectorType>(DstTy)->getNumElements();<br>
> - if (NumElts != cast<FixedVectorType>(CV->getType())->getNumElements())<br>
> - return nullptr;<br>
> -<br>
> - Type *DstEltTy = DstTy->getElementType();<br>
> - // Fast path for splatted constants.<br>
> - if (Constant *Splat = CV->getSplatValue()) {<br>
> - return ConstantVector::getSplat(DstTy->getElementCount(),<br>
> - ConstantExpr::getBitCast(Splat, DstEltTy));<br>
> - }<br>
> -<br>
> - SmallVector<Constant*, 16> Result;<br>
> - Type *Ty = IntegerType::get(CV->getContext(), 32);<br>
> - for (unsigned i = 0; i != NumElts; ++i) {<br>
> - Constant *C =<br>
> - ConstantExpr::getExtractElement(CV, ConstantInt::get(Ty, i));<br>
> - C = ConstantExpr::getBitCast(C, DstEltTy);<br>
> - Result.push_back(C);<br>
> - }<br>
> -<br>
> - return ConstantVector::get(Result);<br>
> -}<br>
> -<br>
> /// This function determines which opcode to use to fold two constant cast<br>
> /// expressions together. It uses CastInst::isEliminableCastPair to determine<br>
> /// the opcode. Consequently its just a wrapper around that function.<br>
> @@ -114,38 +75,16 @@ static Constant *FoldBitCast(Constant *V, Type *DestTy) {<br>
> // Handle casts from one vector constant to another. We know that the src<br>
> // and dest type have the same size (otherwise its an illegal cast).<br>
> if (VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) {<br>
> - if (VectorType *SrcTy = dyn_cast<VectorType>(V->getType())) {<br>
> - assert(DestPTy->getPrimitiveSizeInBits() ==<br>
> - SrcTy->getPrimitiveSizeInBits() &&<br>
> - "Not cast between same sized vectors!");<br>
> - SrcTy = nullptr;<br>
> - // First, check for null. Undef is already handled.<br>
> - if (isa<ConstantAggregateZero>(V))<br>
> - return Constant::getNullValue(DestTy);<br>
> -<br>
> - // Handle ConstantVector and ConstantAggregateVector.<br>
> - return BitCastConstantVector(V, DestPTy);<br>
> - }<br>
> -<br>
> // Canonicalize scalar-to-vector bitcasts into vector-to-vector bitcasts<br>
> // This allows for other simplifications (although some of them<br>
> // can only be handled by Analysis/ConstantFolding.cpp).<br>
> if (isa<ConstantInt>(V) || isa<ConstantFP>(V))<br>
> return ConstantExpr::getBitCast(ConstantVector::get(V), DestPTy);<br>
> + return nullptr;<br>
> }<br>
> <br>
> - // Finally, implement bitcast folding now. The code below doesn't handle<br>
> - // bitcast right.<br>
> - if (isa<ConstantPointerNull>(V)) // ptr->ptr cast.<br>
> - return ConstantPointerNull::get(cast<PointerType>(DestTy));<br>
> -<br>
> // Handle integral constant input.<br>
> if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {<br>
> - if (DestTy->isIntegerTy())<br>
> - // Integral -> Integral. This is a no-op because the bit widths must<br>
> - // be the same. Consequently, we just fold to V.<br>
> - return V;<br>
> -<br>
> // See note below regarding the PPC_FP128 restriction.<br>
> if (DestTy->isFloatingPointTy() && !DestTy->isPPC_FP128Ty())<br>
> return ConstantFP::get(DestTy->getContext(),<br>
><br>
> diff --git a/mlir/include/mlir/Conversion/Passes.td b/mlir/include/mlir/Conversion/Passes.td<br>
> index 00e342f8f30eb3e..c2f90b8984b97fb 100644<br>
> --- a/mlir/include/mlir/Conversion/Passes.td<br>
> +++ b/mlir/include/mlir/Conversion/Passes.td<br>
> @@ -1270,10 +1270,7 @@ def ConvertVectorToLLVMPass : Pass<"convert-vector-to-llvm"> {<br>
> Option<"x86Vector", "enable-x86vector",<br>
> "bool", /*default=*/"false",<br>
> "Enables the use of X86Vector dialect while lowering the vector "<br>
> - "dialect.">,<br>
> - Option<"useOpaquePointers", "use-opaque-pointers", "bool",<br>
> - /*default=*/"true", "Generate LLVM IR using opaque pointers "<br>
> - "instead of typed pointers"><br>
> + "dialect."><br>
> ];<br>
> }<br>
> <br>
><br>
> diff --git a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp<br>
> index 4af58653c8227ae..75a35b4c801e4a5 100644<br>
> --- a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp<br>
> +++ b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp<br>
> @@ -112,19 +112,6 @@ static Value getIndexedPtrs(ConversionPatternRewriter &rewriter, Location loc,<br>
> base, index);<br>
> }<br>
> <br>
> -// Casts a strided element pointer to a vector pointer. The vector pointer<br>
> -// will be in the same address space as the incoming memref type.<br>
> -static Value castDataPtr(ConversionPatternRewriter &rewriter, Location loc,<br>
> - Value ptr, MemRefType memRefType, Type vt,<br>
> - const LLVMTypeConverter &converter) {<br>
> - if (converter.useOpaquePointers())<br>
> - return ptr;<br>
> -<br>
> - unsigned addressSpace = *converter.getMemRefAddressSpace(memRefType);<br>
> - auto pType = LLVM::LLVMPointerType::get(vt, addressSpace);<br>
> - return rewriter.create<LLVM::BitcastOp>(loc, pType, ptr);<br>
> -}<br>
> -<br>
> /// Convert `foldResult` into a Value. Integer attribute is converted to<br>
> /// an LLVM constant op.<br>
> static Value getAsLLVMValue(OpBuilder &builder, Location loc,<br>
> @@ -261,10 +248,8 @@ class VectorLoadStoreConversion : public ConvertOpToLLVMPattern<LoadOrStoreOp> {<br>
> this->typeConverter->convertType(loadOrStoreOp.getVectorType()));<br>
> Value dataPtr = this->getStridedElementPtr(loc, memRefTy, adaptor.getBase(),<br>
> adaptor.getIndices(), rewriter);<br>
> - Value ptr = castDataPtr(rewriter, loc, dataPtr, memRefTy, vtype,<br>
> - *this->getTypeConverter());<br>
> -<br>
> - replaceLoadOrStoreOp(loadOrStoreOp, adaptor, vtype, ptr, align, rewriter);<br>
> + replaceLoadOrStoreOp(loadOrStoreOp, adaptor, vtype, dataPtr, align,<br>
> + rewriter);<br>
> return success();<br>
> }<br>
> };<br>
> @@ -1440,19 +1425,12 @@ class VectorTypeCastOpConversion<br>
> <br>
> // Create descriptor.<br>
> auto desc = MemRefDescriptor::undef(rewriter, loc, llvmTargetDescriptorTy);<br>
> - Type llvmTargetElementTy = desc.getElementPtrType();<br>
> // Set allocated ptr.<br>
> Value allocated = sourceMemRef.allocatedPtr(rewriter, loc);<br>
> - if (!getTypeConverter()->useOpaquePointers())<br>
> - allocated =<br>
> - rewriter.create<LLVM::BitcastOp>(loc, llvmTargetElementTy, allocated);<br>
> desc.setAllocatedPtr(rewriter, loc, allocated);<br>
> <br>
> // Set aligned ptr.<br>
> Value ptr = sourceMemRef.alignedPtr(rewriter, loc);<br>
> - if (!getTypeConverter()->useOpaquePointers())<br>
> - ptr = rewriter.create<LLVM::BitcastOp>(loc, llvmTargetElementTy, ptr);<br>
> -<br>
> desc.setAlignedPtr(rewriter, loc, ptr);<br>
> // Fill offset 0.<br>
> auto attr = rewriter.getIntegerAttr(rewriter.getIndexType(), 0);<br>
><br>
> diff --git a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVMPass.cpp b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVMPass.cpp<br>
> index b865a2671fff762..4c6d0672d4108ef 100644<br>
> --- a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVMPass.cpp<br>
> +++ b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVMPass.cpp<br>
> @@ -82,7 +82,6 @@ void LowerVectorToLLVMPass::runOnOperation() {<br>
> <br>
> // Convert to the LLVM IR dialect.<br>
> LowerToLLVMOptions options(&getContext());<br>
> - options.useOpaquePointers = useOpaquePointers;<br>
> LLVMTypeConverter converter(&getContext(), options);<br>
> RewritePatternSet patterns(&getContext());<br>
> populateVectorMaskMaterializationPatterns(patterns, force32BitVectorIndices);<br>
><br>
> diff --git a/mlir/test/Conversion/VectorToLLVM/typed-pointers.mlir b/mlir/test/Conversion/VectorToLLVM/typed-pointers.mlir<br>
> deleted file mode 100644<br>
> index 5dbd9a589f39277..000000000000000<br>
> --- a/mlir/test/Conversion/VectorToLLVM/typed-pointers.mlir<br>
> +++ /dev/null<br>
> @@ -1,172 +0,0 @@<br>
> -// RUN: mlir-opt %s -convert-vector-to-llvm='use-opaque-pointers=0' -split-input-file | FileCheck %s<br>
> -<br>
> -func.func @vector_type_cast(%arg0: memref<8x8x8xf32>) -> memref<vector<8x8x8xf32>> {<br>
> - %0 = vector.type_cast %arg0: memref<8x8x8xf32> to memref<vector<8x8x8xf32>><br>
> - return %0 : memref<vector<8x8x8xf32>><br>
> -}<br>
> -// CHECK-LABEL: @vector_type_cast<br>
> -// CHECK: llvm.mlir.undef : !llvm.struct<(ptr<array<8 x array<8 x vector<8xf32>>>>, ptr<array<8 x array<8 x vector<8xf32>>>>, i64)><br>
> -// CHECK: %[[allocated:.*]] = llvm.extractvalue {{.*}}[0] : !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<3 x i64>, array<3 x i64>)><br>
> -// CHECK: %[[allocatedBit:.*]] = llvm.bitcast %[[allocated]] : !llvm.ptr<f32> to !llvm.ptr<array<8 x array<8 x vector<8xf32>>>><br>
> -// CHECK: llvm.insertvalue %[[allocatedBit]], {{.*}}[0] : !llvm.struct<(ptr<array<8 x array<8 x vector<8xf32>>>>, ptr<array<8 x array<8 x vector<8xf32>>>>, i64)><br>
> -// CHECK: %[[aligned:.*]] = llvm.extractvalue {{.*}}[1] : !llvm.struct<(ptr<f32>, ptr<f32>, i64, array<3 x i64>, array<3 x i64>)><br>
> -// CHECK: %[[alignedBit:.*]] = llvm.bitcast %[[aligned]] : !llvm.ptr<f32> to !llvm.ptr<array<8 x array<8 x vector<8xf32>>>><br>
> -// CHECK: llvm.insertvalue %[[alignedBit]], {{.*}}[1] : !llvm.struct<(ptr<array<8 x array<8 x vector<8xf32>>>>, ptr<array<8 x array<8 x vector<8xf32>>>>, i64)><br>
> -// CHECK: llvm.mlir.constant(0 : index<br>
> -// CHECK: llvm.insertvalue {{.*}}[2] : !llvm.struct<(ptr<array<8 x array<8 x vector<8xf32>>>>, ptr<array<8 x array<8 x vector<8xf32>>>>, i64)><br>
> -<br>
> -// -----<br>
> -<br>
> -func.func @vector_type_cast_non_zero_addrspace(%arg0: memref<8x8x8xf32, 3>) -> memref<vector<8x8x8xf32>, 3> {<br>
> - %0 = vector.type_cast %arg0: memref<8x8x8xf32, 3> to memref<vector<8x8x8xf32>, 3><br>
> - return %0 : memref<vector<8x8x8xf32>, 3><br>
> -}<br>
> -// CHECK-LABEL: @vector_type_cast_non_zero_addrspace<br>
> -// CHECK: llvm.mlir.undef : !llvm.struct<(ptr<array<8 x array<8 x vector<8xf32>>>, 3>, ptr<array<8 x array<8 x vector<8xf32>>>, 3>, i64)><br>
> -// CHECK: %[[allocated:.*]] = llvm.extractvalue {{.*}}[0] : !llvm.struct<(ptr<f32, 3>, ptr<f32, 3>, i64, array<3 x i64>, array<3 x i64>)><br>
> -// CHECK: %[[allocatedBit:.*]] = llvm.bitcast %[[allocated]] : !llvm.ptr<f32, 3> to !llvm.ptr<array<8 x array<8 x vector<8xf32>>>, 3><br>
> -// CHECK: llvm.insertvalue %[[allocatedBit]], {{.*}}[0] : !llvm.struct<(ptr<array<8 x array<8 x vector<8xf32>>>, 3>, ptr<array<8 x array<8 x vector<8xf32>>>, 3>, i64)><br>
> -// CHECK: %[[aligned:.*]] = llvm.extractvalue {{.*}}[1] : !llvm.struct<(ptr<f32, 3>, ptr<f32, 3>, i64, array<3 x i64>, array<3 x i64>)><br>
> -// CHECK: %[[alignedBit:.*]] = llvm.bitcast %[[aligned]] : !llvm.ptr<f32, 3> to !llvm.ptr<array<8 x array<8 x vector<8xf32>>>, 3><br>
> -// CHECK: llvm.insertvalue %[[alignedBit]], {{.*}}[1] : !llvm.struct<(ptr<array<8 x array<8 x vector<8xf32>>>, 3>, ptr<array<8 x array<8 x vector<8xf32>>>, 3>, i64)><br>
> -// CHECK: llvm.mlir.constant(0 : index<br>
> -// CHECK: llvm.insertvalue {{.*}}[2] : !llvm.struct<(ptr<array<8 x array<8 x vector<8xf32>>>, 3>, ptr<array<8 x array<8 x vector<8xf32>>>, 3>, i64)><br>
> -<br>
> -// -----<br>
> -<br>
> -func.func @transfer_read_1d(%A : memref<?xf32>, %base: index) -> vector<17xf32> {<br>
> - %f7 = arith.constant 7.0: f32<br>
> - %f = vector.transfer_read %A[%base], %f7<br>
> - {permutation_map = affine_map<(d0) -> (d0)>} :<br>
> - memref<?xf32>, vector<17xf32><br>
> - vector.transfer_write %f, %A[%base]<br>
> - {permutation_map = affine_map<(d0) -> (d0)>} :<br>
> - vector<17xf32>, memref<?xf32><br>
> - return %f: vector<17xf32><br>
> -}<br>
> -// CHECK-LABEL: func @transfer_read_1d<br>
> -// CHECK-SAME: %[[MEM:.*]]: memref<?xf32>,<br>
> -// CHECK-SAME: %[[BASE:.*]]: index) -> vector<17xf32><br>
> -// CHECK: %[[C7:.*]] = arith.constant 7.0<br>
> -//<br>
> -// 1. Let dim be the memref dimension, compute the in-bound index (dim - offset)<br>
> -// CHECK: %[[C0:.*]] = arith.constant 0 : index<br>
> -// CHECK: %[[DIM:.*]] = memref.dim %[[MEM]], %[[C0]] : memref<?xf32><br>
> -// CHECK: %[[BOUND:.*]] = arith.subi %[[DIM]], %[[BASE]] : index<br>
> -//<br>
> -// 2. Create a vector with linear indices [ 0 .. vector_length - 1 ].<br>
> -// CHECK: %[[linearIndex:.*]] = arith.constant dense<br>
> -// CHECK-SAME: <[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]> :<br>
> -// CHECK-SAME: vector<17xi32><br>
> -//<br>
> -// 3. Create bound vector to compute in-bound mask:<br>
> -// [ 0 .. vector_length - 1 ] < [ dim - offset .. dim - offset ]<br>
> -// CHECK: %[[btrunc:.*]] = arith.index_cast %[[BOUND]] : index to i32<br>
> -// CHECK: %[[boundVecInsert:.*]] = llvm.insertelement %[[btrunc]]<br>
> -// CHECK: %[[boundVect:.*]] = llvm.shufflevector %[[boundVecInsert]]<br>
> -// CHECK: %[[mask:.*]] = arith.cmpi slt, %[[linearIndex]], %[[boundVect]]<br>
> -// CHECK-SAME: : vector<17xi32><br>
> -//<br>
> -// 4. Create pass-through vector.<br>
> -// CHECK: %[[PASS_THROUGH:.*]] = arith.constant dense<7.{{.*}}> : vector<17xf32><br>
> -//<br>
> -// 5. Bitcast to vector form.<br>
> -// CHECK: %[[gep:.*]] = llvm.getelementptr %{{.*}} :<br>
> -// CHECK-SAME: (!llvm.ptr<f32>, i64) -> !llvm.ptr<f32><br>
> -// CHECK: %[[vecPtr:.*]] = llvm.bitcast %[[gep]] :<br>
> -// CHECK-SAME: !llvm.ptr<f32> to !llvm.ptr<vector<17xf32>><br>
> -//<br>
> -// 6. Rewrite as a masked read.<br>
> -// CHECK: %[[loaded:.*]] = llvm.intr.masked.load %[[vecPtr]], %[[mask]],<br>
> -// CHECK-SAME: %[[PASS_THROUGH]] {alignment = 4 : i32} :<br>
> -//<br>
> -// 1. Let dim be the memref dimension, compute the in-bound index (dim - offset)<br>
> -// CHECK: %[[C0_b:.*]] = arith.constant 0 : index<br>
> -// CHECK: %[[DIM_b:.*]] = memref.dim %[[MEM]], %[[C0_b]] : memref<?xf32><br>
> -// CHECK: %[[BOUND_b:.*]] = arith.subi %[[DIM_b]], %[[BASE]] : index<br>
> -//<br>
> -// 2. Create a vector with linear indices [ 0 .. vector_length - 1 ].<br>
> -// CHECK: %[[linearIndex_b:.*]] = arith.constant dense<br>
> -// CHECK-SAME: <[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]> :<br>
> -// CHECK-SAME: vector<17xi32><br>
> -//<br>
> -// 3. Create bound vector to compute in-bound mask:<br>
> -// [ 0 .. vector_length - 1 ] < [ dim - offset .. dim - offset ]<br>
> -// CHECK: %[[btrunc_b:.*]] = arith.index_cast %[[BOUND_b]] : index to i32<br>
> -// CHECK: %[[boundVecInsert_b:.*]] = llvm.insertelement %[[btrunc_b]]<br>
> -// CHECK: %[[boundVect_b:.*]] = llvm.shufflevector %[[boundVecInsert_b]]<br>
> -// CHECK: %[[mask_b:.*]] = arith.cmpi slt, %[[linearIndex_b]],<br>
> -// CHECK-SAME: %[[boundVect_b]] : vector<17xi32><br>
> -//<br>
> -// 4. Bitcast to vector form.<br>
> -// CHECK: %[[gep_b:.*]] = llvm.getelementptr {{.*}} :<br>
> -// CHECK-SAME: (!llvm.ptr<f32>, i64) -> !llvm.ptr<f32><br>
> -// CHECK: %[[vecPtr_b:.*]] = llvm.bitcast %[[gep_b]] :<br>
> -// CHECK-SAME: !llvm.ptr<f32> to !llvm.ptr<vector<17xf32>><br>
> -//<br>
> -// 5. Rewrite as a masked write.<br>
> -// CHECK: llvm.intr.masked.store %[[loaded]], %[[vecPtr_b]], %[[mask_b]]<br>
> -// CHECK-SAME: {alignment = 4 : i32} :<br>
> -// CHECK-SAME: vector<17xf32>, vector<17xi1> into !llvm.ptr<vector<17xf32>><br>
> -<br>
> -// -----<br>
> -<br>
> -func.func @vector_load_op(%memref : memref<200x100xf32>, %i : index, %j : index) -> vector<8xf32> {<br>
> - %0 = vector.load %memref[%i, %j] : memref<200x100xf32>, vector<8xf32><br>
> - return %0 : vector<8xf32><br>
> -}<br>
> -<br>
> -// CHECK-LABEL: func @vector_load_op<br>
> -// CHECK: %[[c100:.*]] = llvm.mlir.constant(100 : index) : i64<br>
> -// CHECK: %[[mul:.*]] = llvm.mul %{{.*}}, %[[c100]] : i64<br>
> -// CHECK: %[[add:.*]] = llvm.add %[[mul]], %{{.*}} : i64<br>
> -// CHECK: %[[gep:.*]] = llvm.getelementptr %{{.*}}[%[[add]]] : (!llvm.ptr<f32>, i64) -> !llvm.ptr<f32><br>
> -// CHECK: %[[bcast:.*]] = llvm.bitcast %[[gep]] : !llvm.ptr<f32> to !llvm.ptr<vector<8xf32>><br>
> -// CHECK: llvm.load %[[bcast]] {alignment = 4 : i64} : !llvm.ptr<vector<8xf32>><br>
> -<br>
> -// -----<br>
> -<br>
> -func.func @vector_store_op(%memref : memref<200x100xf32>, %i : index, %j : index) {<br>
> - %val = arith.constant dense<11.0> : vector<4xf32><br>
> - vector.store %val, %memref[%i, %j] : memref<200x100xf32>, vector<4xf32><br>
> - return<br>
> -}<br>
> -<br>
> -// CHECK-LABEL: func @vector_store_op<br>
> -// CHECK: %[[c100:.*]] = llvm.mlir.constant(100 : index) : i64<br>
> -// CHECK: %[[mul:.*]] = llvm.mul %{{.*}}, %[[c100]] : i64<br>
> -// CHECK: %[[add:.*]] = llvm.add %[[mul]], %{{.*}} : i64<br>
> -// CHECK: %[[gep:.*]] = llvm.getelementptr %{{.*}}[%[[add]]] : (!llvm.ptr<f32>, i64) -> !llvm.ptr<f32><br>
> -// CHECK: %[[bcast:.*]] = llvm.bitcast %[[gep]] : !llvm.ptr<f32> to !llvm.ptr<vector<4xf32>><br>
> -// CHECK: llvm.store %{{.*}}, %[[bcast]] {alignment = 4 : i64} : !llvm.ptr<vector<4xf32>><br>
> -<br>
> -// -----<br>
> -<br>
> -func.func @masked_load_op(%arg0: memref<?xf32>, %arg1: vector<16xi1>, %arg2: vector<16xf32>) -> vector<16xf32> {<br>
> - %c0 = arith.constant 0: index<br>
> - %0 = vector.maskedload %arg0[%c0], %arg1, %arg2 : memref<?xf32>, vector<16xi1>, vector<16xf32> into vector<16xf32><br>
> - return %0 : vector<16xf32><br>
> -}<br>
> -<br>
> -// CHECK-LABEL: func @masked_load_op<br>
> -// CHECK: %[[CO:.*]] = arith.constant 0 : index<br>
> -// CHECK: %[[C:.*]] = builtin.unrealized_conversion_cast %[[CO]] : index to i64<br>
> -// CHECK: %[[P:.*]] = llvm.getelementptr %{{.*}}[%[[C]]] : (!llvm.ptr<f32>, i64) -> !llvm.ptr<f32><br>
> -// CHECK: %[[B:.*]] = llvm.bitcast %[[P]] : !llvm.ptr<f32> to !llvm.ptr<vector<16xf32>><br>
> -// CHECK: %[[L:.*]] = llvm.intr.masked.load %[[B]], %{{.*}}, %{{.*}} {alignment = 4 : i32} : (!llvm.ptr<vector<16xf32>>, vector<16xi1>, vector<16xf32>) -> vector<16xf32><br>
> -// CHECK: return %[[L]] : vector<16xf32><br>
> -<br>
> -// -----<br>
> -<br>
> -func.func @masked_store_op(%arg0: memref<?xf32>, %arg1: vector<16xi1>, %arg2: vector<16xf32>) {<br>
> - %c0 = arith.constant 0: index<br>
> - vector.maskedstore %arg0[%c0], %arg1, %arg2 : memref<?xf32>, vector<16xi1>, vector<16xf32><br>
> - return<br>
> -}<br>
> -<br>
> -// CHECK-LABEL: func @masked_store_op<br>
> -// CHECK: %[[CO:.*]] = arith.constant 0 : index<br>
> -// CHECK: %[[C:.*]] = builtin.unrealized_conversion_cast %[[CO]] : index to i64<br>
> -// CHECK: %[[P:.*]] = llvm.getelementptr %{{.*}}[%[[C]]] : (!llvm.ptr<f32>, i64) -> !llvm.ptr<f32><br>
> -// CHECK: %[[B:.*]] = llvm.bitcast %[[P]] : !llvm.ptr<f32> to !llvm.ptr<vector<16xf32>><br>
> -// CHECK: llvm.intr.masked.store %{{.*}}, %[[B]], %{{.*}} {alignment = 4 : i32} : vector<16xf32>, vector<16xi1> into !llvm.ptr<vector<16xf32>><br>
><br>
> diff --git a/mlir/test/Conversion/VectorToLLVM/vector-mask-to-llvm.mlir b/mlir/test/Conversion/VectorToLLVM/vector-mask-to-llvm.mlir<br>
> index 11354213d9ab497..1abadcc345cd2d8 100644<br>
> --- a/mlir/test/Conversion/VectorToLLVM/vector-mask-to-llvm.mlir<br>
> +++ b/mlir/test/Conversion/VectorToLLVM/vector-mask-to-llvm.mlir<br>
> @@ -1,5 +1,5 @@<br>
> -// RUN: mlir-opt %s --convert-vector-to-llvm='force-32bit-vector-indices=1 use-opaque-pointers=1' | FileCheck %s --check-prefix=CMP32<br>
> -// RUN: mlir-opt %s --convert-vector-to-llvm='force-32bit-vector-indices=0 use-opaque-pointers=1' | FileCheck %s --check-prefix=CMP64<br>
> +// RUN: mlir-opt %s --convert-vector-to-llvm='force-32bit-vector-indices=1' | FileCheck %s --check-prefix=CMP32<br>
> +// RUN: mlir-opt %s --convert-vector-to-llvm='force-32bit-vector-indices=0' | FileCheck %s --check-prefix=CMP64<br>
> <br>
> // CMP32-LABEL: @genbool_var_1d(<br>
> // CMP32-SAME: %[[ARG:.*]]: index)<br>
><br>
> diff --git a/mlir/test/Conversion/VectorToLLVM/vector-reduction-to-llvm.mlir b/mlir/test/Conversion/VectorToLLVM/vector-reduction-to-llvm.mlir<br>
> index 13b7faed4790d7f..22463f57f24cfd2 100644<br>
> --- a/mlir/test/Conversion/VectorToLLVM/vector-reduction-to-llvm.mlir<br>
> +++ b/mlir/test/Conversion/VectorToLLVM/vector-reduction-to-llvm.mlir<br>
> @@ -1,5 +1,5 @@<br>
> -// RUN: mlir-opt %s -convert-vector-to-llvm='use-opaque-pointers=1' -split-input-file | FileCheck %s<br>
> -// RUN: mlir-opt %s -convert-vector-to-llvm='reassociate-fp-reductions use-opaque-pointers=1' -split-input-file | FileCheck %s --check-prefix=REASSOC<br>
> +// RUN: mlir-opt %s -convert-vector-to-llvm -split-input-file | FileCheck %s<br>
> +// RUN: mlir-opt %s -convert-vector-to-llvm='reassociate-fp-reductions' -split-input-file | FileCheck %s --check-prefix=REASSOC<br>
> <br>
> // CHECK-LABEL: @reduce_add_f32(<br>
> // CHECK-SAME: %[[A:.*]]: vector<16xf32>)<br>
><br>
> diff --git a/mlir/test/Conversion/VectorToLLVM/vector-scalable-memcpy.mlir b/mlir/test/Conversion/VectorToLLVM/vector-scalable-memcpy.mlir<br>
> index 4a5a2032816626f..811b10721bf2849 100644<br>
> --- a/mlir/test/Conversion/VectorToLLVM/vector-scalable-memcpy.mlir<br>
> +++ b/mlir/test/Conversion/VectorToLLVM/vector-scalable-memcpy.mlir<br>
> @@ -1,4 +1,4 @@<br>
> -// RUN: mlir-opt %s -convert-vector-to-llvm='use-opaque-pointers=1' | mlir-opt | FileCheck %s<br>
> +// RUN: mlir-opt %s -convert-vector-to-llvm | mlir-opt | FileCheck %s<br>
> <br>
> // CHECK: vector_scalable_memcopy([[SRC:%arg[0-9]+]]: memref<?xf32>, [[DST:%arg[0-9]+]]<br>
> func.func @vector_scalable_memcopy(%src : memref<?xf32>, %dst : memref<?xf32>, %size : index) {<br>
><br>
> diff --git a/mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir b/mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir<br>
> index 05733214bc3ae80..012d30d96799f20 100644<br>
> --- a/mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir<br>
> +++ b/mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir<br>
> @@ -1,5 +1,4 @@<br>
> -// RUN: mlir-opt %s -convert-vector-to-llvm='use-opaque-pointers=1' -split-input-file | FileCheck %s<br>
> -<br>
> +// RUN: mlir-opt %s -convert-vector-to-llvm -split-input-file | FileCheck %s<br>
> <br>
> func.func @bitcast_f32_to_i32_vector_0d(%input: vector<f32>) -> vector<i32> {<br>
> %0 = vector.bitcast %input : vector<f32> to vector<i32><br>
><br>
><br>
> <br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>