[flang-commits] [clang] [clang-tools-extra] [compiler-rt] [flang] [libc] [libcxx] [lldb] [llvm] [AArch64] missed fold vector fptoui(fdiv(uitofp(x), uitofp(y))) or fptosi(fdiv(sitofp(x), sitofp(y))) into udiv(x, y) or sdiv(x, y) for sve (PR #215126)
Durgesh Nandan Mohanty via flang-commits
flang-commits at lists.llvm.org
Sun Aug 9 11:42:01 PDT 2026
https://github.com/dnmohanty updated https://github.com/llvm/llvm-project/pull/215126
>From 3e3bc31dd206d2d94829d5051640cce6885584c4 Mon Sep 17 00:00:00 2001
From: Durgesh Nandan Mohanty <durgeshnandanmohanty at gmail.com>
Date: Sun, 9 Aug 2026 18:40:19 +0000
Subject: [PATCH 1/2] [AArch64] Pre-commit tests for SVE fdiv fold. NFC.
---
.github/workflows/release-binaries.yml | 2 +-
bolt/lib/Rewrite/BuildIDRewriter.cpp | 9 +-
bolt/test/build-id-patch.c | 17 -
.../clang-tidy/ClangTidyModuleRegistry.h | 21 +
clang-tools-extra/docs/ReleaseNotes.md | 4 -
.../checks/bugprone/random-generator-seed.md | 40 -
.../checks/bugprone/random-generator-seed.rst | 44 +
.../raw-memory-call-on-non-trivial-type.md | 33 -
.../raw-memory-call-on-non-trivial-type.rst | 35 +
.../bugprone/redundant-branch-condition.md | 106 --
.../bugprone/redundant-branch-condition.rst | 107 ++
.../checks/bugprone/reserved-identifier.md | 55 -
.../checks/bugprone/reserved-identifier.rst | 57 +
.../return-const-ref-from-parameter.md | 49 -
.../return-const-ref-from-parameter.rst | 51 +
.../bugprone/shared-ptr-array-mismatch.md | 35 -
.../bugprone/shared-ptr-array-mismatch.rst | 36 +
.../checks/bugprone/signal-handler.md | 93 --
.../checks/bugprone/signal-handler.rst | 97 ++
.../checks/bugprone/signed-char-misuse.md | 124 --
.../checks/bugprone/signed-char-misuse.rst | 125 ++
.../checks/bugprone/sizeof-expression.md | 312 ----
.../checks/bugprone/sizeof-expression.rst | 328 +++++
.../checks/bugprone/standalone-empty.md | 37 -
.../checks/bugprone/standalone-empty.rst | 39 +
.../bugprone/std-exception-baseclass.md | 32 -
.../bugprone/std-exception-baseclass.rst | 32 +
.../bugprone/std-namespace-modification.md | 66 -
.../bugprone/std-namespace-modification.rst | 68 +
.../checks/bugprone/string-constructor.md | 65 -
.../checks/bugprone/string-constructor.rst | 67 +
.../bugprone/string-integer-assignment.md | 37 -
.../bugprone/string-integer-assignment.rst | 37 +
.../string-literal-with-embedded-nul.md | 34 -
.../string-literal-with-embedded-nul.rst | 36 +
.../checks/bugprone/stringview-nullptr.md | 64 -
.../checks/bugprone/stringview-nullptr.rst | 63 +
.../checks/bugprone/suspicious-enum-usage.md | 79 -
.../checks/bugprone/suspicious-enum-usage.rst | 79 +
.../bugprone/suspicious-memory-comparison.md | 31 -
.../bugprone/suspicious-memory-comparison.rst | 35 +
.../bugprone/suspicious-memset-usage.md | 53 -
.../bugprone/suspicious-memset-usage.rst | 54 +
.../bugprone/suspicious-missing-comma.md | 58 -
.../bugprone/suspicious-missing-comma.rst | 59 +
clang/docs/LanguageExtensions.md | 8 +-
clang/docs/LifetimeSafety.md | 12 +-
clang/docs/MisExpect.md | 12 +-
clang/docs/ReleaseNotes.md | 9 +-
clang/docs/ReleaseNotesTemplate.txt | 9 +-
clang/docs/Toolchain.md | 16 +-
.../clang/Basic/DiagnosticSemaKinds.td | 4 -
.../Sema/DynamicAllocationArgumentsCXX.h | 68 -
clang/include/clang/Sema/Sema.h | 26 +-
clang/lib/AST/ByteCode/Compiler.cpp | 4 +-
clang/lib/AST/ByteCode/DynamicAllocator.cpp | 1 +
clang/lib/AST/ByteCode/Function.cpp | 5 +-
clang/lib/AST/ByteCode/Function.h | 2 +-
clang/lib/AST/ByteCode/Interp.cpp | 19 +-
clang/lib/AST/ByteCode/Pointer.cpp | 16 +-
.../LifetimeSafety/LoanPropagation.cpp | 24 +-
clang/lib/Basic/Targets/AMDGPU.cpp | 4 +-
clang/lib/CIR/CodeGen/CIRGenBuiltinAMDGPU.cpp | 17 +-
clang/lib/Sema/SemaCoroutine.cpp | 12 +-
clang/lib/Sema/SemaExprCXX.cpp | 506 +++----
clang/test/AST/ByteCode/invalid.cpp | 6 -
.../CIR/CodeGenHIP/builtins-amdgcn-gfx10.hip | 58 -
.../CIR/CodeGenHIP/builtins-amdgcn-gfx11.hip | 110 --
clang/test/CodeGen/Sparc/sparcv9-vaarg.c | 245 ----
clang/test/CodeGen/kcfi-hash.c | 6 -
clang/test/Driver/fsanitize-cfi.c | 15 +-
.../SemaCXX/microsoft-new-array-fallback.cpp | 16 -
...type-aware-new-invalid-alignvalt-cache.cpp | 32 -
.../type-aware-new-invalid-type-identity.cpp | 37 +-
compiler-rt/lib/builtins/CMakeLists.txt | 24 -
compiler-rt/lib/builtins/fixdfdi.cpp | 24 -
compiler-rt/lib/builtins/fixdfsi.cpp | 24 -
compiler-rt/lib/builtins/fixdfti.cpp | 28 -
compiler-rt/lib/builtins/fixsfdi.cpp | 24 -
compiler-rt/lib/builtins/fixsfsi.cpp | 24 -
compiler-rt/lib/builtins/fixsfti.cpp | 28 -
compiler-rt/lib/builtins/fixunsdfdi.cpp | 24 -
compiler-rt/lib/builtins/fixunsdfsi.cpp | 24 -
compiler-rt/lib/builtins/fixunsdfti.cpp | 29 -
compiler-rt/lib/builtins/fixunssfdi.cpp | 24 -
compiler-rt/lib/builtins/fixunssfsi.cpp | 24 -
compiler-rt/lib/builtins/fixunssfti.cpp | 29 -
compiler-rt/lib/builtins/floatdidf.cpp | 24 -
compiler-rt/lib/builtins/floatdisf.cpp | 24 -
compiler-rt/lib/builtins/floatsidf.cpp | 24 -
compiler-rt/lib/builtins/floatsisf.cpp | 24 -
compiler-rt/lib/builtins/floattidf.cpp | 28 -
compiler-rt/lib/builtins/floattisf.cpp | 28 -
compiler-rt/lib/builtins/floatundidf.cpp | 24 -
compiler-rt/lib/builtins/floatundisf.cpp | 24 -
compiler-rt/lib/builtins/floatunsidf.cpp | 24 -
compiler-rt/lib/builtins/floatunsisf.cpp | 24 -
compiler-rt/lib/builtins/floatuntidf.cpp | 28 -
compiler-rt/lib/builtins/floatuntisf.cpp | 28 -
.../test/profile/Inputs/mock-coroutine.h | 114 --
.../profile/instrprof-coroutine-profile.cpp | 2 +-
.../TestCases/Darwin/malloc_zone.cpp | 2 -
.../TestCases/Linux/allow_user_segv.cpp | 2 -
.../TestCases/Linux/assert.cpp | 2 -
.../TestCases/Linux/cloak_sigaction.cpp | 2 -
.../TestCases/Linux/cloak_signal.cpp | 1 -
.../TestCases/Linux/deepbind.cpp | 1 -
.../Linux/dump_registers_aarch64.cpp | 2 -
.../TestCases/Linux/malloc_usable_size.c | 2 -
.../TestCases/Linux/mlock_test.cpp | 2 -
.../TestCases/Linux/mprobe.cpp | 1 -
.../TestCases/Linux/release_to_os_test.cpp | 2 -
.../replace_dlopen_main_program_test.cpp | 2 -
.../TestCases/Linux/signal_line.cpp | 2 -
.../TestCases/Linux/signal_name.c | 2 -
.../Linux/soft_rss_limit_mb_test.cpp | 2 -
.../TestCases/Linux/tls_malloc_hook.c | 2 -
.../unexpected_format_specifier_test.cpp | 1 -
.../Posix/dedup_token_length_test.cpp | 2 -
.../TestCases/Posix/illegal_read_test.cpp | 1 -
.../TestCases/Posix/illegal_write_test.cpp | 1 -
.../TestCases/Posix/mmap_write_exec.cpp | 2 -
.../Posix/posix_memalign-alignment.cpp | 1 -
.../TestCases/Posix/print-module-map.cpp | 2 -
.../sanitizer_set_death_callback_test.cpp | 2 -
.../Posix/sanitizer_set_report_fd_test.cpp | 1 -
.../TestCases/Posix/weak_hook_test.cpp | 2 -
.../TestCases/allocator_interface.cpp | 2 -
.../TestCases/allocator_returns_null.cpp | 2 -
.../TestCases/compress_stack_depot.cpp | 2 -
.../sanitizer_common/TestCases/corelimit.cpp | 2 +-
.../TestCases/get_allocated_begin.cpp | 2 -
.../TestCases/hard_rss_limit_mb_test.cpp | 1 -
.../TestCases/malloc_hook.cpp | 2 -
.../malloc_hook_get_allocated_size_fast.cpp | 2 -
.../TestCases/max_allocation_size.cpp | 2 -
.../sanitizer_coverage_control_flow.cpp | 2 -
.../sanitizer_coverage_inline8bit_counter.cpp | 2 -
.../sanitizer_coverage_inline_bool_flag.cpp | 2 -
.../TestCases/sanitizer_coverage_no_prune.cpp | 1 -
.../sanitizer_coverage_stack_depth.cpp | 2 -
.../sanitizer_coverage_trace_pc_guard-dso.cpp | 1 -
.../sanitizer_coverage_trace_pc_guard.cpp | 1 -
flang-rt/lib/runtime/__fortran_builtins.f90 | 4 -
flang/docs/FAQ.md | 4 +-
flang/docs/GettingStarted.md | 8 +-
flang/docs/ReleaseNotes.md | 8 +-
flang/docs/ReleaseNotesTemplate.txt | 8 +-
.../include/flang/Optimizer/Dialect/FIROps.td | 3 -
flang/lib/Optimizer/Dialect/FIROps.cpp | 2 -
.../Optimizer/Transforms/MIFOpConversion.cpp | 109 +-
flang/lib/Semantics/resolve-names.cpp | 43 +-
flang/test/Fir/MIF/coarray-alloc.mlir | 496 +++----
.../Fir/MIF/coarray_alloc_many_declare.mlir | 82 --
flang/test/Fir/invalid.fir | 5 -
.../Lower/MIF/coarray_alloc_many_declare.f90 | 36 -
.../Lower/MIF/coarray_dealloc_not_alloc.f90 | 6 +-
flang/test/Semantics/data25.f90 | 79 -
flang/test/Semantics/data26.f90 | 34 -
libc/cmake/modules/LLVMLibCTestRules.cmake | 10 +-
libc/config/linux/aarch64/entrypoints.txt | 2 -
libc/config/linux/arm/entrypoints.txt | 44 -
libc/config/linux/arm/headers.txt | 2 -
libc/shared/builtins.h | 24 -
libc/shared/builtins/fixdfdi.h | 29 -
libc/shared/builtins/fixdfsi.h | 29 -
libc/shared/builtins/fixdfti.h | 35 -
libc/shared/builtins/fixsfdi.h | 29 -
libc/shared/builtins/fixsfsi.h | 29 -
libc/shared/builtins/fixsfti.h | 35 -
libc/shared/builtins/fixunsdfdi.h | 29 -
libc/shared/builtins/fixunsdfsi.h | 29 -
libc/shared/builtins/fixunsdfti.h | 35 -
libc/shared/builtins/fixunssfdi.h | 29 -
libc/shared/builtins/fixunssfsi.h | 29 -
libc/shared/builtins/fixunssfti.h | 35 -
libc/shared/builtins/floatdidf.h | 29 -
libc/shared/builtins/floatdisf.h | 29 -
libc/shared/builtins/floatsidf.h | 29 -
libc/shared/builtins/floatsisf.h | 29 -
libc/shared/builtins/floattidf.h | 35 -
libc/shared/builtins/floattisf.h | 35 -
libc/shared/builtins/floatundidf.h | 29 -
libc/shared/builtins/floatundisf.h | 29 -
libc/shared/builtins/floatunsidf.h | 29 -
libc/shared/builtins/floatunsisf.h | 29 -
libc/shared/builtins/floatuntidf.h | 35 -
libc/shared/builtins/floatuntisf.h | 35 -
libc/src/__support/builtins/CMakeLists.txt | 265 +---
libc/src/__support/builtins/fixdfdi.h | 32 -
libc/src/__support/builtins/fixdfsi.h | 32 -
libc/src/__support/builtins/fixdfti.h | 39 -
libc/src/__support/builtins/fixint_helper.h | 84 --
libc/src/__support/builtins/fixsfdi.h | 32 -
libc/src/__support/builtins/fixsfsi.h | 32 -
libc/src/__support/builtins/fixsfti.h | 39 -
libc/src/__support/builtins/fixunsdfdi.h | 32 -
libc/src/__support/builtins/fixunsdfsi.h | 32 -
libc/src/__support/builtins/fixunsdfti.h | 39 -
libc/src/__support/builtins/fixunssfdi.h | 32 -
libc/src/__support/builtins/fixunssfsi.h | 32 -
libc/src/__support/builtins/fixunssfti.h | 39 -
libc/src/__support/builtins/floatdidf.h | 32 -
libc/src/__support/builtins/floatdisf.h | 32 -
libc/src/__support/builtins/floatint_helper.h | 59 -
libc/src/__support/builtins/floatsidf.h | 32 -
libc/src/__support/builtins/floatsisf.h | 32 -
libc/src/__support/builtins/floattidf.h | 38 -
libc/src/__support/builtins/floattisf.h | 38 -
libc/src/__support/builtins/floatundidf.h | 32 -
libc/src/__support/builtins/floatundisf.h | 32 -
libc/src/__support/builtins/floatunsidf.h | 32 -
libc/src/__support/builtins/floatunsisf.h | 32 -
libc/src/__support/builtins/floatuntidf.h | 38 -
libc/src/__support/builtins/floatuntisf.h | 38 -
libc/src/__support/math/atan2f128.h | 2 +-
libc/src/net/linux/if_nameindex_impl.h | 151 +-
libc/test/integration/startup/CMakeLists.txt | 2 +-
libc/test/shared/CMakeLists.txt | 25 -
libc/test/shared/shared_builtins_test.cpp | 1 -
.../src/__support/printf_core/CMakeLists.txt | 7 +-
libc/test/src/arpa/inet/CMakeLists.txt | 16 +-
libc/test/src/compiler/CMakeLists.txt | 2 +-
libc/test/src/dirent/CMakeLists.txt | 4 +-
libc/test/src/errno/CMakeLists.txt | 2 +-
libc/test/src/fcntl/CMakeLists.txt | 6 +-
libc/test/src/fenv/CMakeLists.txt | 14 +-
libc/test/src/link/CMakeLists.txt | 2 +-
libc/test/src/math/smoke/atan2_test.cpp | 18 -
libc/test/src/math/smoke/atan2f128_test.cpp | 23 +-
libc/test/src/math/smoke/atan2f16_test.cpp | 23 -
libc/test/src/math/smoke/atan2f_test.cpp | 18 -
libc/test/src/net/linux/CMakeLists.txt | 6 +-
libc/test/src/net/linux/if_nameindex_test.cpp | 56 -
libc/test/src/netinet/CMakeLists.txt | 4 +-
libc/test/src/poll/CMakeLists.txt | 2 +-
libc/test/src/pthread/CMakeLists.txt | 8 +-
libc/test/src/pwd/CMakeLists.txt | 4 +-
libc/test/src/regex/CMakeLists.txt | 4 +-
libc/test/src/sched/CMakeLists.txt | 26 +-
libc/test/src/setjmp/CMakeLists.txt | 4 +-
libc/test/src/signal/CMakeLists.txt | 20 +-
libc/test/src/spawn/CMakeLists.txt | 2 +-
libc/test/src/stdio/scanf_core/CMakeLists.txt | 6 +-
libc/test/src/sys/epoll/linux/CMakeLists.txt | 12 +-
libc/test/src/sys/ioctl/linux/CMakeLists.txt | 2 +-
libc/test/src/sys/ipc/linux/CMakeLists.txt | 2 +-
.../src/sys/personality/linux/CMakeLists.txt | 2 +-
libc/test/src/sys/prctl/linux/CMakeLists.txt | 2 +-
libc/test/src/sys/random/linux/CMakeLists.txt | 2 +-
libc/test/src/sys/resource/CMakeLists.txt | 2 +-
libc/test/src/sys/select/CMakeLists.txt | 4 +-
libc/test/src/sys/sem/linux/CMakeLists.txt | 2 +-
libc/test/src/sys/sendfile/CMakeLists.txt | 2 +-
libc/test/src/sys/sendfile/sendfile_test.cpp | 5 +-
libc/test/src/sys/socket/linux/CMakeLists.txt | 28 +-
libc/test/src/sys/stat/CMakeLists.txt | 16 +-
libc/test/src/sys/statfs/linux/CMakeLists.txt | 4 +-
.../test/src/sys/statvfs/linux/CMakeLists.txt | 4 +-
libc/test/src/sys/time/CMakeLists.txt | 8 +-
libc/test/src/sys/time/utimes_test.cpp | 2 +-
libc/test/src/sys/utsname/CMakeLists.txt | 2 +-
libc/test/src/sys/wait/CMakeLists.txt | 4 +-
libc/test/src/termios/CMakeLists.txt | 2 +-
libc/test/src/time/CMakeLists.txt | 20 +-
libc/test/src/ucontext/CMakeLists.txt | 2 +-
libc/test/src/unistd/CMakeLists.txt | 78 +-
libc/test/src/unistd/access_test.cpp | 2 +-
libc/test/src/unistd/dup2_test.cpp | 2 +-
libc/test/src/unistd/faccessat_test.cpp | 7 +-
libc/test/src/unistd/pread_pwrite_test.cpp | 2 +-
libc/test/src/wchar/CMakeLists.txt | 2 +-
libc/test/utils/FPUtil/CMakeLists.txt | 4 +-
libc/test/utils/UnitTest/CMakeLists.txt | 2 +-
libcxx/docs/Status/Cxx26Issues.csv | 2 +-
.../iterator_sentinel.pass.cpp | 63 +-
lldb/docs/use/aarch64-linux.md | 4 +-
lldb/include/lldb/Expression/Materializer.h | 12 -
llvm/docs/AMDGPUMemoryModel.md | 8 +-
llvm/docs/AliasAnalysis.md | 16 +-
llvm/docs/BitCodeFormat.md | 16 +-
llvm/docs/BuildingADistribution.md | 12 +-
llvm/docs/CMake.md | 16 +-
llvm/docs/CodeGenerator.md | 28 +-
llvm/docs/CodingStandards.md | 8 +-
llvm/docs/CommandLine.md | 12 +-
llvm/docs/CompilerWriterInfo.md | 4 +-
llvm/docs/Contributing.md | 12 +-
llvm/docs/Coroutines.md | 8 +-
llvm/docs/CoverageMappingFormat.md | 4 +-
llvm/docs/DeveloperPolicy.md | 8 +-
llvm/docs/ExceptionHandling.md | 8 +-
llvm/docs/GettingStarted.md | 12 +-
llvm/docs/GettingStartedVS.md | 4 +-
llvm/docs/GitHub.md | 24 +-
llvm/docs/HowToBuildWithPGO.md | 4 +-
llvm/docs/HowToCrossCompileLLVM.md | 8 +-
llvm/docs/InstrProfileFormat.md | 32 +-
llvm/docs/LangRef.md | 44 +-
llvm/docs/Lexicon.md | 4 +-
llvm/docs/MIRLangRef.md | 4 +-
llvm/docs/MemProf.md | 12 +-
llvm/docs/Passes.md | 4 +-
llvm/docs/ProgrammersManual.md | 12 +-
llvm/docs/ReleaseNotes.md | 8 +-
llvm/docs/ReleaseNotesTemplate.txt | 8 +-
llvm/docs/Remarks.md | 68 +-
llvm/docs/SourceLevelDebugging.md | 24 +-
llvm/docs/SphinxQuickstartTemplate.md | 23 -
llvm/docs/TestSuiteGuide.md | 4 +-
llvm/docs/TestingGuide.md | 12 +-
llvm/docs/WritingAnLLVMNewPMPass.md | 4 +-
llvm/docs/WritingAnLLVMPass.md | 4 +-
llvm/docs/index.md | 4 +-
llvm/include/llvm/CodeGen/CommandFlags.h | 7 +
llvm/include/llvm/CodeGen/SDPatternMatch.h | 22 -
.../ExecutionEngine/JITLink/JITLinkDylib.h | 23 +-
.../JITLink/JITLinkMemoryManager.h | 9 -
.../llvm/ExecutionEngine/Orc/CallSPSViaEPC.h | 95 ++
.../llvm/ExecutionEngine/Orc/CallViaEPC.h | 153 ++
.../Orc/CallableTraitsHelper.h | 74 +
.../llvm/ExecutionEngine/Orc/RTBridge/Calls.h | 131 ++
.../llvm/ExecutionEngine/Orc/RTBridge/Proxy.h | 206 ---
.../ExecutionEngine/Orc/RTBridge/SPS/Calls.h | 143 ++
.../Orc/RTBridge/SPS/ProxySpecs.h | 94 --
llvm/include/llvm/Support/GenericDomTree.h | 11 +-
.../llvm/Support/GenericDomTreeConstruction.h | 67 +-
llvm/include/llvm/Support/KnownBits.h | 8 -
llvm/include/llvm/Transforms/Utils/Local.h | 7 +-
.../CodeGen/GlobalISel/GISelValueTracking.cpp | 10 -
.../lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 24 +-
.../ExecutionEngine/JITLink/CMakeLists.txt | 1 -
.../ExecutionEngine/JITLink/JITLinkDylib.cpp | 19 -
llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp | 20 +-
.../Orc/COFFVCRuntimeSupport.cpp | 23 +-
.../Orc/Shared/OrcRTBridge.cpp | 2 +-
.../ExecutionEngine/Orc/SimpleRemoteEPC.cpp | 2 +-
.../Orc/TargetProcess/OrcRTBootstrap.cpp | 2 +-
llvm/lib/IR/Dominators.cpp | 29 +-
llvm/lib/Support/KnownBits.cpp | 23 -
.../AMDGPU/AsmParser/AMDGPUAsmParser.cpp | 3 +-
.../Disassembler/AMDGPUDisassembler.cpp | 54 +-
.../Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp | 5 -
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h | 6 -
llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp | 37 +-
llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h | 37 -
llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp | 11 -
llvm/lib/Target/SPIRV/SPIRVCombinerHelper.cpp | 23 +-
.../Sparc/MCTargetDesc/SparcAsmBackend.cpp | 4 -
llvm/lib/Target/X86/X86ISelLowering.cpp | 6 +-
.../InstCombine/InstCombineCalls.cpp | 5 -
.../InstCombine/InstCombineCompares.cpp | 70 -
.../InstCombineLoadStoreAlloca.cpp | 2 +-
.../InstCombine/InstCombineMulDivRem.cpp | 60 -
.../Scalar/ConstraintElimination.cpp | 4 +-
.../lib/Transforms/Scalar/SimplifyCFGPass.cpp | 8 +-
llvm/lib/Transforms/Utils/Local.cpp | 319 ++---
.../Transforms/Vectorize/LoopVectorize.cpp | 2 +-
.../Transforms/Vectorize/SLPVectorizer.cpp | 41 +-
llvm/lib/Transforms/Vectorize/VPlan.cpp | 36 +-
.../Vectorize/VPlanConstruction.cpp | 22 +-
.../lib/Transforms/Vectorize/VPlanRecipes.cpp | 4 +-
.../Transforms/Vectorize/VPlanVerifier.cpp | 19 -
.../GlobalISel/knownbits-rotl-rotr.mir | 68 +-
.../test/CodeGen/AArch64/sve-fdiv-int-fold.ll | 49 +
...egalizercombiner-select-to-faceforward.mir | 68 +-
.../SPIRV/hlsl-intrinsics/faceforward.ll | 18 -
.../test/CodeGen/X86/avx512bf16-intrinsics.ll | 16 -
.../CodeGen/X86/avx512bf16-vl-intrinsics.ll | 33 -
llvm/test/MC/AMDGPU/gfx1250_asm_operands.s | 15 +-
llvm/test/MC/AMDGPU/literals.s | 59 +-
.../MC/Disassembler/AMDGPU/decode-err.txt | 40 -
.../MC/Sparc/Relocations/absolute-hi-lo.s | 35 -
.../Sparc/Relocations/relocation-specifier.s | 14 -
.../Transforms/ConstraintElimination/shl.ll | 51 -
.../Transforms/InstCombine/and-or-icmps.ll | 4 +-
.../test/Transforms/InstCombine/ctpop-pow2.ll | 12 +-
llvm/test/Transforms/InstCombine/cttz.ll | 64 -
llvm/test/Transforms/InstCombine/div.ll | 324 -----
...ed-exponent-range-dominating-conditions.ll | 70 +-
.../Transforms/InstCombine/icmp-lowbit.ll | 261 ----
.../Transforms/InstCombine/known-non-zero.ll | 26 -
.../InstCombine/known-range-frexp-exp.ll | 141 --
.../InstCombine/select-cmp-cttz-ctlz.ll | 174 ---
.../LoopVectorize/AArch64/alias-mask.ll | 2 +-
.../LoopVectorize/AArch64/bounded-load.ll | 8 +-
.../epilog-vectorization-widen-inductions.ll | 2 +-
.../AArch64/force-target-instruction-cost.ll | 24 +-
.../LoopVectorize/AArch64/gather-cost.ll | 126 +-
.../gather-do-not-vectorize-addressing.ll | 6 +-
.../LoopVectorize/AArch64/induction-costs.ll | 116 +-
...interleave-allocsize-not-equal-typesize.ll | 8 +-
.../AArch64/interleave-with-gaps.ll | 6 +-
.../AArch64/interleaved-vs-scalar.ll | 4 +-
.../AArch64/interleaving-reduction.ll | 4 +-
.../AArch64/load-cast-context.ll | 2 +-
.../partial-reduce-dot-product-epilogue.ll | 2 +-
.../partial-reduce-dot-product-neon.ll | 128 +-
.../AArch64/partial-reduce-dot-product.ll | 182 +--
.../AArch64/partial-reduce-fdot-product.ll | 34 +-
.../AArch64/partial-reduce-interleave.ll | 4 +-
.../partial-reduce-sub-epilogue-vec.ll | 2 +-
.../AArch64/partial-reduce-sub.ll | 8 +-
.../partial-reduce-with-predicate-epilogue.ll | 4 +-
.../LoopVectorize/AArch64/partial-reduce.ll | 12 +-
.../AArch64/pr60831-sve-inv-store-crash.ll | 128 +-
.../LoopVectorize/AArch64/reduction-cost.ll | 2 +-
.../AArch64/reduction-recurrence-costs-sve.ll | 84 +-
.../AArch64/reduction-small-size.ll | 4 +-
.../replicating-load-store-costs-apple.ll | 36 +-
.../AArch64/replicating-load-store-costs.ll | 36 +-
.../AArch64/scalable-strict-fadd.ll | 18 +-
.../LoopVectorize/AArch64/strict-fadd.ll | 4 +-
.../AArch64/sve-epilog-vect-reductions.ll | 4 +-
.../AArch64/sve-tail-folding-reductions.ll | 2 +-
...interleave-to-widen-memory-constant-ops.ll | 12 +-
...to-widen-memory-with-wide-ops-and-casts.ll | 4 +-
...e-to-widen-memory-with-wide-ops-chained.ll | 4 +-
.../LoopVectorize/AArch64/vector-reverse.ll | 2 +-
.../LoopVectorize/ARM/gather-cost.ll | 24 +-
.../Transforms/LoopVectorize/ARM/sphinx.ll | 2 +-
.../LoopVectorize/PowerPC/exit-branch-cost.ll | 2 +-
.../LoopVectorize/PowerPC/large-loop-rdx.ll | 2 +-
.../LoopVectorize/PowerPC/small-loop-rdx.ll | 2 +-
.../LoopVectorize/RISCV/reductions.ll | 16 +-
.../RISCV/riscv-vector-reverse.ll | 32 +-
.../RISCV/tail-folding-cond-reduction.ll | 16 +-
.../RISCV/tail-folding-intermediate-store.ll | 4 +-
.../RISCV/tail-folding-reduction.ll | 32 +-
...ctor-loop-backedge-elimination-with-evl.ll | 2 +-
.../LoopVectorize/SystemZ/addressing.ll | 16 +-
...demanding-all-lanes-and-first-lane-only.ll | 8 +-
.../LoopVectorize/X86/cast-costs.ll | 2 +-
.../X86/cost-conditional-branches.ll | 32 +-
.../LoopVectorize/X86/cost-model.ll | 172 +--
.../X86/drop-poison-generating-flags.ll | 8 +-
.../X86/fixed-order-recurrence.ll | 16 +-
.../LoopVectorize/X86/gather-cost.ll | 48 +-
.../LoopVectorize/X86/gather_scatter.ll | 20 +-
...leaved-accesses-hoist-load-across-store.ll | 32 +-
.../X86/invariant-store-vectorization.ll | 4 +-
.../LoopVectorize/X86/invoke-in-preheader.ll | 2 +-
.../LoopVectorize/X86/iv-live-outs.ll | 4 +-
.../LoopVectorize/X86/load-deref-pred.ll | 744 +++++-----
.../LoopVectorize/X86/masked_load_store.ll | 48 +-
.../X86/nondetermisitic-widening-cost.ll | 8 +-
...licate-recipe-with-only-first-lane-used.ll | 8 +-
...licating-load-store-costs-max-bandwidth.ll | 64 +-
.../X86/replicating-load-store-costs.ll | 88 +-
.../LoopVectorize/X86/strided_load_cost.ll | 148 +-
.../X86/vplan-single-bit-ind-var-width-4.ll | 8 +-
.../X86/vplan-single-bit-ind-var.ll | 4 +-
.../x86-interleaved-accesses-masked-group.ll | 16 +-
.../Transforms/LoopVectorize/bounded-load.ll | 16 +-
.../Transforms/LoopVectorize/bounded-store.ll | 8 +-
.../byte-type-function-variants.ll | 8 +-
.../LoopVectorize/consecutive-ptr-uniforms.ll | 80 +-
.../Transforms/LoopVectorize/cse-casts.ll | 2 +-
...able-info-from-assumption-constant-size.ll | 4 +-
.../LoopVectorize/epilog-iv-select-cmp.ll | 16 +-
.../epilog-vectorization-any-of-reductions.ll | 24 +-
.../epilog-vectorization-reductions.ll | 24 +-
.../LoopVectorize/find-last-iv-interleave.ll | 16 +-
.../find-last-iv-sinkable-expr.ll | 8 +-
.../find-last-iv-sinkable-load.ll | 16 +-
.../first-order-recurrence-chains.ll | 222 ---
.../LoopVectorize/first-order-recurrence.ll | 48 +-
.../LoopVectorize/forked-pointers.ll | 8 +-
.../LoopVectorize/gather-scatter.ll | 8 +-
.../Transforms/LoopVectorize/histograms.ll | 20 +-
...nd-sink-mem-ops-with-invariant-pointers.ll | 8 +-
...predicated-loads-with-predicated-stores.ll | 32 +-
.../LoopVectorize/hoist-predicated-loads.ll | 16 +-
.../LoopVectorize/if-pred-stores.ll | 2 +-
.../Transforms/LoopVectorize/induction.ll | 92 +-
.../interleaved-accesses-metadata.ll | 8 +-
...aved-accesses-requiring-scev-predicates.ll | 8 +-
.../LoopVectorize/interleaved-accesses.ll | 8 +-
.../invariant-store-vectorization.ll | 2 +-
.../LoopVectorize/load-deref-pred-align.ll | 4 +-
.../LoopVectorize/load-deref-pred-neg-off.ll | 4 +-
.../narrow-interleave-groups-scalable-vf.ll | 16 +-
.../LoopVectorize/narrow-to-single-scalar.ll | 8 +-
.../LoopVectorize/outer_loop_contiguous.ll | 443 ++----
.../test/Transforms/LoopVectorize/phi-cost.ll | 2 +-
llvm/test/Transforms/LoopVectorize/pr34681.ll | 16 +-
.../pr39417-optsize-scevchecks.ll | 8 +-
...reserve-inbounds-gep-with-pointer-casts.ll | 16 +-
.../LoopVectorize/reduction-inloop-pred.ll | 2 +-
.../LoopVectorize/reduction-inloop.ll | 28 +-
.../LoopVectorize/reduction-small-size.ll | 2 +-
.../reduction-with-invariant-store.ll | 32 +-
.../Transforms/LoopVectorize/reduction.ll | 2 +-
...te-region-branch-weights-merged-mem-ops.ll | 16 +-
.../runtime-check-small-bounded-ranges.ll | 8 +-
.../scalable-reduction-inloop.ll | 2 +-
.../LoopVectorize/single-value-blend-phis.ll | 4 +-
.../uniform-args-call-variants.ll | 4 +-
.../uniform_across_vf_induction1.ll | 44 +-
.../uniform_across_vf_induction1_and.ll | 32 +-
.../uniform_across_vf_induction1_div_urem.ll | 80 +-
.../uniform_across_vf_induction1_lshr.ll | 80 +-
.../uniform_across_vf_induction2.ll | 212 +--
.../vplan-based-stride-mv-btc.ll | 48 +-
.../LoopVectorize/vplan-based-stride-mv.ll | 1274 +++--------------
.../RISCV/spillcost-loop-invariant-gather.ll | 83 --
.../X86/reassoc-flattened-copyable-operand.ll | 99 --
.../unreachable-multi-basic-block-funclet.ll | 11 +-
.../CodeGen/SelectionDAGPatternMatchTest.cpp | 20 -
.../ExecutionEngine/JITLink/CMakeLists.txt | 1 -
.../JITLink/JITLinkDylibTest.cpp | 68 -
.../ExecutionEngine/Orc/CMakeLists.txt | 5 +-
.../ExecutionEngine/Orc/CallSPSViaEPCTest.cpp | 173 +++
.../Orc/CallableTraitsHelperTest.cpp | 70 +
.../ExecutionEngine/Orc/ProxyTest.cpp | 256 ----
.../ExecutionEngine/Orc/SPSCallersTest.cpp | 330 +++++
.../ExecutionEngine/Orc/SPSProxiesTest.cpp | 209 ---
.../Vectorize/VPlanVerifierTest.cpp | 114 +-
.../gn/secondary/libcxx/include/BUILD.gn | 1 +
.../unittests/ExecutionEngine/Orc/BUILD.gn | 2 +
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td | 28 -
.../Vector/Transforms/VectorRewritePatterns.h | 15 +
.../mlir/Interfaces/ControlFlowInterfaces.td | 16 -
mlir/lib/Dialect/Arith/IR/ArithOps.cpp | 12 +-
mlir/lib/Transforms/Utils/RegionUtils.cpp | 37 +-
.../block-merge-successor-operand-types.mlir | 48 -
offload/include/OpenMP/OMPT/Callback.h | 8 +-
offload/include/OpenMP/OMPT/Connector.h | 112 ++
offload/libomptarget/OpenMP/OMPT/Callback.cpp | 17 +-
openmp/runtime/src/ompt-general.cpp | 4 +-
530 files changed, 6703 insertions(+), 13567 deletions(-)
delete mode 100644 bolt/test/build-id-patch.c
create mode 100644 clang-tools-extra/clang-tidy/ClangTidyModuleRegistry.h
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/random-generator-seed.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/random-generator-seed.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/raw-memory-call-on-non-trivial-type.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/raw-memory-call-on-non-trivial-type.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/redundant-branch-condition.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/redundant-branch-condition.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/reserved-identifier.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/reserved-identifier.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/return-const-ref-from-parameter.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/return-const-ref-from-parameter.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/shared-ptr-array-mismatch.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/shared-ptr-array-mismatch.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/signal-handler.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/signal-handler.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/sizeof-expression.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/sizeof-expression.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/standalone-empty.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/standalone-empty.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/std-exception-baseclass.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/std-exception-baseclass.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/std-namespace-modification.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/std-namespace-modification.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/string-constructor.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/string-constructor.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/string-integer-assignment.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/string-integer-assignment.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/string-literal-with-embedded-nul.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/string-literal-with-embedded-nul.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/stringview-nullptr.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/stringview-nullptr.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-enum-usage.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-enum-usage.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memory-comparison.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memory-comparison.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memset-usage.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memset-usage.rst
delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-missing-comma.md
create mode 100644 clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-missing-comma.rst
delete mode 100644 clang/include/clang/Sema/DynamicAllocationArgumentsCXX.h
delete mode 100644 clang/test/CIR/CodeGenHIP/builtins-amdgcn-gfx10.hip
delete mode 100644 clang/test/CIR/CodeGenHIP/builtins-amdgcn-gfx11.hip
delete mode 100644 clang/test/CodeGen/Sparc/sparcv9-vaarg.c
delete mode 100644 clang/test/SemaCXX/microsoft-new-array-fallback.cpp
delete mode 100644 clang/test/SemaCXX/type-aware-new-invalid-alignvalt-cache.cpp
delete mode 100644 compiler-rt/lib/builtins/fixdfdi.cpp
delete mode 100644 compiler-rt/lib/builtins/fixdfsi.cpp
delete mode 100644 compiler-rt/lib/builtins/fixdfti.cpp
delete mode 100644 compiler-rt/lib/builtins/fixsfdi.cpp
delete mode 100644 compiler-rt/lib/builtins/fixsfsi.cpp
delete mode 100644 compiler-rt/lib/builtins/fixsfti.cpp
delete mode 100644 compiler-rt/lib/builtins/fixunsdfdi.cpp
delete mode 100644 compiler-rt/lib/builtins/fixunsdfsi.cpp
delete mode 100644 compiler-rt/lib/builtins/fixunsdfti.cpp
delete mode 100644 compiler-rt/lib/builtins/fixunssfdi.cpp
delete mode 100644 compiler-rt/lib/builtins/fixunssfsi.cpp
delete mode 100644 compiler-rt/lib/builtins/fixunssfti.cpp
delete mode 100644 compiler-rt/lib/builtins/floatdidf.cpp
delete mode 100644 compiler-rt/lib/builtins/floatdisf.cpp
delete mode 100644 compiler-rt/lib/builtins/floatsidf.cpp
delete mode 100644 compiler-rt/lib/builtins/floatsisf.cpp
delete mode 100644 compiler-rt/lib/builtins/floattidf.cpp
delete mode 100644 compiler-rt/lib/builtins/floattisf.cpp
delete mode 100644 compiler-rt/lib/builtins/floatundidf.cpp
delete mode 100644 compiler-rt/lib/builtins/floatundisf.cpp
delete mode 100644 compiler-rt/lib/builtins/floatunsidf.cpp
delete mode 100644 compiler-rt/lib/builtins/floatunsisf.cpp
delete mode 100644 compiler-rt/lib/builtins/floatuntidf.cpp
delete mode 100644 compiler-rt/lib/builtins/floatuntisf.cpp
delete mode 100644 compiler-rt/test/profile/Inputs/mock-coroutine.h
delete mode 100644 flang/test/Fir/MIF/coarray_alloc_many_declare.mlir
delete mode 100644 flang/test/Lower/MIF/coarray_alloc_many_declare.f90
delete mode 100644 flang/test/Semantics/data25.f90
delete mode 100644 flang/test/Semantics/data26.f90
delete mode 100644 libc/shared/builtins/fixdfdi.h
delete mode 100644 libc/shared/builtins/fixdfsi.h
delete mode 100644 libc/shared/builtins/fixdfti.h
delete mode 100644 libc/shared/builtins/fixsfdi.h
delete mode 100644 libc/shared/builtins/fixsfsi.h
delete mode 100644 libc/shared/builtins/fixsfti.h
delete mode 100644 libc/shared/builtins/fixunsdfdi.h
delete mode 100644 libc/shared/builtins/fixunsdfsi.h
delete mode 100644 libc/shared/builtins/fixunsdfti.h
delete mode 100644 libc/shared/builtins/fixunssfdi.h
delete mode 100644 libc/shared/builtins/fixunssfsi.h
delete mode 100644 libc/shared/builtins/fixunssfti.h
delete mode 100644 libc/shared/builtins/floatdidf.h
delete mode 100644 libc/shared/builtins/floatdisf.h
delete mode 100644 libc/shared/builtins/floatsidf.h
delete mode 100644 libc/shared/builtins/floatsisf.h
delete mode 100644 libc/shared/builtins/floattidf.h
delete mode 100644 libc/shared/builtins/floattisf.h
delete mode 100644 libc/shared/builtins/floatundidf.h
delete mode 100644 libc/shared/builtins/floatundisf.h
delete mode 100644 libc/shared/builtins/floatunsidf.h
delete mode 100644 libc/shared/builtins/floatunsisf.h
delete mode 100644 libc/shared/builtins/floatuntidf.h
delete mode 100644 libc/shared/builtins/floatuntisf.h
delete mode 100644 libc/src/__support/builtins/fixdfdi.h
delete mode 100644 libc/src/__support/builtins/fixdfsi.h
delete mode 100644 libc/src/__support/builtins/fixdfti.h
delete mode 100644 libc/src/__support/builtins/fixint_helper.h
delete mode 100644 libc/src/__support/builtins/fixsfdi.h
delete mode 100644 libc/src/__support/builtins/fixsfsi.h
delete mode 100644 libc/src/__support/builtins/fixsfti.h
delete mode 100644 libc/src/__support/builtins/fixunsdfdi.h
delete mode 100644 libc/src/__support/builtins/fixunsdfsi.h
delete mode 100644 libc/src/__support/builtins/fixunsdfti.h
delete mode 100644 libc/src/__support/builtins/fixunssfdi.h
delete mode 100644 libc/src/__support/builtins/fixunssfsi.h
delete mode 100644 libc/src/__support/builtins/fixunssfti.h
delete mode 100644 libc/src/__support/builtins/floatdidf.h
delete mode 100644 libc/src/__support/builtins/floatdisf.h
delete mode 100644 libc/src/__support/builtins/floatint_helper.h
delete mode 100644 libc/src/__support/builtins/floatsidf.h
delete mode 100644 libc/src/__support/builtins/floatsisf.h
delete mode 100644 libc/src/__support/builtins/floattidf.h
delete mode 100644 libc/src/__support/builtins/floattisf.h
delete mode 100644 libc/src/__support/builtins/floatundidf.h
delete mode 100644 libc/src/__support/builtins/floatundisf.h
delete mode 100644 libc/src/__support/builtins/floatunsidf.h
delete mode 100644 libc/src/__support/builtins/floatunsisf.h
delete mode 100644 libc/src/__support/builtins/floatuntidf.h
delete mode 100644 libc/src/__support/builtins/floatuntisf.h
create mode 100644 llvm/include/llvm/ExecutionEngine/Orc/CallSPSViaEPC.h
create mode 100644 llvm/include/llvm/ExecutionEngine/Orc/CallViaEPC.h
create mode 100644 llvm/include/llvm/ExecutionEngine/Orc/CallableTraitsHelper.h
create mode 100644 llvm/include/llvm/ExecutionEngine/Orc/RTBridge/Calls.h
delete mode 100644 llvm/include/llvm/ExecutionEngine/Orc/RTBridge/Proxy.h
create mode 100644 llvm/include/llvm/ExecutionEngine/Orc/RTBridge/SPS/Calls.h
delete mode 100644 llvm/include/llvm/ExecutionEngine/Orc/RTBridge/SPS/ProxySpecs.h
delete mode 100644 llvm/lib/ExecutionEngine/JITLink/JITLinkDylib.cpp
delete mode 100644 llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h
create mode 100644 llvm/test/CodeGen/AArch64/sve-fdiv-int-fold.ll
delete mode 100644 llvm/test/MC/Sparc/Relocations/absolute-hi-lo.s
delete mode 100644 llvm/test/Transforms/InstCombine/icmp-lowbit.ll
delete mode 100644 llvm/test/Transforms/SLPVectorizer/RISCV/spillcost-loop-invariant-gather.ll
delete mode 100644 llvm/test/Transforms/SLPVectorizer/X86/reassoc-flattened-copyable-operand.ll
delete mode 100644 llvm/unittests/ExecutionEngine/JITLink/JITLinkDylibTest.cpp
create mode 100644 llvm/unittests/ExecutionEngine/Orc/CallSPSViaEPCTest.cpp
create mode 100644 llvm/unittests/ExecutionEngine/Orc/CallableTraitsHelperTest.cpp
delete mode 100644 llvm/unittests/ExecutionEngine/Orc/ProxyTest.cpp
create mode 100644 llvm/unittests/ExecutionEngine/Orc/SPSCallersTest.cpp
delete mode 100644 llvm/unittests/ExecutionEngine/Orc/SPSProxiesTest.cpp
delete mode 100644 mlir/test/Dialect/LLVMIR/block-merge-successor-operand-types.mlir
create mode 100644 offload/include/OpenMP/OMPT/Connector.h
diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml
index 799e56f200d44..f2f50710cc0a9 100644
--- a/.github/workflows/release-binaries.yml
+++ b/.github/workflows/release-binaries.yml
@@ -296,7 +296,7 @@ jobs:
echo "windows-installer-filename=$(Split-Path -Path $installer -Leaf)" >> $env:GITHUB_OUTPUT
- name: Dump Wix logs
- if: runner.os == 'Windows' && always()
+ if: runner.os == 'Windows'
env:
LLVM_VERSION: ${{ needs.prepare.outputs.release-version }}
BUILD_DIR_SUFFIX: ${{ case(runner.arch == 'ARM64', 'arm64', 'amd64') }}
diff --git a/bolt/lib/Rewrite/BuildIDRewriter.cpp b/bolt/lib/Rewrite/BuildIDRewriter.cpp
index 2e6a679118aa0..86524746c490f 100644
--- a/bolt/lib/Rewrite/BuildIDRewriter.cpp
+++ b/bolt/lib/Rewrite/BuildIDRewriter.cpp
@@ -96,11 +96,10 @@ Error BuildIDRewriter::postEmitFinalizer() {
if (!BuildIDSection || !BuildIDOffset)
return Error::success();
- SmallVector<char, 20> Patch(BuildID.begin(), BuildID.end());
- Patch.front() ^= 0x80;
- Patch.back() ^= 0x01;
- BuildIDSection->addPatch(*BuildIDOffset, Patch);
- BC.outs() << "BOLT-INFO: patched build-id (flipped first and last bits)\n";
+ const uint8_t LastByte = BuildID[BuildID.size() - 1];
+ SmallVector<char, 1> Patch = {static_cast<char>(LastByte ^ 1)};
+ BuildIDSection->addPatch(*BuildIDOffset + BuildID.size() - 1, Patch);
+ BC.outs() << "BOLT-INFO: patched build-id (flipped last bit)\n";
return Error::success();
}
diff --git a/bolt/test/build-id-patch.c b/bolt/test/build-id-patch.c
deleted file mode 100644
index f78a8a3ca75f6..0000000000000
--- a/bolt/test/build-id-patch.c
+++ /dev/null
@@ -1,17 +0,0 @@
-// Check that BOLT patches the build ID of the output binary so that it cannot
-// be mistaken for the input. The high bit of the first byte and the low bit of
-// the last byte are flipped.
-//
-// REQUIRES: system-linux
-
-// RUN: %clang %cflags -Wl,-q %s -o %t.exe \
-// RUN: -Wl,--build-id=0x0123456789abcdef0123456789abcdef01234567
-// RUN: llvm-readelf -n %t.exe | FileCheck %s --check-prefix=CHECK-INPUT
-// RUN: llvm-bolt %t.exe -o %t.bolt | FileCheck %s --check-prefix=CHECK-BOLT
-// RUN: llvm-readelf -n %t.bolt | FileCheck %s --check-prefix=CHECK-OUTPUT
-
-// CHECK-INPUT: Build ID: 0123456789abcdef0123456789abcdef01234567
-// CHECK-BOLT: BOLT-INFO: patched build-id
-// CHECK-OUTPUT: Build ID: 8123456789abcdef0123456789abcdef01234566
-
-int main() { return 0; }
diff --git a/clang-tools-extra/clang-tidy/ClangTidyModuleRegistry.h b/clang-tools-extra/clang-tidy/ClangTidyModuleRegistry.h
new file mode 100644
index 0000000000000..39aecd955ef73
--- /dev/null
+++ b/clang-tools-extra/clang-tidy/ClangTidyModuleRegistry.h
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYMODULEREGISTRY_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYMODULEREGISTRY_H
+
+// NOLINTBEGIN
+
+// TODO(LLVM 24) Delete this header.
+#warning The ClangTidyModuleRegistry.h header is deprecated and will be removed in LLVM 24. All of the symbols it used to define have been moved into ClangTidyModule.h.
+
+#include "ClangTidyModule.h"
+
+// NOLINTEND
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYMODULEREGISTRY_H
diff --git a/clang-tools-extra/docs/ReleaseNotes.md b/clang-tools-extra/docs/ReleaseNotes.md
index ea262217f7fc2..5ded07934d906 100644
--- a/clang-tools-extra/docs/ReleaseNotes.md
+++ b/clang-tools-extra/docs/ReleaseNotes.md
@@ -56,10 +56,6 @@ infrastructure are described first, followed by tool-specific sections.
### Potentially Breaking Changes
-- In 22nd release, The `clang-tidy/ClangTidyModuleRegistry.h` header was deprecated.
- All of the symbols it used to define were moved into `clang-tidy/ClangTidyModule.h`.
- The deprecated header has been removed in this release.
-
### Improvements to clangd
#### Inlay hints
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/random-generator-seed.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/random-generator-seed.md
deleted file mode 100644
index 4b5bd5549fe15..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/random-generator-seed.md
+++ /dev/null
@@ -1,40 +0,0 @@
-```{title} clang-tidy - bugprone-random-generator-seed
-```
-
-# bugprone-random-generator-seed
-
-Flags all pseudo-random number engines, engine adaptor
-instantiations and `srand()` when initialized or seeded with default
-argument, constant expression or any user-configurable type. Pseudo-random
-number engines seeded with a predictable value may cause vulnerabilities
-e.g. in security protocols.
-
-Examples:
-
-```c++
-void foo() {
- std::mt19937 engine1; // Diagnose, always generate the same sequence
- std::mt19937 engine2(1); // Diagnose
- engine1.seed(); // Diagnose
- engine2.seed(1); // Diagnose
-
- std::time_t t;
- engine1.seed(std::time(&t)); // Diagnose, system time might be controlled by user
-
- int x = atoi(argv[1]);
- std::mt19937 engine3(x); // Will not warn
-}
-```
-
-## Options
-
-```{option} DisallowedSeedTypes
-A comma-separated list of the type names which are disallowed.
-Default is `time_t,std::time_t`.
-```
-
-## References
-
-This check corresponds to the CERT C++ Coding Standard rules
-[MSC51-CPP. Ensure your random number generator is properly seeded](https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/miscellaneous-msc/msc51-cpp/) and
-[MSC32-C. Properly seed pseudorandom number generators](https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/miscellaneous-msc/msc32-c/).
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/random-generator-seed.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/random-generator-seed.rst
new file mode 100644
index 0000000000000..c789f0fa6b27c
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/random-generator-seed.rst
@@ -0,0 +1,44 @@
+.. title:: clang-tidy - bugprone-random-generator-seed
+
+bugprone-random-generator-seed
+==============================
+
+Flags all pseudo-random number engines, engine adaptor
+instantiations and ``srand()`` when initialized or seeded with default
+argument, constant expression or any user-configurable type. Pseudo-random
+number engines seeded with a predictable value may cause vulnerabilities
+e.g. in security protocols.
+
+Examples:
+
+.. code-block:: c++
+
+ void foo() {
+ std::mt19937 engine1; // Diagnose, always generate the same sequence
+ std::mt19937 engine2(1); // Diagnose
+ engine1.seed(); // Diagnose
+ engine2.seed(1); // Diagnose
+
+ std::time_t t;
+ engine1.seed(std::time(&t)); // Diagnose, system time might be controlled by user
+
+ int x = atoi(argv[1]);
+ std::mt19937 engine3(x); // Will not warn
+ }
+
+Options
+-------
+
+.. option:: DisallowedSeedTypes
+
+ A comma-separated list of the type names which are disallowed.
+ Default value is `time_t,std::time_t`.
+
+References
+----------
+
+This check corresponds to the CERT C++ Coding Standard rules
+`MSC51-CPP. Ensure your random number generator is properly seeded
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/miscellaneous-msc/msc51-cpp/>`_ and
+`MSC32-C. Properly seed pseudorandom number generators
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/miscellaneous-msc/msc32-c/>`_.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/raw-memory-call-on-non-trivial-type.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/raw-memory-call-on-non-trivial-type.md
deleted file mode 100644
index c057e2302d2ae..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/raw-memory-call-on-non-trivial-type.md
+++ /dev/null
@@ -1,33 +0,0 @@
-```{title} clang-tidy - bugprone-raw-memory-call-on-non-trivial-type
-```
-
-# bugprone-raw-memory-call-on-non-trivial-type
-
-Flags use of the C standard library functions `memset`, `memcpy` and
-`memcmp` and similar derivatives on non-trivial types.
-
-The check will detect the following functions: `memset`, `std::memset`,
-`std::memcpy`, `memcpy`, `std::memmove`, `memmove`, `std::strcpy`,
-`strcpy`, `memccpy`, `stpncpy`, `strncpy`, `std::memcmp`, `memcmp`,
-`std::strcmp`, `strcmp`, `strncmp`.
-
-## Options
-
-```{option} MemSetNames
-Specify extra functions to flag that act similarly to `memset`. Specify
-names in a semicolon-delimited list. Default is an empty string.
-```
-
-```{option} MemCpyNames
-Specify extra functions to flag that act similarly to `memcpy`. Specify
-names in a semicolon-delimited list. Default is an empty string.
-```
-
-```{option} MemCmpNames
-Specify extra functions to flag that act similarly to `memcmp`. Specify
-names in a semicolon-delimited list. Default is an empty string.
-```
-
-This check corresponds to the CERT C++ Coding Standard rule
-[OOP57-CPP. Prefer special member functions and overloaded operators to C
-Standard Library functions](https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/object-oriented-programming-oop/oop57-cpp/).
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/raw-memory-call-on-non-trivial-type.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/raw-memory-call-on-non-trivial-type.rst
new file mode 100644
index 0000000000000..3385abdc39ab3
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/raw-memory-call-on-non-trivial-type.rst
@@ -0,0 +1,35 @@
+.. title:: clang-tidy - bugprone-raw-memory-call-on-non-trivial-type
+
+bugprone-raw-memory-call-on-non-trivial-type
+============================================
+
+Flags use of the C standard library functions ``memset``, ``memcpy`` and
+``memcmp`` and similar derivatives on non-trivial types.
+
+The check will detect the following functions: ``memset``, ``std::memset``,
+``std::memcpy``, ``memcpy``, ``std::memmove``, ``memmove``, ``std::strcpy``,
+``strcpy``, ``memccpy``, ``stpncpy``, ``strncpy``, ``std::memcmp``, ``memcmp``,
+``std::strcmp``, ``strcmp``, ``strncmp``.
+
+Options
+-------
+
+.. option:: MemSetNames
+
+ Specify extra functions to flag that act similarly to ``memset``. Specify
+ names in a semicolon-delimited list. Default is an empty string.
+
+.. option:: MemCpyNames
+
+ Specify extra functions to flag that act similarly to ``memcpy``. Specify
+ names in a semicolon-delimited list. Default is an empty string.
+
+.. option:: MemCmpNames
+
+ Specify extra functions to flag that act similarly to ``memcmp``. Specify
+ names in a semicolon-delimited list. Default is an empty string.
+
+This check corresponds to the CERT C++ Coding Standard rule
+`OOP57-CPP. Prefer special member functions and overloaded operators to C
+Standard Library functions
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/object-oriented-programming-oop/oop57-cpp/>`_.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/redundant-branch-condition.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/redundant-branch-condition.md
deleted file mode 100644
index d6284355e40c5..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/redundant-branch-condition.md
+++ /dev/null
@@ -1,106 +0,0 @@
-```{title} clang-tidy - bugprone-redundant-branch-condition
-```
-
-# bugprone-redundant-branch-condition
-
-Finds condition variables in nested `if` statements that were also checked in
-the outer `if` statement and were not changed.
-
-Simple example:
-
-```c
-bool onFire = isBurning();
-if (onFire) {
- if (onFire)
- scream();
-}
-```
-
-Here `onFire` is checked both in the outer `if` and the inner `if`
-statement without a possible change between the two checks. The check warns for
-this code and suggests removal of the second checking of variable
-`onFire`.
-
-The check also detects redundant condition checks if the condition variable
-is an operand of a logical "and" (`&&`) or a logical "or" (`||`) operator:
-
-```c
-bool onFire = isBurning();
-if (onFire) {
- if (onFire && peopleInTheBuilding > 0)
- scream();
-}
-```
-
-```c
-bool onFire = isBurning();
-if (onFire) {
- if (onFire || isCollapsing())
- scream();
-}
-```
-
-In the first case (logical "and") the suggested fix is to remove the redundant
-condition variable and keep the other side of the `&&`. In the second case
-(logical "or") the whole `if` is removed similarly to the simple case on the
-top.
-
-The condition of the outer `if` statement may also be a logical "and"
-(`&&`) expression:
-
-```c
-bool onFire = isBurning();
-if (onFire && fireFighters < 10) {
- if (someOtherCondition()) {
- if (onFire)
- scream();
- }
-}
-```
-
-The error is also detected if both the outer statement is a logical "and"
-(`&&`) and the inner statement is a logical "and" (`&&`) or "or" (`||`).
-The inner `if` statement does not have to be a direct descendant of the outer
-one.
-
-No error is detected if the condition variable may have been changed between
-the two checks:
-
-```c
-bool onFire = isBurning();
-if (onFire) {
- tryToExtinguish(onFire);
- if (onFire && peopleInTheBuilding > 0)
- scream();
-}
-```
-
-Every possible change is considered, thus if the condition variable is not
-a local variable of the function, it is a volatile or it has an alias (pointer
-or reference) then no warning is issued.
-
-## Limitations
-
-The `else` branch is not checked currently for negated condition variable:
-
-```c
-bool onFire = isBurning();
-if (onFire) {
- scream();
-} else {
- if (!onFire) {
- continueWork();
- }
-}
-```
-
-The check currently only detects redundant checking of single condition
-variables. More complex expressions are not checked:
-
-```c
-if (peopleInTheBuilding == 1) {
- if (peopleInTheBuilding == 1) {
- doSomething();
- }
-}
-```
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/redundant-branch-condition.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/redundant-branch-condition.rst
new file mode 100644
index 0000000000000..7a321bd9c0f06
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/redundant-branch-condition.rst
@@ -0,0 +1,107 @@
+.. title:: clang-tidy - bugprone-redundant-branch-condition
+
+bugprone-redundant-branch-condition
+===================================
+
+Finds condition variables in nested ``if`` statements that were also checked in
+the outer ``if`` statement and were not changed.
+
+Simple example:
+
+.. code-block:: c
+
+ bool onFire = isBurning();
+ if (onFire) {
+ if (onFire)
+ scream();
+ }
+
+Here `onFire` is checked both in the outer ``if`` and the inner ``if``
+statement without a possible change between the two checks. The check warns for
+this code and suggests removal of the second checking of variable `onFire`.
+
+The checker also detects redundant condition checks if the condition variable
+is an operand of a logical "and" (``&&``) or a logical "or" (``||``) operator:
+
+.. code-block:: c
+
+ bool onFire = isBurning();
+ if (onFire) {
+ if (onFire && peopleInTheBuilding > 0)
+ scream();
+ }
+
+.. code-block:: c
+
+ bool onFire = isBurning();
+ if (onFire) {
+ if (onFire || isCollapsing())
+ scream();
+ }
+
+In the first case (logical "and") the suggested fix is to remove the redundant
+condition variable and keep the other side of the ``&&``. In the second case
+(logical "or") the whole ``if`` is removed similarly to the simple case on the
+top.
+
+The condition of the outer ``if`` statement may also be a logical "and"
+(``&&``) expression:
+
+.. code-block:: c
+
+ bool onFire = isBurning();
+ if (onFire && fireFighters < 10) {
+ if (someOtherCondition()) {
+ if (onFire)
+ scream();
+ }
+ }
+
+The error is also detected if both the outer statement is a logical "and"
+(``&&``) and the inner statement is a logical "and" (``&&``) or "or" (``||``).
+The inner ``if`` statement does not have to be a direct descendant of the outer
+one.
+
+No error is detected if the condition variable may have been changed between
+the two checks:
+
+.. code-block:: c
+
+ bool onFire = isBurning();
+ if (onFire) {
+ tryToExtinguish(onFire);
+ if (onFire && peopleInTheBuilding > 0)
+ scream();
+ }
+
+Every possible change is considered, thus if the condition variable is not
+a local variable of the function, it is a volatile or it has an alias (pointer
+or reference) then no warning is issued.
+
+
+Limitations
+-----------
+
+The ``else`` branch is not checked currently for negated condition variable:
+
+.. code-block:: c
+
+ bool onFire = isBurning();
+ if (onFire) {
+ scream();
+ } else {
+ if (!onFire) {
+ continueWork();
+ }
+ }
+
+The checker currently only detects redundant checking of single condition
+variables. More complex expressions are not checked:
+
+.. code-block:: c
+
+ if (peopleInTheBuilding == 1) {
+ if (peopleInTheBuilding == 1) {
+ doSomething();
+ }
+ }
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/reserved-identifier.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/reserved-identifier.md
deleted file mode 100644
index d476d8889ac37..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/reserved-identifier.md
+++ /dev/null
@@ -1,55 +0,0 @@
-```{title} clang-tidy - bugprone-reserved-identifier
-```
-
-# bugprone-reserved-identifier
-
-`cert-dcl37-c` and `cert-dcl51-cpp` redirect
-here as an alias for this check.
-
-Checks for usages of identifiers reserved for use by the implementation.
-
-The C and C++ standards both reserve the following names for such use:
-
-- identifiers that begin with an underscore followed by an uppercase letter;
-- identifiers in the global namespace that begin with an underscore.
-
-The C standard additionally reserves names beginning with a double underscore,
-while the C++ standard strengthens this to reserve names with a double
-underscore occurring anywhere.
-
-Violating the naming rules above results in undefined behavior.
-
-```c++
-namespace NS {
- void __f(); // name is not allowed in user code
- using _Int = int; // same with this
- #define cool__macro // also this
-}
-int _g(); // disallowed in global namespace only
-```
-
-The check can also be inverted, i.e. it can be configured to flag any
-identifier that is *not* a reserved identifier. This mode is for use by e.g.
-standard library implementors, to ensure they don't infringe on the user
-namespace.
-
-This check does not (yet) check for other reserved names, e.g. macro names
-identical to language keywords, and names specifically reserved by language
-standards, e.g. C++ 'zombie names' and C future library directions.
-
-This check corresponds to CERT C Coding Standard rule [DCL37-C. Do not declare
-or define a reserved identifier](https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/declarations-and-initialization-dcl/dcl37-c/)
-as well as its C++ counterpart, [DCL51-CPP. Do not declare or define a reserved
-identifier](https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/declarations-and-initialization-dcl/dcl51-cpp/).
-
-## Options
-
-```{option} Invert
-If `true`, inverts the check, i.e. flags names that are not reserved.
-Default is `false`.
-```
-
-```{option} AllowedIdentifiers
-Semicolon-separated list of regular expressions that the check ignores. Default is an
-empty string.
-```
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/reserved-identifier.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/reserved-identifier.rst
new file mode 100644
index 0000000000000..f181659270a84
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/reserved-identifier.rst
@@ -0,0 +1,57 @@
+.. title:: clang-tidy - bugprone-reserved-identifier
+
+bugprone-reserved-identifier
+============================
+
+`cert-dcl37-c` and `cert-dcl51-cpp` redirect here as an alias for this check.
+
+Checks for usages of identifiers reserved for use by the implementation.
+
+The C and C++ standards both reserve the following names for such use:
+
+- identifiers that begin with an underscore followed by an uppercase letter;
+- identifiers in the global namespace that begin with an underscore.
+
+The C standard additionally reserves names beginning with a double underscore,
+while the C++ standard strengthens this to reserve names with a double
+underscore occurring anywhere.
+
+Violating the naming rules above results in undefined behavior.
+
+.. code-block:: c++
+
+ namespace NS {
+ void __f(); // name is not allowed in user code
+ using _Int = int; // same with this
+ #define cool__macro // also this
+ }
+ int _g(); // disallowed in global namespace only
+
+The check can also be inverted, i.e. it can be configured to flag any
+identifier that is *not* a reserved identifier. This mode is for use by e.g.
+standard library implementors, to ensure they don't infringe on the user
+namespace.
+
+This check does not (yet) check for other reserved names, e.g. macro names
+identical to language keywords, and names specifically reserved by language
+standards, e.g. C++ 'zombie names' and C future library directions.
+
+This check corresponds to CERT C Coding Standard rule `DCL37-C. Do not declare
+or define a reserved identifier
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/declarations-and-initialization-dcl/dcl37-c/>`_
+as well as its C++ counterpart, `DCL51-CPP. Do not declare or define a reserved
+identifier
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/declarations-and-initialization-dcl/dcl51-cpp/>`_.
+
+Options
+-------
+
+.. option:: Invert
+
+ If `true`, inverts the check, i.e. flags names that are not reserved.
+ Default is `false`.
+
+.. option:: AllowedIdentifiers
+
+ Semicolon-separated list of regular expressions that the check ignores. Default is an
+ empty list.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/return-const-ref-from-parameter.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/return-const-ref-from-parameter.md
deleted file mode 100644
index 11d4540f9d6d4..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/return-const-ref-from-parameter.md
+++ /dev/null
@@ -1,49 +0,0 @@
-```{title} clang-tidy - bugprone-return-const-ref-from-parameter
-```
-
-# bugprone-return-const-ref-from-parameter
-
-Detects return statements that return a constant reference parameter as
-constant reference. This may cause use-after-free errors if the caller
-uses xvalues as arguments.
-
-In C++, constant reference parameters can accept xvalues which will be
-destructed after the call. When the function returns such a parameter also
-as constant reference, then the returned reference can be used after the
-object it refers to has been destroyed.
-
-## Example
-
-```c++
-struct S {
- int v;
- S(int);
- ~S();
-};
-
-const S &fn(const S &a) {
- return a;
-}
-
-const S& s = fn(S{1});
-s.v; // use after free
-```
-
-This issue can be resolved by declaring an overload of the problematic function
-where the `const &` parameter is instead declared as `&&`. The developer has
-to ensure that the implementation of that function does not produce a
-use-after-free, the exact error that this check is warning against.
-Marking such an `&&` overload as `deleted`, will silence the warning as
-well. In the case of different `const &` parameters being returned depending
-on the control flow of the function, an overload where all problematic
-`const &` parameters have been declared as `&&` will resolve the issue.
-
-This issue can also be resolved by adding `[[clang::lifetimebound]]`. Clang
-enable `-Wdangling` warning by default which can detect mis-uses of the
-annotated function. See [lifetimebound attribute](https://clang.llvm.org/docs/AttributeReference.html#lifetimebound)
-for details.
-
-```c++
-const int &f(const int &a [[clang::lifetimebound]]) { return a; } // no warning
-const int &v = f(1); // warning: temporary bound to local reference 'v' will be destroyed at the end of the full-expression [-Wdangling]
-```
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/return-const-ref-from-parameter.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/return-const-ref-from-parameter.rst
new file mode 100644
index 0000000000000..663e2149c7ac9
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/return-const-ref-from-parameter.rst
@@ -0,0 +1,51 @@
+.. title:: clang-tidy - bugprone-return-const-ref-from-parameter
+
+bugprone-return-const-ref-from-parameter
+========================================
+
+Detects return statements that return a constant reference parameter as
+constant reference. This may cause use-after-free errors if the caller
+uses xvalues as arguments.
+
+In C++, constant reference parameters can accept xvalues which will be
+destructed after the call. When the function returns such a parameter also
+as constant reference, then the returned reference can be used after the
+object it refers to has been destroyed.
+
+Example
+-------
+
+.. code-block:: c++
+
+ struct S {
+ int v;
+ S(int);
+ ~S();
+ };
+
+ const S &fn(const S &a) {
+ return a;
+ }
+
+ const S& s = fn(S{1});
+ s.v; // use after free
+
+
+This issue can be resolved by declaring an overload of the problematic function
+where the ``const &`` parameter is instead declared as ``&&``. The developer has
+to ensure that the implementation of that function does not produce a
+use-after-free, the exact error that this check is warning against.
+Marking such an ``&&`` overload as ``deleted``, will silence the warning as
+well. In the case of different ``const &`` parameters being returned depending
+on the control flow of the function, an overload where all problematic
+``const &`` parameters have been declared as ``&&`` will resolve the issue.
+
+This issue can also be resolved by adding ``[[clang::lifetimebound]]``. Clang
+enable ``-Wdangling`` warning by default which can detect mis-uses of the
+annotated function. See `lifetimebound attribute <https://clang.llvm.org/docs/AttributeReference.html#lifetimebound>`_
+for details.
+
+.. code-block:: c++
+
+ const int &f(const int &a [[clang::lifetimebound]]) { return a; } // no warning
+ const int &v = f(1); // warning: temporary bound to local reference 'v' will be destroyed at the end of the full-expression [-Wdangling]
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/shared-ptr-array-mismatch.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/shared-ptr-array-mismatch.md
deleted file mode 100644
index dd0420c6499ef..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/shared-ptr-array-mismatch.md
+++ /dev/null
@@ -1,35 +0,0 @@
-```{title} clang-tidy - bugprone-shared-ptr-array-mismatch
-```
-
-# bugprone-shared-ptr-array-mismatch
-
-Finds initializations of C++ shared pointers to non-array type that are
-initialized with an array.
-
-If a shared pointer `std::shared_ptr<T>` is initialized with a new-expression
-`new T[]` the memory is not deallocated correctly. The pointer uses plain
-`delete` in this case to deallocate the target memory. Instead a `delete[]`
-call is needed. A `std::shared_ptr<T[]>` calls the correct delete operator.
-
-The check offers replacement of `shared_ptr<T>` to `shared_ptr<T[]>` if it
-is used at a single variable declaration (one variable in one statement).
-
-Example:
-
-```c++
-std::shared_ptr<Foo> x(new Foo[10]); // -> std::shared_ptr<Foo[]> x(new Foo[10]);
-// ^ warning: shared pointer to non-array is initialized with array [bugprone-shared-ptr-array-mismatch]
-std::shared_ptr<Foo> x1(new Foo), x2(new Foo[10]); // no replacement
-// ^ warning: shared pointer to non-array is initialized with array [bugprone-shared-ptr-array-mismatch]
-
-std::shared_ptr<Foo> x3(new Foo[10], [](const Foo *ptr) { delete[] ptr; }); // no warning
-
-struct S {
- std::shared_ptr<Foo> x(new Foo[10]); // no replacement in this case
- // ^ warning: shared pointer to non-array is initialized with array [bugprone-shared-ptr-array-mismatch]
-};
-```
-
-This check partially covers the CERT C++ Coding Standard rule
-[MEM51-CPP. Properly deallocate dynamically allocated resources](https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/memory-management-mem/mem51-cpp/)
-However, only the `std::shared_ptr` case is detected by this check.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/shared-ptr-array-mismatch.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/shared-ptr-array-mismatch.rst
new file mode 100644
index 0000000000000..003be010f359b
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/shared-ptr-array-mismatch.rst
@@ -0,0 +1,36 @@
+.. title:: clang-tidy - bugprone-shared-ptr-array-mismatch
+
+bugprone-shared-ptr-array-mismatch
+==================================
+
+Finds initializations of C++ shared pointers to non-array type that are
+initialized with an array.
+
+If a shared pointer ``std::shared_ptr<T>`` is initialized with a new-expression
+``new T[]`` the memory is not deallocated correctly. The pointer uses plain
+``delete`` in this case to deallocate the target memory. Instead a ``delete[]``
+call is needed. A ``std::shared_ptr<T[]>`` calls the correct delete operator.
+
+The check offers replacement of ``shared_ptr<T>`` to ``shared_ptr<T[]>`` if it
+is used at a single variable declaration (one variable in one statement).
+
+Example:
+
+.. code-block:: c++
+
+ std::shared_ptr<Foo> x(new Foo[10]); // -> std::shared_ptr<Foo[]> x(new Foo[10]);
+ // ^ warning: shared pointer to non-array is initialized with array [bugprone-shared-ptr-array-mismatch]
+ std::shared_ptr<Foo> x1(new Foo), x2(new Foo[10]); // no replacement
+ // ^ warning: shared pointer to non-array is initialized with array [bugprone-shared-ptr-array-mismatch]
+
+ std::shared_ptr<Foo> x3(new Foo[10], [](const Foo *ptr) { delete[] ptr; }); // no warning
+
+ struct S {
+ std::shared_ptr<Foo> x(new Foo[10]); // no replacement in this case
+ // ^ warning: shared pointer to non-array is initialized with array [bugprone-shared-ptr-array-mismatch]
+ };
+
+This check partially covers the CERT C++ Coding Standard rule
+`MEM51-CPP. Properly deallocate dynamically allocated resources
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/memory-management-mem/mem51-cpp/>`_
+However, only the ``std::shared_ptr`` case is detected by this check.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/signal-handler.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/signal-handler.md
deleted file mode 100644
index 7a4958a0b80f9..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/signal-handler.md
+++ /dev/null
@@ -1,93 +0,0 @@
-```{title} clang-tidy - bugprone-signal-handler
-```
-
-# bugprone-signal-handler
-
-Finds specific constructs in signal handler functions that can cause undefined
-behavior. The rules for what is allowed differ between C++ language versions.
-
-Checked signal handler rules for C:
-
-- Calls to non-asynchronous-safe functions are not allowed.
-
-Checked signal handler rules for up to and including C++14:
-
-- Calls to non-asynchronous-safe functions are not allowed.
-- C++-specific code constructs are not allowed in signal handlers.
- In other words, only the common subset of C and C++ is allowed to be used.
-- Calls to functions with non-C linkage are not allowed (including the signal
- handler itself).
-
-The check is disabled on C++17 and later.
-
-Asynchronous-safety is determined by comparing the function's name against a
-set of known functions. In addition, the function must come from a system
-header include and in a global namespace. The (possible) arguments passed to
-the function are not checked. Any function that cannot be determined to be
-asynchronous-safe is assumed to be non-asynchronous-safe by the check,
-including user functions for which only the declaration is visible.
-Calls to user-defined functions with visible definitions are checked
-recursively.
-
-This check implements the CERT C Coding Standard rule
-[SIG30-C. Call only asynchronous-safe functions within signal handlers](https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/signals-sig/sig30-c/)
-and the rule
-[MSC54-CPP. A signal handler must be a plain old function](https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/miscellaneous-msc/msc54-cpp/).
-It has the alias names `cert-sig30-c` and `cert-msc54-cpp`.
-
-## Options
-
-```{option} AsyncSafeFunctionSet
-Selects which set of functions is considered as asynchronous-safe
-(and therefore allowed in signal handlers). It can be set to the following values:
-
-- `minimal`
- : Selects a minimal set that is defined in the CERT SIG30-C rule.
- and includes functions `abort()`, `_Exit()`, `quick_exit()` and
- `signal()`.
-- `POSIX`
- : Selects a larger set of functions that is listed in POSIX.1-2017 (see [this
- link](https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03)
- for more information). The following functions are included:
- `_Exit`, `_exit`, `abort`, `accept`, `access`, `aio_error`,
- `aio_return`, `aio_suspend`, `alarm`, `bind`, `cfgetispeed`,
- `cfgetospeed`, `cfsetispeed`, `cfsetospeed`, `chdir`, `chmod`,
- `chown`, `clock_gettime`, `close`, `connect`, `creat`, `dup`,
- `dup2`, `execl`, `execle`, `execv`, `execve`, `faccessat`,
- `fchdir`, `fchmod`, `fchmodat`, `fchown`, `fchownat`, `fcntl`,
- `fdatasync`, `fexecve`, `ffs`, `fork`, `fstat`, `fstatat`,
- `fsync`, `ftruncate`, `futimens`, `getegid`, `geteuid`,
- `getgid`, `getgroups`, `getpeername`, `getpgrp`, `getpid`,
- `getppid`, `getsockname`, `getsockopt`, `getuid`, `htonl`,
- `htons`, `kill`, `link`, `linkat`, `listen`, `longjmp`,
- `lseek`, `lstat`, `memccpy`, `memchr`, `memcmp`, `memcpy`,
- `memmove`, `memset`, `mkdir`, `mkdirat`, `mkfifo`, `mkfifoat`,
- `mknod`, `mknodat`, `ntohl`, `ntohs`, `open`, `openat`,
- `pause`, `pipe`, `poll`, `posix_trace_event`, `pselect`,
- `pthread_kill`, `pthread_self`, `pthread_sigmask`, `quick_exit`,
- `raise`, `read`, `readlink`, `readlinkat`, `recv`, `recvfrom`,
- `recvmsg`, `rename`, `renameat`, `rmdir`, `select`, `sem_post`,
- `send`, `sendmsg`, `sendto`, `setgid`, `setpgid`, `setsid`,
- `setsockopt`, `setuid`, `shutdown`, `sigaction`, `sigaddset`,
- `sigdelset`, `sigemptyset`, `sigfillset`, `sigismember`,
- `siglongjmp`, `signal`, `sigpause`, `sigpending`, `sigprocmask`,
- `sigqueue`, `sigset`, `sigsuspend`, `sleep`, `sockatmark`,
- `socket`, `socketpair`, `stat`, `stpcpy`, `stpncpy`,
- `strcat`, `strchr`, `strcmp`, `strcpy`, `strcspn`, `strlen`,
- `strncat`, `strncmp`, `strncpy`, `strnlen`, `strpbrk`,
- `strrchr`, `strspn`, `strstr`, `strtok_r`, `symlink`,
- `symlinkat`, `tcdrain`, `tcflow`, `tcflush`, `tcgetattr`,
- `tcgetpgrp`, `tcsendbreak`, `tcsetattr`, `tcsetpgrp`,
- `time`, `timer_getoverrun`, `timer_gettime`, `timer_settime`,
- `times`, `umask`, `uname`, `unlink`, `unlinkat`, `utime`,
- `utimensat`, `utimes`, `wait`, `waitpid`, `wcpcpy`,
- `wcpncpy`, `wcscat`, `wcschr`, `wcscmp`, `wcscpy`, `wcscspn`,
- `wcslen`, `wcsncat`, `wcsncmp`, `wcsncpy`, `wcsnlen`, `wcspbrk`,
- `wcsrchr`, `wcsspn`, `wcsstr`, `wcstok`, `wmemchr`, `wmemcmp`,
- `wmemcpy`, `wmemmove`, `wmemset`, `write`
-
- The function `quick_exit` is not included in the POSIX list but it
- is included here in the set of safe functions.
-
-Default is `POSIX`.
-```
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/signal-handler.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/signal-handler.rst
new file mode 100644
index 0000000000000..f5648654023c0
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/signal-handler.rst
@@ -0,0 +1,97 @@
+.. title:: clang-tidy - bugprone-signal-handler
+
+bugprone-signal-handler
+=======================
+
+Finds specific constructs in signal handler functions that can cause undefined
+behavior. The rules for what is allowed differ between C++ language versions.
+
+Checked signal handler rules for C:
+
+- Calls to non-asynchronous-safe functions are not allowed.
+
+Checked signal handler rules for up to and including C++14:
+
+- Calls to non-asynchronous-safe functions are not allowed.
+- C++-specific code constructs are not allowed in signal handlers.
+ In other words, only the common subset of C and C++ is allowed to be used.
+- Calls to functions with non-C linkage are not allowed (including the signal
+ handler itself).
+
+The check is disabled on C++17 and later.
+
+Asynchronous-safety is determined by comparing the function's name against a
+set of known functions. In addition, the function must come from a system
+header include and in a global namespace. The (possible) arguments passed to
+the function are not checked. Any function that cannot be determined to be
+asynchronous-safe is assumed to be non-asynchronous-safe by the check,
+including user functions for which only the declaration is visible.
+Calls to user-defined functions with visible definitions are checked
+recursively.
+
+This check implements the CERT C Coding Standard rule
+`SIG30-C. Call only asynchronous-safe functions within signal handlers
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/signals-sig/sig30-c/>`_
+and the rule
+`MSC54-CPP. A signal handler must be a plain old function
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/miscellaneous-msc/msc54-cpp/>`_.
+It has the alias names ``cert-sig30-c`` and ``cert-msc54-cpp``.
+
+Options
+-------
+
+.. option:: AsyncSafeFunctionSet
+
+ Selects which set of functions is considered as asynchronous-safe
+ (and therefore allowed in signal handlers). It can be set to the following values:
+
+ - `minimal`
+ Selects a minimal set that is defined in the CERT SIG30-C rule.
+ and includes functions ``abort()``, ``_Exit()``, ``quick_exit()`` and
+ ``signal()``.
+ - `POSIX`
+ Selects a larger set of functions that is listed in POSIX.1-2017 (see `this
+ link
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03>`_
+ for more information). The following functions are included:
+ ``_Exit``, ``_exit``, ``abort``, ``accept``, ``access``, ``aio_error``,
+ ``aio_return``, ``aio_suspend``, ``alarm``, ``bind``, ``cfgetispeed``,
+ ``cfgetospeed``, ``cfsetispeed``, ``cfsetospeed``, ``chdir``, ``chmod``,
+ ``chown``, ``clock_gettime``, ``close``, ``connect``, ``creat``, ``dup``,
+ ``dup2``, ``execl``, ``execle``, ``execv``, ``execve``, ``faccessat``,
+ ``fchdir``, ``fchmod``, ``fchmodat``, ``fchown``, ``fchownat``, ``fcntl``,
+ ``fdatasync``, ``fexecve``, ``ffs``, ``fork``, ``fstat``, ``fstatat``,
+ ``fsync``, ``ftruncate``, ``futimens``, ``getegid``, ``geteuid``,
+ ``getgid``, ``getgroups``, ``getpeername``, ``getpgrp``, ``getpid``,
+ ``getppid``, ``getsockname``, ``getsockopt``, ``getuid``, ``htonl``,
+ ``htons``, ``kill``, ``link``, ``linkat``, ``listen``, ``longjmp``,
+ ``lseek``, ``lstat``, ``memccpy``, ``memchr``, ``memcmp``, ``memcpy``,
+ ``memmove``, ``memset``, ``mkdir``, ``mkdirat``, ``mkfifo``, ``mkfifoat``,
+ ``mknod``, ``mknodat``, ``ntohl``, ``ntohs``, ``open``, ``openat``,
+ ``pause``, ``pipe``, ``poll``, ``posix_trace_event``, ``pselect``,
+ ``pthread_kill``, ``pthread_self``, ``pthread_sigmask``, ``quick_exit``,
+ ``raise``, ``read``, ``readlink``, ``readlinkat``, ``recv``, ``recvfrom``,
+ ``recvmsg``, ``rename``, ``renameat``, ``rmdir``, ``select``, ``sem_post``,
+ ``send``, ``sendmsg``, ``sendto``, ``setgid``, ``setpgid``, ``setsid``,
+ ``setsockopt``, ``setuid``, ``shutdown``, ``sigaction``, ``sigaddset``,
+ ``sigdelset``, ``sigemptyset``, ``sigfillset``, ``sigismember``,
+ ``siglongjmp``, ``signal``, ``sigpause``, ``sigpending``, ``sigprocmask``,
+ ``sigqueue``, ``sigset``, ``sigsuspend``, ``sleep``, ``sockatmark``,
+ ``socket``, ``socketpair``, ``stat``, ``stpcpy``, ``stpncpy``,
+ ``strcat``, ``strchr``, ``strcmp``, ``strcpy``, ``strcspn``, ``strlen``,
+ ``strncat``, ``strncmp``, ``strncpy``, ``strnlen``, ``strpbrk``,
+ ``strrchr``, ``strspn``, ``strstr``, ``strtok_r``, ``symlink``,
+ ``symlinkat``, ``tcdrain``, ``tcflow``, ``tcflush``, ``tcgetattr``,
+ ``tcgetpgrp``, ``tcsendbreak``, ``tcsetattr``, ``tcsetpgrp``,
+ ``time``, ``timer_getoverrun``, ``timer_gettime``, ``timer_settime``,
+ ``times``, ``umask``, ``uname``, ``unlink``, ``unlinkat``, ``utime``,
+ ``utimensat``, ``utimes``, ``wait``, ``waitpid``, ``wcpcpy``,
+ ``wcpncpy``, ``wcscat``, ``wcschr``, ``wcscmp``, ``wcscpy``, ``wcscspn``,
+ ``wcslen``, ``wcsncat``, ``wcsncmp``, ``wcsncpy``, ``wcsnlen``, ``wcspbrk``,
+ ``wcsrchr``, ``wcsspn``, ``wcsstr``, ``wcstok``, ``wmemchr``, ``wmemcmp``,
+ ``wmemcpy``, ``wmemmove``, ``wmemset``, ``write``
+
+ The function ``quick_exit`` is not included in the POSIX list but it
+ is included here in the set of safe functions.
+
+ The default value is `POSIX`.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.md
deleted file mode 100644
index e2fd4bac5893e..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.md
+++ /dev/null
@@ -1,124 +0,0 @@
-```{title} clang-tidy - bugprone-signed-char-misuse
-```
-
-# bugprone-signed-char-misuse
-
-`cert-str34-c` redirects here as an alias for this check. For
-the CERT alias, the `DiagnoseSignedUnsignedCharComparisons`
-option is set to `false`.
-
-Finds those `signed char` -> integer conversions which might indicate a
-programming error. The basic problem with the `signed char`, that it might
-store the non-ASCII characters as negative values. This behavior can cause a
-misunderstanding of the written code both when an explicit and when an
-implicit conversion happens.
-
-When the code contains an explicit `signed char` -> integer conversion, the
-human programmer probably expects that the converted value matches with the
-character code (a value from [0..255]), however, the actual value is in
-[-128..127] interval. To avoid this kind of misinterpretation, the desired way
-of converting from a `signed char` to an integer value is converting to
-`unsigned char` first, which stores all the characters in the positive
-[0..255] interval which matches the known character codes.
-
-In case of implicit conversion, the programmer might not actually be aware
-that a conversion happened and char value is used as an integer. There are
-some use cases when this unawareness might lead to a functionally imperfect
-code. For example, checking the equality of a `signed char` and an
-`unsigned char` variable is something we should avoid in C++ code. During
-this comparison, the two variables are converted to integers which have
-different value ranges. For `signed char`, the non-ASCII characters are
-stored as a value in [-128..-1] interval, while the same characters are
-stored in the [128..255] interval for an `unsigned char`.
-
-It depends on the actual platform whether plain `char` is handled as
-`signed char` by default and so it is caught by this check or not.
-To change the default behavior you can use `-funsigned-char` and
-`-fsigned-char` compilation options.
-
-Currently, this check warns in the following cases:
-
-- `signed char` is assigned to an integer variable
-- `signed char` and `unsigned char` are compared with
- equality/inequality operator
-- `signed char` is converted to an integer in the array subscript
-
-See also:
-[STR34-C. Cast characters to unsigned char before converting to larger
-integer sizes](https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/characters-and-strings-str/str34-c/)
-
-A good example from the CERT description when a `char` variable is used to
-read from a file that might contain non-ASCII characters. The problem comes
-up when the code uses the `-1` integer value as EOF, while the 255 character
-code is also stored as `-1` in two's complement form of char type.
-See a simple example of this below. This code stops not only when it reaches
-the end of the file, but also when it gets a character with the 255 code.
-
-```c++
-#define EOF (-1)
-
-int read(void) {
- char CChar;
- int IChar = EOF;
-
- if (readChar(CChar)) {
- IChar = CChar;
- }
- return IChar;
-}
-```
-
-A proper way to fix the code above is converting the `char` variable to
-an `unsigned char` value first.
-
-```c++
-#define EOF (-1)
-
-int read(void) {
- char CChar;
- int IChar = EOF;
-
- if (readChar(CChar)) {
- IChar = static_cast<unsigned char>(CChar);
- }
- return IChar;
-}
-```
-
-Another use case is checking the equality of two `char` variables with
-different signedness. Inside the non-ASCII value range this comparison between
-a `signed char` and an `unsigned char` always returns `false`.
-
-```c++
-bool compare(signed char SChar, unsigned char USChar) {
- if (SChar == USChar)
- return true;
- return false;
-}
-```
-
-The easiest way to fix this kind of comparison is casting one of the arguments,
-so both arguments will have the same type.
-
-```c++
-bool compare(signed char SChar, unsigned char USChar) {
- if (static_cast<unsigned char>(SChar) == USChar)
- return true;
- return false;
-}
-```
-
-## Options
-
-```{option} CharTypedefsToIgnore
-A semicolon-separated list of typedef names. In this list, we can list
-typedefs for `char` or `signed char`, which will be ignored by the
-check. This is useful when a typedef introduces an integer alias like
-`sal_Int8` or `int8_t`. In this case, human misinterpretation is not
-an issue. Default is an empty string.
-```
-
-```{option} DiagnoseSignedUnsignedCharComparisons
-When `true`, the check will warn on `signed char`/`unsigned char` comparisons,
-otherwise these comparisons are ignored. Default is `true`.
-```
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.rst
new file mode 100644
index 0000000000000..2a728d1093f6f
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.rst
@@ -0,0 +1,125 @@
+.. title:: clang-tidy - bugprone-signed-char-misuse
+
+bugprone-signed-char-misuse
+===========================
+
+`cert-str34-c` redirects here as an alias for this check. For the CERT alias,
+the `DiagnoseSignedUnsignedCharComparisons` option is set to `false`.
+
+Finds those ``signed char`` -> integer conversions which might indicate a
+programming error. The basic problem with the ``signed char``, that it might
+store the non-ASCII characters as negative values. This behavior can cause a
+misunderstanding of the written code both when an explicit and when an
+implicit conversion happens.
+
+When the code contains an explicit ``signed char`` -> integer conversion, the
+human programmer probably expects that the converted value matches with the
+character code (a value from [0..255]), however, the actual value is in
+[-128..127] interval. To avoid this kind of misinterpretation, the desired way
+of converting from a ``signed char`` to an integer value is converting to
+``unsigned char`` first, which stores all the characters in the positive
+[0..255] interval which matches the known character codes.
+
+In case of implicit conversion, the programmer might not actually be aware
+that a conversion happened and char value is used as an integer. There are
+some use cases when this unawareness might lead to a functionally imperfect
+code. For example, checking the equality of a ``signed char`` and an
+``unsigned char`` variable is something we should avoid in C++ code. During
+this comparison, the two variables are converted to integers which have
+different value ranges. For ``signed char``, the non-ASCII characters are
+stored as a value in [-128..-1] interval, while the same characters are
+stored in the [128..255] interval for an ``unsigned char``.
+
+It depends on the actual platform whether plain ``char`` is handled as
+``signed char`` by default and so it is caught by this check or not.
+To change the default behavior you can use ``-funsigned-char`` and
+``-fsigned-char`` compilation options.
+
+Currently, this check warns in the following cases:
+
+- ``signed char`` is assigned to an integer variable
+- ``signed char`` and ``unsigned char`` are compared with
+ equality/inequality operator
+- ``signed char`` is converted to an integer in the array subscript
+
+See also:
+`STR34-C. Cast characters to unsigned char before converting to larger
+integer sizes
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/characters-and-strings-str/str34-c/>`_
+
+A good example from the CERT description when a ``char`` variable is used to
+read from a file that might contain non-ASCII characters. The problem comes
+up when the code uses the ``-1`` integer value as EOF, while the 255 character
+code is also stored as ``-1`` in two's complement form of char type.
+See a simple example of this below. This code stops not only when it reaches
+the end of the file, but also when it gets a character with the 255 code.
+
+.. code-block:: c++
+
+ #define EOF (-1)
+
+ int read(void) {
+ char CChar;
+ int IChar = EOF;
+
+ if (readChar(CChar)) {
+ IChar = CChar;
+ }
+ return IChar;
+ }
+
+A proper way to fix the code above is converting the ``char`` variable to
+an ``unsigned char`` value first.
+
+.. code-block:: c++
+
+ #define EOF (-1)
+
+ int read(void) {
+ char CChar;
+ int IChar = EOF;
+
+ if (readChar(CChar)) {
+ IChar = static_cast<unsigned char>(CChar);
+ }
+ return IChar;
+ }
+
+Another use case is checking the equality of two ``char`` variables with
+different signedness. Inside the non-ASCII value range this comparison between
+a ``signed char`` and an ``unsigned char`` always returns ``false``.
+
+.. code-block:: c++
+
+ bool compare(signed char SChar, unsigned char USChar) {
+ if (SChar == USChar)
+ return true;
+ return false;
+ }
+
+The easiest way to fix this kind of comparison is casting one of the arguments,
+so both arguments will have the same type.
+
+.. code-block:: c++
+
+ bool compare(signed char SChar, unsigned char USChar) {
+ if (static_cast<unsigned char>(SChar) == USChar)
+ return true;
+ return false;
+ }
+
+Options
+-------
+
+.. option:: CharTypedefsToIgnore
+
+ A semicolon-separated list of typedef names. In this list, we can list
+ typedefs for ``char`` or ``signed char``, which will be ignored by the
+ check. This is useful when a typedef introduces an integer alias like
+ ``sal_Int8`` or ``int8_t``. In this case, human misinterpretation is not
+ an issue. Default is an empty string.
+
+.. option:: DiagnoseSignedUnsignedCharComparisons
+
+ When `true`, the check will warn on ``signed char``/``unsigned char`` comparisons,
+ otherwise these comparisons are ignored. By default, this option is set to `true`.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/sizeof-expression.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/sizeof-expression.md
deleted file mode 100644
index c1bbadd64f59b..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/sizeof-expression.md
+++ /dev/null
@@ -1,312 +0,0 @@
-```{title} clang-tidy - bugprone-sizeof-expression
-```
-
-# bugprone-sizeof-expression
-
-The check finds usages of `sizeof` expressions which are most likely errors.
-
-The `sizeof` operator yields the size (in bytes) of its operand, which may be
-an expression or the parenthesized name of a type. Misuse of this operator may
-be leading to errors and possible software vulnerabilities.
-
-## Suspicious usage of 'sizeof(K)'
-
-A common mistake is to query the `sizeof` of an integer literal. This is
-equivalent to query the size of its type (probably `int`). The intent of the
-programmer was probably to simply get the integer and not its size.
-
-```c++
-#define BUFLEN 42
-char buf[BUFLEN];
-memset(buf, 0, sizeof(BUFLEN)); // sizeof(42) ==> sizeof(int)
-```
-
-## Suspicious usage of 'sizeof(expr)'
-
-In cases, where there is an enum or integer to represent a type, a common
-mistake is to query the `sizeof` on the integer or enum that represents the
-type that should be used by `sizeof`. This results in the size of the integer
-and not of the type the integer represents:
-
-```c++
-enum data_type {
- FLOAT_TYPE,
- DOUBLE_TYPE
-};
-
-struct data {
- data_type type;
- void* buffer;
- data_type get_type() {
- return type;
- }
-};
-
-void f(data d, int numElements) {
- // should be sizeof(float) or sizeof(double), depending on d.get_type()
- int numBytes = numElements * sizeof(d.get_type());
- ...
-}
-```
-
-## Suspicious usage of 'sizeof(this)'
-
-The `this` keyword is evaluated to a pointer to an object of a given type.
-The expression `sizeof(this)` is returning the size of a pointer. The
-programmer most likely wanted the size of the object and not the size of the
-pointer.
-
-```c++
-class Point {
- [...]
- size_t size() { return sizeof(this); } // should probably be sizeof(*this)
- [...]
-};
-```
-
-## Suspicious usage of 'sizeof(char\*)'
-
-There is a subtle difference between declaring a string literal with
-`char* A = ""` and `char A[] = ""`. The first case has the type `char*`
-instead of the aggregate type `char[]`. Using `sizeof` on an object
-declared with `char*` type is returning the size of a pointer instead of
-the number of characters (bytes) in the string literal.
-
-```c++
-const char* kMessage = "Hello World!"; // const char kMessage[] = "...";
-void getMessage(char* buf) {
- memcpy(buf, kMessage, sizeof(kMessage)); // sizeof(char*)
-}
-```
-
-## Suspicious usage of 'sizeof(A\*)'
-
-A common mistake is to compute the size of a pointer instead of its pointee.
-These cases may occur because of explicit cast or implicit conversion.
-
-```c++
-int A[10];
-memset(A, 0, sizeof(A + 0));
-
-struct Point point;
-memset(point, 0, sizeof(&point));
-```
-
-## Suspicious usage of 'sizeof(...)/sizeof(...)'
-
-Dividing `sizeof` expressions is typically used to retrieve the number of
-elements of an aggregate. This check warns on incompatible or suspicious cases.
-
-In the following example, the entity has 10-bytes and is incompatible with the
-type `int` which has 4 bytes.
-
-```c++
-char buf[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; // sizeof(buf) => 10
-void getMessage(char* dst) {
- memcpy(dst, buf, sizeof(buf) / sizeof(int)); // sizeof(int) => 4 [incompatible sizes]
-}
-```
-
-In the following example, the expression `sizeof(Values)` is returning the
-size of `char*`. One can easily be fooled by its declaration, but in parameter
-declaration the size '10' is ignored and the function is receiving a `char*`.
-
-```c++
-char OrderedValues[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
-return CompareArray(char Values[10]) {
- return memcmp(OrderedValues, Values, sizeof(Values)) == 0; // sizeof(Values) ==> sizeof(char*) [implicit cast to char*]
-}
-```
-
-## Suspicious 'sizeof' by 'sizeof' expression
-
-Multiplying `sizeof` expressions typically makes no sense and is probably a
-logic error. In the following example, the programmer used `*` instead of
-`/`.
-
-```c++
-const char kMessage[] = "Hello World!";
-void getMessage(char* buf) {
- memcpy(buf, kMessage, sizeof(kMessage) * sizeof(char)); // sizeof(kMessage) / sizeof(char)
-}
-```
-
-This check may trigger on code using the arraysize macro. The following code is
-working correctly but should be simplified by using only the `sizeof`
-operator.
-
-```c++
-extern Object objects[100];
-void InitializeObjects() {
- memset(objects, 0, arraysize(objects) * sizeof(Object)); // sizeof(objects)
-}
-```
-
-## Suspicious usage of 'sizeof(sizeof(...))'
-
-Getting the `sizeof` of a `sizeof` makes no sense and is typically an error
-hidden through macros.
-
-```c++
-#define INT_SZ sizeof(int)
-int buf[] = { 42 };
-void getInt(int* dst) {
- memcpy(dst, buf, sizeof(INT_SZ)); // sizeof(sizeof(int)) is suspicious.
-}
-```
-
-## Suspicious usages of 'sizeof(...)' in pointer arithmetic
-
-Arithmetic operators on pointers automatically scale the result with the size
-of the pointed typed.
-Further use of `sizeof` around pointer arithmetic will typically result in an
-unintended result.
-
-### Scaling the result of pointer difference
-
-Subtracting two pointers results in an integer expression (of type
-`ptrdiff_t`) which expresses the distance between the two pointed objects in
-"number of objects between".
-A common mistake is to think that the result is "number of bytes between", and
-scale the difference with `sizeof`, such as `P1 - P2 == N * sizeof(T)`
-(instead of `P1 - P2 == N`) or `(P1 - P2) / sizeof(T)` instead of
-`P1 - P2`.
-
-```c++
-void splitFour(const Obj* Objs, size_t N, Obj Delimiter) {
- const Obj *P = Objs;
- while (P < Objs + N) {
- if (*P == Delimiter) {
- break;
- }
- }
-
- if (P - Objs != 4 * sizeof(Obj)) { // Expecting a distance multiplied by sizeof is suspicious.
- error();
- }
-}
-```
-
-```c++
-void iterateIfEvenLength(int *Begin, int *End) {
- auto N = (Begin - End) / sizeof(int); // Dividing by sizeof() is suspicious.
- if (N % 2)
- return;
-
- // ...
-}
-```
-
-### Stepping a pointer with a scaled integer
-
-Conversely, when performing pointer arithmetics to add or subtract from a
-pointer, the arithmetic operator implicitly scales the value actually added to
-the pointer with the size of the pointee, as `Ptr + N` expects `N` to be
-"number of objects to step", and not "number of bytes to step".
-
-Seeing the calculation of a pointer where `sizeof` appears is suspicious,
-and the result is typically unintended, often out of bounds.
-`Ptr + sizeof(T)` will offset the pointer by `sizeof(T)` elements,
-effectively exponentiating the scaling factor to the power of 2.
-
-Similarly, multiplying or dividing a numeric value with the `sizeof` of an
-element or the whole buffer is suspicious, because the dimensional connection
-between the numeric value and the actual `sizeof` result can not always be
-deduced.
-While scaling an integer up (multiplying) with `sizeof` is likely **always**
-an issue, a scaling down (division) is not always inherently dangerous, in case
-the developer is aware that the division happens between an appropriate number
-of \_bytes\_ and a `sizeof` value.
-Turning {option}`WarnOnOffsetDividedBySizeOf` off will restrict the
-warnings to the multiplication case.
-
-This case also checks suspicious `alignof` and `offsetof` usages in
-pointer arithmetic, as both return the "size" in bytes and not elements,
-potentially resulting in doubly-scaled offsets.
-
-```c++
-void printEveryEvenIndexElement(int *Array, size_t N) {
- int *P = Array;
- while (P <= Array + N * sizeof(int)) { // Suspicious pointer arithmetic using sizeof()!
- printf("%d ", *P);
-
- P += 2 * sizeof(int); // Suspicious pointer arithmetic using sizeof()!
- }
-}
-```
-
-```c++
-struct Message { /* ... */; char Flags[8]; };
-void clearFlags(Message *Array, size_t N) {
- const Message *End = Array + N;
- while (Array < End) {
- memset(Array + offsetof(Message, Flags), // Suspicious pointer arithmetic using offsetof()!
- 0, sizeof(Message::Flags));
- ++Array;
- }
-}
-```
-
-For this checked bogus pattern, `cert-arr39-c` redirects here as an alias of
-this check.
-
-This check corresponds to the CERT C Coding Standard rule
-[ARR39-C. Do not add or subtract a scaled integer to a pointer](https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/arrays-arr/arr39-c/).
-
-## Limitations
-
-Cases where the pointee type has a size of `1` byte (such as, and most
-importantly, `char`) are excluded.
-
-## Options
-
-```{option} WarnOnSizeOfConstant
-When `true`, the check will warn on an expression like
-`sizeof(CONSTANT)`. Default is `true`.
-```
-
-```{option} WarnOnSizeOfIntegerExpression
-When `true`, the check will warn on an expression like `sizeof(expr)`
-where the expression results in an integer. Default is `false`.
-```
-
-```{option} WarnOnSizeOfThis
-When `true`, the check will warn on an expression like `sizeof(this)`.
-Default is `true`.
-```
-
-```{option} WarnOnSizeOfCompareToConstant
-When `true`, the check will warn on an expression like
-`sizeof(expr) <= k` for a suspicious constant `k` while `k` is `0` or
-greater than `0x8000`. Default is `true`.
-```
-
-```{option} WarnOnSizeOfPointerToAggregate
-When `true`, the check will warn when the argument of `sizeof` is either a
-pointer-to-aggregate type, an expression returning a pointer-to-aggregate
-value or an expression that returns a pointer from an array-to-pointer
-conversion (that may be implicit or explicit, for example `array + 2` or
-`(int *)array`). Default is `true`.
-```
-
-```{option} WarnOnSizeOfPointer
-When `true`, the check will report all expressions where the argument of
-`sizeof` is an expression that produces a pointer (except for a few
-idiomatic expressions that are probably intentional and correct).
-This detects occurrences of CWE 467. Default is `false`.
-```
-
-```{option} WarnOnOffsetDividedBySizeOf
-When `true`, the check will warn on pointer arithmetic where the
-element count is obtained from a division with `sizeof(...)`,
-e.g., `Ptr + Bytes / sizeof(*T)`. Default is `true`.
-```
-
-```{option} WarnOnSizeOfInLoopTermination
-When `true`, the check will warn about incorrect use of sizeof expression
-in loop termination condition. The warning triggers if the `sizeof`
-expression appears to be incorrectly used to determine the number of
-array/buffer elements.
-e.g, `long arr[10]; for(int i = 0; i < sizeof(arr); i++) { ... }`. Default
-is `true`.
-```
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/sizeof-expression.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/sizeof-expression.rst
new file mode 100644
index 0000000000000..4ed7cdc8cab4b
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/sizeof-expression.rst
@@ -0,0 +1,328 @@
+.. title:: clang-tidy - bugprone-sizeof-expression
+
+bugprone-sizeof-expression
+==========================
+
+The check finds usages of ``sizeof`` expressions which are most likely errors.
+
+The ``sizeof`` operator yields the size (in bytes) of its operand, which may be
+an expression or the parenthesized name of a type. Misuse of this operator may
+be leading to errors and possible software vulnerabilities.
+
+Suspicious usage of 'sizeof(K)'
+-------------------------------
+
+A common mistake is to query the ``sizeof`` of an integer literal. This is
+equivalent to query the size of its type (probably ``int``). The intent of the
+programmer was probably to simply get the integer and not its size.
+
+.. code-block:: c++
+
+ #define BUFLEN 42
+ char buf[BUFLEN];
+ memset(buf, 0, sizeof(BUFLEN)); // sizeof(42) ==> sizeof(int)
+
+Suspicious usage of 'sizeof(expr)'
+----------------------------------
+
+In cases, where there is an enum or integer to represent a type, a common
+mistake is to query the ``sizeof`` on the integer or enum that represents the
+type that should be used by ``sizeof``. This results in the size of the integer
+and not of the type the integer represents:
+
+.. code-block:: c++
+
+ enum data_type {
+ FLOAT_TYPE,
+ DOUBLE_TYPE
+ };
+
+ struct data {
+ data_type type;
+ void* buffer;
+ data_type get_type() {
+ return type;
+ }
+ };
+
+ void f(data d, int numElements) {
+ // should be sizeof(float) or sizeof(double), depending on d.get_type()
+ int numBytes = numElements * sizeof(d.get_type());
+ ...
+ }
+
+
+Suspicious usage of 'sizeof(this)'
+----------------------------------
+
+The ``this`` keyword is evaluated to a pointer to an object of a given type.
+The expression ``sizeof(this)`` is returning the size of a pointer. The
+programmer most likely wanted the size of the object and not the size of the
+pointer.
+
+.. code-block:: c++
+
+ class Point {
+ [...]
+ size_t size() { return sizeof(this); } // should probably be sizeof(*this)
+ [...]
+ };
+
+Suspicious usage of 'sizeof(char*)'
+-----------------------------------
+
+There is a subtle difference between declaring a string literal with
+``char* A = ""`` and ``char A[] = ""``. The first case has the type ``char*``
+instead of the aggregate type ``char[]``. Using ``sizeof`` on an object
+declared with ``char*`` type is returning the size of a pointer instead of
+the number of characters (bytes) in the string literal.
+
+.. code-block:: c++
+
+ const char* kMessage = "Hello World!"; // const char kMessage[] = "...";
+ void getMessage(char* buf) {
+ memcpy(buf, kMessage, sizeof(kMessage)); // sizeof(char*)
+ }
+
+Suspicious usage of 'sizeof(A*)'
+--------------------------------
+
+A common mistake is to compute the size of a pointer instead of its pointee.
+These cases may occur because of explicit cast or implicit conversion.
+
+.. code-block:: c++
+
+ int A[10];
+ memset(A, 0, sizeof(A + 0));
+
+ struct Point point;
+ memset(point, 0, sizeof(&point));
+
+Suspicious usage of 'sizeof(...)/sizeof(...)'
+---------------------------------------------
+
+Dividing ``sizeof`` expressions is typically used to retrieve the number of
+elements of an aggregate. This check warns on incompatible or suspicious cases.
+
+In the following example, the entity has 10-bytes and is incompatible with the
+type ``int`` which has 4 bytes.
+
+.. code-block:: c++
+
+ char buf[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; // sizeof(buf) => 10
+ void getMessage(char* dst) {
+ memcpy(dst, buf, sizeof(buf) / sizeof(int)); // sizeof(int) => 4 [incompatible sizes]
+ }
+
+In the following example, the expression ``sizeof(Values)`` is returning the
+size of ``char*``. One can easily be fooled by its declaration, but in parameter
+declaration the size '10' is ignored and the function is receiving a ``char*``.
+
+.. code-block:: c++
+
+ char OrderedValues[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ return CompareArray(char Values[10]) {
+ return memcmp(OrderedValues, Values, sizeof(Values)) == 0; // sizeof(Values) ==> sizeof(char*) [implicit cast to char*]
+ }
+
+Suspicious 'sizeof' by 'sizeof' expression
+------------------------------------------
+
+Multiplying ``sizeof`` expressions typically makes no sense and is probably a
+logic error. In the following example, the programmer used ``*`` instead of
+``/``.
+
+.. code-block:: c++
+
+ const char kMessage[] = "Hello World!";
+ void getMessage(char* buf) {
+ memcpy(buf, kMessage, sizeof(kMessage) * sizeof(char)); // sizeof(kMessage) / sizeof(char)
+ }
+
+This check may trigger on code using the arraysize macro. The following code is
+working correctly but should be simplified by using only the ``sizeof``
+operator.
+
+.. code-block:: c++
+
+ extern Object objects[100];
+ void InitializeObjects() {
+ memset(objects, 0, arraysize(objects) * sizeof(Object)); // sizeof(objects)
+ }
+
+Suspicious usage of 'sizeof(sizeof(...))'
+-----------------------------------------
+
+Getting the ``sizeof`` of a ``sizeof`` makes no sense and is typically an error
+hidden through macros.
+
+.. code-block:: c++
+
+ #define INT_SZ sizeof(int)
+ int buf[] = { 42 };
+ void getInt(int* dst) {
+ memcpy(dst, buf, sizeof(INT_SZ)); // sizeof(sizeof(int)) is suspicious.
+ }
+
+Suspicious usages of 'sizeof(...)' in pointer arithmetic
+--------------------------------------------------------
+
+Arithmetic operators on pointers automatically scale the result with the size
+of the pointed typed.
+Further use of ``sizeof`` around pointer arithmetic will typically result in an
+unintended result.
+
+Scaling the result of pointer difference
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Subtracting two pointers results in an integer expression (of type
+``ptrdiff_t``) which expresses the distance between the two pointed objects in
+"number of objects between".
+A common mistake is to think that the result is "number of bytes between", and
+scale the difference with ``sizeof``, such as ``P1 - P2 == N * sizeof(T)``
+(instead of ``P1 - P2 == N``) or ``(P1 - P2) / sizeof(T)`` instead of
+``P1 - P2``.
+
+.. code-block:: c++
+
+ void splitFour(const Obj* Objs, size_t N, Obj Delimiter) {
+ const Obj *P = Objs;
+ while (P < Objs + N) {
+ if (*P == Delimiter) {
+ break;
+ }
+ }
+
+ if (P - Objs != 4 * sizeof(Obj)) { // Expecting a distance multiplied by sizeof is suspicious.
+ error();
+ }
+ }
+
+.. code-block:: c++
+
+ void iterateIfEvenLength(int *Begin, int *End) {
+ auto N = (Begin - End) / sizeof(int); // Dividing by sizeof() is suspicious.
+ if (N % 2)
+ return;
+
+ // ...
+ }
+
+Stepping a pointer with a scaled integer
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Conversely, when performing pointer arithmetics to add or subtract from a
+pointer, the arithmetic operator implicitly scales the value actually added to
+the pointer with the size of the pointee, as ``Ptr + N`` expects ``N`` to be
+"number of objects to step", and not "number of bytes to step".
+
+Seeing the calculation of a pointer where ``sizeof`` appears is suspicious,
+and the result is typically unintended, often out of bounds.
+``Ptr + sizeof(T)`` will offset the pointer by ``sizeof(T)`` elements,
+effectively exponentiating the scaling factor to the power of 2.
+
+Similarly, multiplying or dividing a numeric value with the ``sizeof`` of an
+element or the whole buffer is suspicious, because the dimensional connection
+between the numeric value and the actual ``sizeof`` result can not always be
+deduced.
+While scaling an integer up (multiplying) with ``sizeof`` is likely **always**
+an issue, a scaling down (division) is not always inherently dangerous, in case
+the developer is aware that the division happens between an appropriate number
+of _bytes_ and a ``sizeof`` value.
+Turning :option:`WarnOnOffsetDividedBySizeOf` off will restrict the
+warnings to the multiplication case.
+
+This case also checks suspicious ``alignof`` and ``offsetof`` usages in
+pointer arithmetic, as both return the "size" in bytes and not elements,
+potentially resulting in doubly-scaled offsets.
+
+.. code-block:: c++
+
+ void printEveryEvenIndexElement(int *Array, size_t N) {
+ int *P = Array;
+ while (P <= Array + N * sizeof(int)) { // Suspicious pointer arithmetic using sizeof()!
+ printf("%d ", *P);
+
+ P += 2 * sizeof(int); // Suspicious pointer arithmetic using sizeof()!
+ }
+ }
+
+.. code-block:: c++
+
+ struct Message { /* ... */; char Flags[8]; };
+ void clearFlags(Message *Array, size_t N) {
+ const Message *End = Array + N;
+ while (Array < End) {
+ memset(Array + offsetof(Message, Flags), // Suspicious pointer arithmetic using offsetof()!
+ 0, sizeof(Message::Flags));
+ ++Array;
+ }
+ }
+
+For this checked bogus pattern, `cert-arr39-c` redirects here as an alias of
+this check.
+
+This check corresponds to the CERT C Coding Standard rule
+`ARR39-C. Do not add or subtract a scaled integer to a pointer
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/arrays-arr/arr39-c/>`_.
+
+
+Limitations
+-----------
+
+Cases where the pointee type has a size of `1` byte (such as, and most
+importantly, ``char``) are excluded.
+
+Options
+-------
+
+.. option:: WarnOnSizeOfConstant
+
+ When `true`, the check will warn on an expression like
+ ``sizeof(CONSTANT)``. Default is `true`.
+
+.. option:: WarnOnSizeOfIntegerExpression
+
+ When `true`, the check will warn on an expression like ``sizeof(expr)``
+ where the expression results in an integer. Default is `false`.
+
+.. option:: WarnOnSizeOfThis
+
+ When `true`, the check will warn on an expression like ``sizeof(this)``.
+ Default is `true`.
+
+.. option:: WarnOnSizeOfCompareToConstant
+
+ When `true`, the check will warn on an expression like
+ ``sizeof(expr) <= k`` for a suspicious constant `k` while `k` is `0` or
+ greater than `0x8000`. Default is `true`.
+
+.. option:: WarnOnSizeOfPointerToAggregate
+
+ When `true`, the check will warn when the argument of ``sizeof`` is either a
+ pointer-to-aggregate type, an expression returning a pointer-to-aggregate
+ value or an expression that returns a pointer from an array-to-pointer
+ conversion (that may be implicit or explicit, for example ``array + 2`` or
+ ``(int *)array``). Default is `true`.
+
+.. option:: WarnOnSizeOfPointer
+
+ When `true`, the check will report all expressions where the argument of
+ ``sizeof`` is an expression that produces a pointer (except for a few
+ idiomatic expressions that are probably intentional and correct).
+ This detects occurrences of CWE 467. Default is `false`.
+
+.. option:: WarnOnOffsetDividedBySizeOf
+
+ When `true`, the check will warn on pointer arithmetic where the
+ element count is obtained from a division with ``sizeof(...)``,
+ e.g., ``Ptr + Bytes / sizeof(*T)``. Default is `true`.
+
+.. option:: WarnOnSizeOfInLoopTermination
+
+ When `true`, the check will warn about incorrect use of sizeof expression
+ in loop termination condition. The warning triggers if the ``sizeof``
+ expression appears to be incorrectly used to determine the number of
+ array/buffer elements.
+ e.g, ``long arr[10]; for(int i = 0; i < sizeof(arr); i++) { ... }``. Default
+ is `true`.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/standalone-empty.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/standalone-empty.md
deleted file mode 100644
index 4f1b4c2de0a6e..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/standalone-empty.md
+++ /dev/null
@@ -1,37 +0,0 @@
-```{title} clang-tidy - bugprone-standalone-empty
-```
-
-# bugprone-standalone-empty
-
-Warns when `empty()` is used on a range and the result is ignored. Suggests
-`clear()` if it is an existing member function.
-
-The `empty()` method on several common ranges returns a Boolean indicating
-whether or not the range is empty, but is often mistakenly interpreted as
-a way to clear the contents of a range. Some ranges offer a `clear()`
-method for this purpose. This check warns when a call to empty returns a
-result that is ignored, and suggests replacing it with a call to `clear()`
-if it is available as a member function of the range.
-
-For example, the following code could be used to indicate whether a range
-is empty or not, but the result is ignored:
-
-```c++
-std::vector<int> v;
-...
-v.empty();
-```
-
-A call to `clear()` would appropriately clear the contents of the range:
-
-```c++
-std::vector<int> v;
-...
-v.clear();
-```
-
-## Limitations
-
-- Doesn't warn if `empty()` is defined and used with the ignore result in the
- class template definition (for example in the library implementation). These
- error cases can be caught with `[[nodiscard]]` attribute.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/standalone-empty.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/standalone-empty.rst
new file mode 100644
index 0000000000000..8fdf2fcc6821f
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/standalone-empty.rst
@@ -0,0 +1,39 @@
+.. title:: clang-tidy - bugprone-standalone-empty
+
+bugprone-standalone-empty
+=========================
+
+Warns when ``empty()`` is used on a range and the result is ignored. Suggests
+``clear()`` if it is an existing member function.
+
+The ``empty()`` method on several common ranges returns a Boolean indicating
+whether or not the range is empty, but is often mistakenly interpreted as
+a way to clear the contents of a range. Some ranges offer a ``clear()``
+method for this purpose. This check warns when a call to empty returns a
+result that is ignored, and suggests replacing it with a call to ``clear()``
+if it is available as a member function of the range.
+
+For example, the following code could be used to indicate whether a range
+is empty or not, but the result is ignored:
+
+.. code-block:: c++
+
+ std::vector<int> v;
+ ...
+ v.empty();
+
+A call to ``clear()`` would appropriately clear the contents of the range:
+
+.. code-block:: c++
+
+ std::vector<int> v;
+ ...
+ v.clear();
+
+
+Limitations
+-----------
+
+* Doesn't warn if ``empty()`` is defined and used with the ignore result in the
+ class template definition (for example in the library implementation). These
+ error cases can be caught with ``[[nodiscard]]`` attribute.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/std-exception-baseclass.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/std-exception-baseclass.md
deleted file mode 100644
index 51401ab4d9f98..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/std-exception-baseclass.md
+++ /dev/null
@@ -1,32 +0,0 @@
-```{title} clang-tidy - bugprone-std-exception-baseclass
-```
-
-# bugprone-std-exception-baseclass
-
-Ensure that every value that in a `throw` expression is an instance of
-`std::exception`.
-
-Deriving all exceptions from `std::exception` allows callers to catch
-all exceptions with a single catch block and provides access to the
-`what()` method for diagnostics. Throwing arbitrary types creates
-hidden contracts, reduces interoperability with the standard library,
-and may result in program termination.
-
-```c++
-class custom_exception {};
-
-void throwing() noexcept(false) {
- // Problematic throw expressions.
- throw int(42);
- throw custom_exception();
-}
-
-class mathematical_error : public std::exception {};
-
-void throwing2() noexcept(false) {
- // These kind of throws are ok.
- throw mathematical_error();
- throw std::runtime_error();
- throw std::exception();
-}
-```
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/std-exception-baseclass.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/std-exception-baseclass.rst
new file mode 100644
index 0000000000000..41b14537eb36f
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/std-exception-baseclass.rst
@@ -0,0 +1,32 @@
+.. title:: clang-tidy - bugprone-std-exception-baseclass
+
+bugprone-std-exception-baseclass
+================================
+
+Ensure that every value that in a ``throw`` expression is an instance of
+``std::exception``.
+
+Deriving all exceptions from ``std::exception`` allows callers to catch
+all exceptions with a single catch block and provides access to the
+``what()`` method for diagnostics. Throwing arbitrary types creates
+hidden contracts, reduces interoperability with the standard library,
+and may result in program termination.
+
+.. code-block:: c++
+
+ class custom_exception {};
+
+ void throwing() noexcept(false) {
+ // Problematic throw expressions.
+ throw int(42);
+ throw custom_exception();
+ }
+
+ class mathematical_error : public std::exception {};
+
+ void throwing2() noexcept(false) {
+ // These kind of throws are ok.
+ throw mathematical_error();
+ throw std::runtime_error();
+ throw std::exception();
+ }
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/std-namespace-modification.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/std-namespace-modification.md
deleted file mode 100644
index 92d429594e734..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/std-namespace-modification.md
+++ /dev/null
@@ -1,66 +0,0 @@
-```{title} clang-tidy - bugprone-std-namespace-modification
-```
-
-# bugprone-std-namespace-modification
-
-Warns on modifications of the `std` or `posix` namespaces which can
-result in undefined behavior.
-
-The `std` (or `posix`) namespace is allowed to be extended with (class or
-function) template specializations that depend on an user-defined type (a type
-that is not defined in the standard system headers).
-
-The check detects the following (user provided) declarations in namespace
-`std` or `posix`:
-
-- Anything that is not a template specialization.
-- Explicit specializations of any standard library function template or class
- template, if it does not have any user-defined type as template argument.
-- Explicit specializations of any member function of a standard library class
- template.
-- Explicit specializations of any member function template of a standard
- library class or class template.
-- Explicit or partial specialization of any member class template of a standard
- library class or class template.
-
-Examples:
-
-```c++
-namespace std {
- int x; // warning: modification of 'std' namespace can result in undefined behavior [bugprone-dont-modify-std-namespace]
-}
-
-namespace posix::a { // warning: modification of 'posix' namespace can result in undefined behavior
-}
-
-template <>
-struct ::std::hash<long> { // warning: modification of 'std' namespace can result in undefined behavior
- unsigned long operator()(const long &K) const {
- return K;
- }
-};
-
-struct MyData { long data; };
-
-template <>
-struct ::std::hash<MyData> { // no warning: specialization with user-defined type
- unsigned long operator()(const MyData &K) const {
- return K.data;
- }
-};
-
-namespace std {
- template <>
- void swap<bool>(bool &a, bool &b); // warning: modification of 'std' namespace can result in undefined behavior
-
- template <>
- bool less<void>::operator()<MyData &&, MyData &&>(MyData &&, MyData &&) const { // warning: modification of 'std' namespace can result in undefined behavior
- return true;
- }
-}
-```
-
-## References
-
-This check corresponds to the CERT C++ Coding Standard rule
-[DCL58-CPP. Do not modify the standard namespaces](https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/declarations-and-initialization-dcl/dcl58-cpp/).
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/std-namespace-modification.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/std-namespace-modification.rst
new file mode 100644
index 0000000000000..29e128e3b1f20
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/std-namespace-modification.rst
@@ -0,0 +1,68 @@
+.. title:: clang-tidy - bugprone-std-namespace-modification
+
+bugprone-std-namespace-modification
+===================================
+
+Warns on modifications of the ``std`` or ``posix`` namespaces which can
+result in undefined behavior.
+
+The ``std`` (or ``posix``) namespace is allowed to be extended with (class or
+function) template specializations that depend on an user-defined type (a type
+that is not defined in the standard system headers).
+
+The check detects the following (user provided) declarations in namespace
+``std`` or ``posix``:
+
+- Anything that is not a template specialization.
+- Explicit specializations of any standard library function template or class
+ template, if it does not have any user-defined type as template argument.
+- Explicit specializations of any member function of a standard library class
+ template.
+- Explicit specializations of any member function template of a standard
+ library class or class template.
+- Explicit or partial specialization of any member class template of a standard
+ library class or class template.
+
+Examples:
+
+.. code-block:: c++
+
+ namespace std {
+ int x; // warning: modification of 'std' namespace can result in undefined behavior [bugprone-dont-modify-std-namespace]
+ }
+
+ namespace posix::a { // warning: modification of 'posix' namespace can result in undefined behavior
+ }
+
+ template <>
+ struct ::std::hash<long> { // warning: modification of 'std' namespace can result in undefined behavior
+ unsigned long operator()(const long &K) const {
+ return K;
+ }
+ };
+
+ struct MyData { long data; };
+
+ template <>
+ struct ::std::hash<MyData> { // no warning: specialization with user-defined type
+ unsigned long operator()(const MyData &K) const {
+ return K.data;
+ }
+ };
+
+ namespace std {
+ template <>
+ void swap<bool>(bool &a, bool &b); // warning: modification of 'std' namespace can result in undefined behavior
+
+ template <>
+ bool less<void>::operator()<MyData &&, MyData &&>(MyData &&, MyData &&) const { // warning: modification of 'std' namespace can result in undefined behavior
+ return true;
+ }
+ }
+
+References
+----------
+
+This check corresponds to the CERT C++ Coding Standard rule
+`DCL58-CPP. Do not modify the standard namespaces
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/declarations-and-initialization-dcl/dcl58-cpp/>`_.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-constructor.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-constructor.md
deleted file mode 100644
index b894f0a2a8dc5..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-constructor.md
+++ /dev/null
@@ -1,65 +0,0 @@
-```{title} clang-tidy - bugprone-string-constructor
-```
-
-# bugprone-string-constructor
-
-Finds string constructors that are suspicious and probably errors.
-
-A common mistake is to swap parameters to the 'fill' string-constructor.
-
-Examples:
-
-```c++
-std::string str('x', 50); // should be str(50, 'x')
-```
-
-Calling the string-literal constructor with a length bigger than the literal is
-suspicious and adds extra random characters to the string.
-
-Examples:
-
-```c++
-std::string("test", 200); // Will include random characters after "test".
-std::string("test", 2, 5); // Will include random characters after "st".
-std::string_view("test", 200);
-```
-
-Creating an empty string from constructors with parameters is considered
-suspicious. The programmer should use the empty constructor instead.
-
-Examples:
-
-```c++
-std::string("test", 0); // Creation of an empty string.
-std::string("test", 1, 0);
-std::string_view("test", 0);
-```
-
-Passing an invalid first character position parameter to constructor will
-cause `std::out_of_range` exception at runtime.
-
-Examples:
-
-```c++
-std::string("test", -1, 10); // Negative first character position.
-std::string("test", 10, 10); // First character position is bigger than string literal character range".
-```
-
-## Options
-
-```{option} WarnOnLargeLength
-When `true`, the check will warn on a string with a length greater than
-{option}`LargeLengthThreshold`. Default is `true`.
-```
-
-```{option} LargeLengthThreshold
-An integer specifying the large length threshold. Default is `0x800000`.
-```
-
-```{option} StringNames
-Semicolon-delimited list of class names to apply this check to.
-By default `::std::basic_string` applies to `std::string` and
-`std::wstring`. Set to e.g. `::std::basic_string;llvm::StringRef;QString`
-to perform this check on custom classes.
-Default is `::std::basic_string;::std::basic_string_view`.
-```
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-constructor.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-constructor.rst
new file mode 100644
index 0000000000000..ad4ed895bf012
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-constructor.rst
@@ -0,0 +1,67 @@
+.. title:: clang-tidy - bugprone-string-constructor
+
+bugprone-string-constructor
+===========================
+
+Finds string constructors that are suspicious and probably errors.
+
+A common mistake is to swap parameters to the 'fill' string-constructor.
+
+Examples:
+
+.. code-block:: c++
+
+ std::string str('x', 50); // should be str(50, 'x')
+
+Calling the string-literal constructor with a length bigger than the literal is
+suspicious and adds extra random characters to the string.
+
+Examples:
+
+.. code-block:: c++
+
+ std::string("test", 200); // Will include random characters after "test".
+ std::string("test", 2, 5); // Will include random characters after "st".
+ std::string_view("test", 200);
+
+Creating an empty string from constructors with parameters is considered
+suspicious. The programmer should use the empty constructor instead.
+
+Examples:
+
+.. code-block:: c++
+
+ std::string("test", 0); // Creation of an empty string.
+ std::string("test", 1, 0);
+ std::string_view("test", 0);
+
+Passing an invalid first character position parameter to constructor will
+cause ``std::out_of_range`` exception at runtime.
+
+Examples:
+
+.. code-block:: c++
+
+ std::string("test", -1, 10); // Negative first character position.
+ std::string("test", 10, 10); // First character position is bigger than string literal character range".
+
+Options
+-------
+
+.. option:: WarnOnLargeLength
+
+ When `true`, the check will warn on a string with a length greater than
+ :option:`LargeLengthThreshold`. Default is `true`.
+
+.. option:: LargeLengthThreshold
+
+ An integer specifying the large length threshold. Default is `0x800000`.
+
+.. option:: StringNames
+
+ Default is `::std::basic_string;::std::basic_string_view`.
+
+ Semicolon-delimited list of class names to apply this check to.
+ By default `::std::basic_string` applies to ``std::string`` and
+ ``std::wstring``. Set to e.g. `::std::basic_string;llvm::StringRef;QString`
+ to perform this check on custom classes.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-integer-assignment.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-integer-assignment.md
deleted file mode 100644
index a225593aaf530..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-integer-assignment.md
+++ /dev/null
@@ -1,37 +0,0 @@
-```{title} clang-tidy - bugprone-string-integer-assignment
-```
-
-# bugprone-string-integer-assignment
-
-The check finds assignments of an integer to `std::basic_string<CharT>`
-(`std::string`, `std::wstring`, etc.). The source of the problem is the
-following assignment operator of `std::basic_string<CharT>`:
-
-```c++
-basic_string& operator=( CharT ch );
-```
-
-Numeric types can be implicitly casted to character types.
-
-```c++
-std::string s;
-int x = 5965;
-s = 6;
-s = x;
-```
-
-Use the appropriate conversion functions or character literals.
-
-```c++
-std::string s;
-int x = 5965;
-s = '6';
-s = std::to_string(x);
-```
-
-In order to suppress false positives, use an explicit cast.
-
-```c++
-std::string s;
-s = static_cast<char>(6);
-```
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-integer-assignment.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-integer-assignment.rst
new file mode 100644
index 0000000000000..6401f008d2e0a
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-integer-assignment.rst
@@ -0,0 +1,37 @@
+.. title:: clang-tidy - bugprone-string-integer-assignment
+
+bugprone-string-integer-assignment
+==================================
+
+The check finds assignments of an integer to ``std::basic_string<CharT>``
+(``std::string``, ``std::wstring``, etc.). The source of the problem is the
+following assignment operator of ``std::basic_string<CharT>``:
+
+.. code-block:: c++
+
+ basic_string& operator=( CharT ch );
+
+Numeric types can be implicitly casted to character types.
+
+.. code-block:: c++
+
+ std::string s;
+ int x = 5965;
+ s = 6;
+ s = x;
+
+Use the appropriate conversion functions or character literals.
+
+.. code-block:: c++
+
+ std::string s;
+ int x = 5965;
+ s = '6';
+ s = std::to_string(x);
+
+In order to suppress false positives, use an explicit cast.
+
+.. code-block:: c++
+
+ std::string s;
+ s = static_cast<char>(6);
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-literal-with-embedded-nul.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-literal-with-embedded-nul.md
deleted file mode 100644
index d9536d22bd0a6..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-literal-with-embedded-nul.md
+++ /dev/null
@@ -1,34 +0,0 @@
-```{title} clang-tidy - bugprone-string-literal-with-embedded-nul
-```
-
-# bugprone-string-literal-with-embedded-nul
-
-Finds occurrences of string literal with embedded NUL character and validates
-their usage.
-
-## Invalid escaping
-
-Special characters can be escaped within a string literal by using their
-hexadecimal encoding like `\x42`. A common mistake is to escape them
-like this `\0x42` where the `\0` stands for the NUL character.
-
-```c++
-const char* Example[] = "Invalid character: \0x12 should be \x12";
-const char* Bytes[] = "\x03\0x02\0x01\0x00\0xFF\0xFF\0xFF";
-```
-
-## Truncated literal
-
-String-like classes can manipulate strings with embedded NUL as they are
-keeping track of the bytes and the length. This is not the case for a
-`char*` (NUL-terminated) string.
-
-A common mistake is to pass a string-literal with embedded NUL to a string
-constructor expecting a NUL-terminated string. The bytes after the first NUL
-character are truncated.
-
-```c++
-std::string str("abc\0def"); // "def" is truncated
-str += "\0"; // This statement is doing nothing
-if (str == "\0abc") return; // This expression is always true
-```
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-literal-with-embedded-nul.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-literal-with-embedded-nul.rst
new file mode 100644
index 0000000000000..bc5f2ce2cc885
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/string-literal-with-embedded-nul.rst
@@ -0,0 +1,36 @@
+.. title:: clang-tidy - bugprone-string-literal-with-embedded-nul
+
+bugprone-string-literal-with-embedded-nul
+=========================================
+
+Finds occurrences of string literal with embedded NUL character and validates
+their usage.
+
+Invalid escaping
+----------------
+
+Special characters can be escaped within a string literal by using their
+hexadecimal encoding like ``\x42``. A common mistake is to escape them
+like this ``\0x42`` where the ``\0`` stands for the NUL character.
+
+.. code-block:: c++
+
+ const char* Example[] = "Invalid character: \0x12 should be \x12";
+ const char* Bytes[] = "\x03\0x02\0x01\0x00\0xFF\0xFF\0xFF";
+
+Truncated literal
+-----------------
+
+String-like classes can manipulate strings with embedded NUL as they are
+keeping track of the bytes and the length. This is not the case for a
+``char*`` (NUL-terminated) string.
+
+A common mistake is to pass a string-literal with embedded NUL to a string
+constructor expecting a NUL-terminated string. The bytes after the first NUL
+character are truncated.
+
+.. code-block:: c++
+
+ std::string str("abc\0def"); // "def" is truncated
+ str += "\0"; // This statement is doing nothing
+ if (str == "\0abc") return; // This expression is always true
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/stringview-nullptr.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/stringview-nullptr.md
deleted file mode 100644
index 13e5c03c402b8..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/stringview-nullptr.md
+++ /dev/null
@@ -1,64 +0,0 @@
-```{title} clang-tidy - bugprone-stringview-nullptr
-```
-
-# bugprone-stringview-nullptr
-
-Checks for various ways that the `const CharT*` constructor of
-`std::basic_string_view` can be passed a null argument and replaces them
-with the default constructor in most cases. For the comparison operators,
-braced initializer list does not compile so instead a call to `.empty()`
-or the empty string literal are used, where appropriate.
-
-This prevents code from invoking behavior which is unconditionally undefined.
-The single-argument `const CharT*` constructor does not check for the null
-case before dereferencing its input. The standard is slated to add an
-explicitly-deleted overload to catch some of these cases: wg21.link/p2166
-
-To catch the additional cases of `NULL` (which expands to `__null`) and
-`0`, first run the `modernize-use-nullptr` check to convert the callers to
-`nullptr`.
-
-```c++
-std::string_view sv = nullptr;
-
-sv = nullptr;
-
-bool is_empty = sv == nullptr;
-bool isnt_empty = sv != nullptr;
-
-accepts_sv(nullptr);
-
-accepts_sv({{}}); // A
-
-accepts_sv({nullptr, 0}); // B
-```
-
-is translated into...
-
-```c++
-std::string_view sv = {};
-
-sv = {};
-
-bool is_empty = sv.empty();
-bool isnt_empty = !sv.empty();
-
-accepts_sv("");
-
-accepts_sv(""); // A
-
-accepts_sv({nullptr, 0}); // B
-```
-
-```{note}
-The source pattern with trailing comment "A" selects the `(const CharT*)`
-constructor overload and then value-initializes the pointer, causing a null
-dereference. It happens to not include the `nullptr` literal, but it is
-still within the scope of this check.
-```
-
-```{note}
-The source pattern with trailing comment "B" selects the
-`(const CharT*, size_type)` constructor which is perfectly valid, since the
-length argument is `0`. It is not changed by this check.
-```
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/stringview-nullptr.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/stringview-nullptr.rst
new file mode 100644
index 0000000000000..7138c97b745ae
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/stringview-nullptr.rst
@@ -0,0 +1,63 @@
+.. title:: clang-tidy - bugprone-stringview-nullptr
+
+bugprone-stringview-nullptr
+===========================
+Checks for various ways that the ``const CharT*`` constructor of
+``std::basic_string_view`` can be passed a null argument and replaces them
+with the default constructor in most cases. For the comparison operators,
+braced initializer list does not compile so instead a call to ``.empty()``
+or the empty string literal are used, where appropriate.
+
+This prevents code from invoking behavior which is unconditionally undefined.
+The single-argument ``const CharT*`` constructor does not check for the null
+case before dereferencing its input. The standard is slated to add an
+explicitly-deleted overload to catch some of these cases: wg21.link/p2166
+
+To catch the additional cases of ``NULL`` (which expands to ``__null``) and
+``0``, first run the ``modernize-use-nullptr`` check to convert the callers to
+``nullptr``.
+
+.. code-block:: c++
+
+ std::string_view sv = nullptr;
+
+ sv = nullptr;
+
+ bool is_empty = sv == nullptr;
+ bool isnt_empty = sv != nullptr;
+
+ accepts_sv(nullptr);
+
+ accepts_sv({{}}); // A
+
+ accepts_sv({nullptr, 0}); // B
+
+is translated into...
+
+.. code-block:: c++
+
+ std::string_view sv = {};
+
+ sv = {};
+
+ bool is_empty = sv.empty();
+ bool isnt_empty = !sv.empty();
+
+ accepts_sv("");
+
+ accepts_sv(""); // A
+
+ accepts_sv({nullptr, 0}); // B
+
+.. note::
+
+ The source pattern with trailing comment "A" selects the ``(const CharT*)``
+ constructor overload and then value-initializes the pointer, causing a null
+ dereference. It happens to not include the ``nullptr`` literal, but it is
+ still within the scope of this ClangTidy check.
+
+.. note::
+
+ The source pattern with trailing comment "B" selects the
+ ``(const CharT*, size_type)`` constructor which is perfectly valid, since the
+ length argument is ``0``. It is not changed by this ClangTidy check.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-enum-usage.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-enum-usage.md
deleted file mode 100644
index 8ca5da87e5e11..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-enum-usage.md
+++ /dev/null
@@ -1,79 +0,0 @@
-```{title} clang-tidy - bugprone-suspicious-enum-usage
-```
-
-# bugprone-suspicious-enum-usage
-
-The check detects various cases when an enum is probably misused
-(as a bitmask).
-
-1. When "ADD" or "bitwise OR" is used between two enum which come
- from different types and these types value ranges are not disjoint.
-
-The following cases will be investigated only using {option}`StrictMode`. We
-regard the enum as a (suspicious)
-bitmask if the three conditions below are true at the same time:
-
-- at most half of the elements of the enum are non pow-of-2 numbers (because of
- short enumerations)
-- there is another non pow-of-2 number than the enum constant representing all
- choices (the result "bitwise OR" operation of all enum elements)
-- enum type variable/enumconstant is used as an argument of a
- `+` or "bitwise
- OR" operator
-
-So whenever the non pow-of-2 element is used as a bitmask element we diagnose a
-misuse and give a warning.
-
-2. Investigating the right hand side of `+=` and `|=` operator.
-3. Check only the enum value side of a `|` and `+` operator if one of
- them is not enum val.
-4. Check both side of `|` or `+` operator where the enum values are from
- the same enum type.
-
-Examples:
-
-```c++
-enum { A, B, C };
-enum { D, E, F = 5 };
-enum { G = 10, H = 11, I = 12 };
-
-unsigned flag;
-flag =
- A |
- H; // OK, disjoint value intervals in the enum types ->probably good use.
-flag = B | F; // Warning, have common values so they are probably misused.
-
-// Case 2:
-enum Bitmask {
- A = 0,
- B = 1,
- C = 2,
- D = 4,
- E = 8,
- F = 16,
- G = 31 // OK, real bitmask.
-};
-
-enum Almostbitmask {
- AA = 0,
- BB = 1,
- CC = 2,
- DD = 4,
- EE = 8,
- FF = 16,
- GG // Problem, forgot to initialize.
-};
-
-unsigned flag = 0;
-flag |= E; // OK.
-flag |=
- EE; // Warning at the decl, and note that it was used here as a bitmask.
-```
-
-## Options
-
-```{option} StrictMode
-When non-null the suspicious bitmask usage will be investigated additionally
-to the different enum usage check.
-Default is `0`.
-```
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-enum-usage.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-enum-usage.rst
new file mode 100644
index 0000000000000..94e3db9770cbc
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-enum-usage.rst
@@ -0,0 +1,79 @@
+.. title:: clang-tidy - bugprone-suspicious-enum-usage
+
+bugprone-suspicious-enum-usage
+==============================
+
+The checker detects various cases when an enum is probably misused
+(as a bitmask).
+
+1. When "ADD" or "bitwise OR" is used between two enum which come
+ from different types and these types value ranges are not disjoint.
+
+The following cases will be investigated only using :option:`StrictMode`. We
+regard the enum as a (suspicious)
+bitmask if the three conditions below are true at the same time:
+
+* at most half of the elements of the enum are non pow-of-2 numbers (because of
+ short enumerations)
+* there is another non pow-of-2 number than the enum constant representing all
+ choices (the result "bitwise OR" operation of all enum elements)
+* enum type variable/enumconstant is used as an argument of a `+` or "bitwise
+ OR" operator
+
+So whenever the non pow-of-2 element is used as a bitmask element we diagnose a
+misuse and give a warning.
+
+2. Investigating the right hand side of ``+=`` and ``|=`` operator.
+3. Check only the enum value side of a ``|`` and ``+`` operator if one of
+ them is not enum val.
+4. Check both side of ``|`` or ``+`` operator where the enum values are from
+ the same enum type.
+
+Examples:
+
+.. code-block:: c++
+
+ enum { A, B, C };
+ enum { D, E, F = 5 };
+ enum { G = 10, H = 11, I = 12 };
+
+ unsigned flag;
+ flag =
+ A |
+ H; // OK, disjoint value intervals in the enum types ->probably good use.
+ flag = B | F; // Warning, have common values so they are probably misused.
+
+ // Case 2:
+ enum Bitmask {
+ A = 0,
+ B = 1,
+ C = 2,
+ D = 4,
+ E = 8,
+ F = 16,
+ G = 31 // OK, real bitmask.
+ };
+
+ enum Almostbitmask {
+ AA = 0,
+ BB = 1,
+ CC = 2,
+ DD = 4,
+ EE = 8,
+ FF = 16,
+ GG // Problem, forgot to initialize.
+ };
+
+ unsigned flag = 0;
+ flag |= E; // OK.
+ flag |=
+ EE; // Warning at the decl, and note that it was used here as a bitmask.
+
+Options
+-------
+
+.. option:: StrictMode
+
+ Default value: 0.
+ When non-null the suspicious bitmask usage will be investigated additionally
+ to the different enum usage check.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memory-comparison.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memory-comparison.md
deleted file mode 100644
index c7ace31c125c1..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memory-comparison.md
+++ /dev/null
@@ -1,31 +0,0 @@
-```{title} clang-tidy - bugprone-suspicious-memory-comparison
-```
-
-# bugprone-suspicious-memory-comparison
-
-Finds potentially incorrect calls to `memcmp()` based on properties of the
-arguments. The following cases are covered:
-
-**Case 1: Non-standard-layout type**
-
-Comparing the object representations of non-standard-layout objects may not
-properly compare the value representations.
-
-**Case 2: Types with no unique object representation**
-
-Objects with the same value may not have the same object representation.
-This may be caused by padding or floating-point types.
-
-See also:
-[EXP42-C. Do not compare padding data](https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/expressions-exp/exp42-c/)
-and
-[FLP37-C. Do not use object representations to compare floating-point values](https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/floating-point-flp/flp37-c/)
-
-This check is also related to and partially overlaps the CERT C++ Coding Standard rules
-[OOP57-CPP. Prefer special member functions and overloaded operators to
-C Standard Library functions](https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/object-oriented-programming-oop/oop57-cpp/)
-and
-[EXP62-CPP. Do not access the bits of an object representation that are not
-part of the object's value representation](https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/expressions-exp/exp62-cpp/)
-
-`cert-exp42-c` redirects here as an alias of this check.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memory-comparison.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memory-comparison.rst
new file mode 100644
index 0000000000000..7babea1361e83
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memory-comparison.rst
@@ -0,0 +1,35 @@
+.. title:: clang-tidy - bugprone-suspicious-memory-comparison
+
+bugprone-suspicious-memory-comparison
+=====================================
+
+Finds potentially incorrect calls to ``memcmp()`` based on properties of the
+arguments. The following cases are covered:
+
+**Case 1: Non-standard-layout type**
+
+Comparing the object representations of non-standard-layout objects may not
+properly compare the value representations.
+
+**Case 2: Types with no unique object representation**
+
+Objects with the same value may not have the same object representation.
+This may be caused by padding or floating-point types.
+
+See also:
+`EXP42-C. Do not compare padding data
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/expressions-exp/exp42-c/>`_
+and
+`FLP37-C. Do not use object representations to compare floating-point values
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/floating-point-flp/flp37-c/>`_
+
+This check is also related to and partially overlaps the CERT C++ Coding Standard rules
+`OOP57-CPP. Prefer special member functions and overloaded operators to
+C Standard Library functions
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/object-oriented-programming-oop/oop57-cpp/>`_
+and
+`EXP62-CPP. Do not access the bits of an object representation that are not
+part of the object's value representation
+<https://cmu-sei.github.io/secure-coding-standards/sei-cert-cpp-coding-standard/rules/expressions-exp/exp62-cpp/>`_
+
+`cert-exp42-c` redirects here as an alias of this check.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memset-usage.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memset-usage.md
deleted file mode 100644
index 23a6557610b43..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memset-usage.md
+++ /dev/null
@@ -1,53 +0,0 @@
-```{title} clang-tidy - bugprone-suspicious-memset-usage
-```
-
-# bugprone-suspicious-memset-usage
-
-This check finds `memset()` calls with potential mistakes in their arguments.
-Considering the function as `void* memset(void* destination, int fill_value,
-size_t byte_count)`, the following cases are covered:
-
-**Case 1: Fill value is a character `'0'`**
-
-Filling up a memory area with ASCII code 48 characters is not customary,
-possibly integer zeroes were intended instead.
-The check offers a replacement of `'0'` with `0`. Memsetting character
-pointers with `'0'` is allowed.
-
-**Case 2: Fill value is truncated**
-
-Memset converts `fill_value` to `unsigned char` before using it. If
-`fill_value` is out of unsigned character range, it gets truncated
-and memory will not contain the desired pattern.
-
-**Case 3: Byte count is zero**
-
-Calling memset with a literal zero in its `byte_count` argument is likely
-to be unintended and swapped with `fill_value`. The check offers to swap
-these two arguments.
-
-Corresponding cpplint.py check name: `runtime/memset`.
-
-Examples:
-
-```c++
-void foo() {
- int i[5] = {1, 2, 3, 4, 5};
- int *ip = i;
- char c = '1';
- char *cp = &c;
- int v = 0;
-
- // Case 1
- memset(ip, '0', 1); // suspicious
- memset(cp, '0', 1); // OK
-
- // Case 2
- memset(ip, 0xabcd, 1); // fill value gets truncated
- memset(ip, 0x00, 1); // OK
-
- // Case 3
- memset(ip, sizeof(int), v); // zero length, potentially swapped
- memset(ip, 0, 1); // OK
-}
-```
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memset-usage.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memset-usage.rst
new file mode 100644
index 0000000000000..82609d13e4efe
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-memset-usage.rst
@@ -0,0 +1,54 @@
+.. title:: clang-tidy - bugprone-suspicious-memset-usage
+
+bugprone-suspicious-memset-usage
+================================
+
+This check finds ``memset()`` calls with potential mistakes in their arguments.
+Considering the function as ``void* memset(void* destination, int fill_value,
+size_t byte_count)``, the following cases are covered:
+
+**Case 1: Fill value is a character ``'0'``**
+
+Filling up a memory area with ASCII code 48 characters is not customary,
+possibly integer zeroes were intended instead.
+The check offers a replacement of ``'0'`` with ``0``. Memsetting character
+pointers with ``'0'`` is allowed.
+
+**Case 2: Fill value is truncated**
+
+Memset converts ``fill_value`` to ``unsigned char`` before using it. If
+``fill_value`` is out of unsigned character range, it gets truncated
+and memory will not contain the desired pattern.
+
+**Case 3: Byte count is zero**
+
+Calling memset with a literal zero in its ``byte_count`` argument is likely
+to be unintended and swapped with ``fill_value``. The check offers to swap
+these two arguments.
+
+Corresponding cpplint.py check name: ``runtime/memset``.
+
+
+Examples:
+
+.. code-block:: c++
+
+ void foo() {
+ int i[5] = {1, 2, 3, 4, 5};
+ int *ip = i;
+ char c = '1';
+ char *cp = &c;
+ int v = 0;
+
+ // Case 1
+ memset(ip, '0', 1); // suspicious
+ memset(cp, '0', 1); // OK
+
+ // Case 2
+ memset(ip, 0xabcd, 1); // fill value gets truncated
+ memset(ip, 0x00, 1); // OK
+
+ // Case 3
+ memset(ip, sizeof(int), v); // zero length, potentially swapped
+ memset(ip, 0, 1); // OK
+ }
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-missing-comma.md b/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-missing-comma.md
deleted file mode 100644
index 51e30084cc3b0..0000000000000
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-missing-comma.md
+++ /dev/null
@@ -1,58 +0,0 @@
-```{title} clang-tidy - bugprone-suspicious-missing-comma
-```
-
-# bugprone-suspicious-missing-comma
-
-String literals placed side-by-side are concatenated at translation phase 6
-(after the preprocessor). This feature is used to represent long string
-literal on multiple lines.
-
-For instance, the following declarations are equivalent:
-
-```c++
-const char* A[] = "This is a test";
-const char* B[] = "This" " is a " "test";
-```
-
-A common mistake done by programmers is to forget a comma between two string
-literals in an array initializer list.
-
-```c++
-const char* Test[] = {
- "line 1",
- "line 2" // Missing comma!
- "line 3",
- "line 4",
- "line 5"
-};
-```
-
-The array contains the string "line 2line3" at offset 1 (i.e. Test[1]). Clang
-won't generate warnings at compile time.
-
-This check may warn incorrectly on cases like:
-
-```c++
-const char* SupportedFormat[] = {
- "Error %s",
- "Code " PRIu64, // May warn here.
- "Warning %s",
-};
-```
-
-## Options
-
-```{option} SizeThreshold
-An unsigned integer specifying the minimum size of a string literal to be
-considered by the check. Default is `5U`.
-```
-
-```{option} RatioThreshold
-A string specifying the maximum threshold ratio [0, 1.0] of suspicious string
-literals to be considered. Default is `".2"`.
-```
-
-```{option} MaxConcatenatedTokens
-An unsigned integer specifying the maximum number of concatenated tokens.
-Default is `5U`.
-```
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-missing-comma.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-missing-comma.rst
new file mode 100644
index 0000000000000..7455a2ef13509
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-missing-comma.rst
@@ -0,0 +1,59 @@
+.. title:: clang-tidy - bugprone-suspicious-missing-comma
+
+bugprone-suspicious-missing-comma
+=================================
+
+String literals placed side-by-side are concatenated at translation phase 6
+(after the preprocessor). This feature is used to represent long string
+literal on multiple lines.
+
+For instance, the following declarations are equivalent:
+
+.. code-block:: c++
+
+ const char* A[] = "This is a test";
+ const char* B[] = "This" " is a " "test";
+
+A common mistake done by programmers is to forget a comma between two string
+literals in an array initializer list.
+
+.. code-block:: c++
+
+ const char* Test[] = {
+ "line 1",
+ "line 2" // Missing comma!
+ "line 3",
+ "line 4",
+ "line 5"
+ };
+
+The array contains the string "line 2line3" at offset 1 (i.e. Test[1]). Clang
+won't generate warnings at compile time.
+
+This check may warn incorrectly on cases like:
+
+.. code-block:: c++
+
+ const char* SupportedFormat[] = {
+ "Error %s",
+ "Code " PRIu64, // May warn here.
+ "Warning %s",
+ };
+
+Options
+-------
+
+.. option:: SizeThreshold
+
+ An unsigned integer specifying the minimum size of a string literal to be
+ considered by the check. Default is ``5U``.
+
+.. option:: RatioThreshold
+
+ A string specifying the maximum threshold ratio [0, 1.0] of suspicious string
+ literals to be considered. Default is ``".2"``.
+
+.. option:: MaxConcatenatedTokens
+
+ An unsigned integer specifying the maximum number of concatenated tokens.
+ Default is ``5U``.
diff --git a/clang/docs/LanguageExtensions.md b/clang/docs/LanguageExtensions.md
index ee0b272c0a102..f5313e0378ca0 100644
--- a/clang/docs/LanguageExtensions.md
+++ b/clang/docs/LanguageExtensions.md
@@ -57,7 +57,7 @@ It can be used like this:
...
```
-:::{note}
+```{note}
Prior to Clang 10, `__has_builtin` could not be used to detect most builtin
pseudo-functions.
@@ -66,7 +66,7 @@ use `#ifdef` instead.
When compiling with target offloading, `__has_builtin` only considers the
currently active target.
-:::
+```
### `__has_constexpr_builtin`
@@ -5016,10 +5016,10 @@ will be used.
### C++ Coroutines support builtins
-:::{warning}
+```{warning}
This is a work in progress. Compatibility across Clang/LLVM releases is not
guaranteed.
-:::
+```
Clang provides experimental builtins to support C++ Coroutines as defined by
<https://wg21.link/P0057>. The following four are intended to be used by the
diff --git a/clang/docs/LifetimeSafety.md b/clang/docs/LifetimeSafety.md
index e41d618c029bd..0159db898bb73 100644
--- a/clang/docs/LifetimeSafety.md
+++ b/clang/docs/LifetimeSafety.md
@@ -30,11 +30,11 @@ with attributes like [clang::lifetimebound](https://clang.llvm.org/docs/Attribut
lifetime safety at call sites with higher accuracy. This approach supports
gradual adoption in existing codebases.
-:::{note}
+```{note}
This analysis is designed for bug finding, not verification. It may miss some
lifetime issues and can produce false positives. It does not guarantee the
absence of all lifetime bugs.
-:::
+```
### Getting Started
@@ -128,14 +128,14 @@ details on these attributes, see the Clang attribute reference for
[gsl::Owner](https://clang.llvm.org/docs/AttributeReference.html#gsl-owner) and
[gsl::Pointer](https://clang.llvm.org/docs/AttributeReference.html#gsl-pointer).
-:::{note}
+```{note}
Types with mixed ownership semantics (owning some data while holding views to
other data) or types with multiple view fields with different lifetimes should
not be annotated. The analysis does not yet support expressing such nuanced
lifetime relationships.
Future enhancements, such as named lifetimes, may provide better support for
these patterns.
-:::
+```
### LifetimeBound
@@ -384,9 +384,9 @@ as `std::unique_ptr` after operations like `reset`. For example, adding
elements to `std::vector` may cause reallocation, invalidating all existing
iterators, pointers and references to its elements.
-:::{note}
+```{note}
Invalidation checking is highly experimental and may produce false positives.
-:::
+```
````{list-table}
:widths: 50 50
diff --git a/clang/docs/MisExpect.md b/clang/docs/MisExpect.md
index 277fc86e3241d..aba6f349a9bec 100644
--- a/clang/docs/MisExpect.md
+++ b/clang/docs/MisExpect.md
@@ -42,24 +42,24 @@ MisExpect diagnostics are also available in the form of optimization remarks,
which can be serialized and processed through the `opt-viewer.py`
scripts in LLVM.
-:::{option} -Rpass=misexpect
+```{option} -Rpass=misexpect
Enables optimization remarks for misexpect when profiling data conflicts with
use of `llvm.expect` intrinsics.
-:::
+```
-:::{option} -Wmisexpect
+```{option} -Wmisexpect
Enables misexpect warnings when profiling data conflicts with use of
`llvm.expect` intrinsics.
-:::
+```
-:::{option} -fdiagnostic-misexpect-tolerance=N
+```{option} -fdiagnostic-misexpect-tolerance=N
Relaxes misexpect checking to tolerate profiling values within N% of the
expected branch weight. e.g., a value of `N=5` allows misexpect to check against
`0.95 * Threshold`
-:::
+```
LLVM supports 4 types of profile formats: Frontend, IR, CS-IR, and
Sampling. MisExpect Diagnostics are compatible with all Profiling formats.
diff --git a/clang/docs/ReleaseNotes.md b/clang/docs/ReleaseNotes.md
index fc947d05fad83..04aaa038930d1 100644
--- a/clang/docs/ReleaseNotes.md
+++ b/clang/docs/ReleaseNotes.md
@@ -2,7 +2,6 @@
myst:
enable_extensions:
- attrs_block
- - colon_fence
- substitution
---
@@ -19,14 +18,14 @@ myst:
Written by the [LLVM Team](https://llvm.org/)
-::::{only} PreRelease
+````{only} PreRelease
-:::{warning}
+```{warning}
These are in-progress notes for the upcoming Clang {{env.config.version}} release.
Release notes for previous releases can be found on
[the Releases Page](https://llvm.org/releases/).
-:::
-::::
+```
+````
## Introduction
diff --git a/clang/docs/ReleaseNotesTemplate.txt b/clang/docs/ReleaseNotesTemplate.txt
index df98f9adc0338..465f1eec8c05f 100644
--- a/clang/docs/ReleaseNotesTemplate.txt
+++ b/clang/docs/ReleaseNotesTemplate.txt
@@ -2,7 +2,6 @@
myst:
enable_extensions:
- attrs_block
- - colon_fence
- substitution
---
@@ -19,14 +18,14 @@ myst:
Written by the [LLVM Team](https://llvm.org/)
-::::{only} PreRelease
+````{only} PreRelease
-:::{warning}
+```{warning}
These are in-progress notes for the upcoming Clang {{env.config.version}} release.
Release notes for previous releases can be found on
[the Releases Page](https://llvm.org/releases/).
-:::
-::::
+```
+````
## Introduction
diff --git a/clang/docs/Toolchain.md b/clang/docs/Toolchain.md
index 2456cfcbd58bc..a5578b5904a60 100644
--- a/clang/docs/Toolchain.md
+++ b/clang/docs/Toolchain.md
@@ -18,12 +18,12 @@ This document describes the required and optional components in a
complete toolchain, where to find them, and the supported versions
and limitations of each option.
-:::{warning}
+```{warning}
This document currently describes Clang configurations on POSIX-like
operating systems with the GCC-compatible `clang` driver. When
targeting Windows with the MSVC-compatible `clang-cl` driver, some
of the details are different.
-:::
+```
## Tools
@@ -126,11 +126,11 @@ The set of implicitly-linked libraries depend on the language mode. As a
consequence, you should use `clang++` when linking C++ programs in order
to ensure the C++ runtimes are provided.
-:::{note}
+```{note}
There may exist other implementations for these components not described
below. Please let us know how well those other implementations work with
Clang so they can be added to this list!
-:::
+```
% FIXME: Describe Objective-C runtime libraries
@@ -193,12 +193,12 @@ libgcc_s does not provide an implementation of an atomics library. Instead,
[GCC's libatomic library](https://gcc.gnu.org/wiki/Atomic/GCCMM) can be
used to supply these when using libgcc_s.
-:::{note}
+```{note}
Clang does not currently automatically link against libatomic when using
libgcc_s. You may need to manually add `-latomic` to support this
configuration when using non-native atomic operations (if you see link errors
referring to `__atomic_*` functions).
-:::
+```
### Unwind library
@@ -281,11 +281,11 @@ libsupc++ is GCC's implementation of this specification. However, this
library is only used when libstdc++ is linked statically. The dynamic
library version of libstdc++ contains a copy of libsupc++.
-:::{note}
+```{note}
Clang does not currently automatically link against libsupc++ when statically
linking libstdc++. You may need to manually add `-lsupc++` to support this
configuration when using `-static` or `-static-libstdc++`.
-:::
+```
#### libcxxrt (PathScale)
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 51fe39f3733b1..b57ff6c197d1d 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -5524,10 +5524,6 @@ def err_no_viable_destructor : Error<
def err_ambiguous_destructor : Error<
"destructor of class %0 is ambiguous">;
-def note_ovl_ms_allocation_fallback_failed : Note<
- "Microsoft compatibility array allocation fallback to "
- "'::operator new(size_t)' failed">;
-
def err_ovl_no_viable_object_call : Error<
"no matching function for call to object of type %0">;
def err_ovl_ambiguous_object_call : Error<
diff --git a/clang/include/clang/Sema/DynamicAllocationArgumentsCXX.h b/clang/include/clang/Sema/DynamicAllocationArgumentsCXX.h
deleted file mode 100644
index 7ce800111dfe6..0000000000000
--- a/clang/include/clang/Sema/DynamicAllocationArgumentsCXX.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//===- DynamicAllocationArgumentsCXX.h - operator new/delete args ---------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the argument candidate and resolution types for operators
-// new and new[] overload resolution.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_SEMA_DYNAMICALLOCATIONARGUMENTSCXX_H
-#define LLVM_CLANG_SEMA_DYNAMICALLOCATIONARGUMENTSCXX_H
-
-#include "clang/AST/ExprCXX.h"
-#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/SmallVector.h"
-
-namespace clang {
-
-class LookupResult;
-class Sema;
-
-struct ImplicitAllocationArguments {
- friend Sema;
-
- ArrayRef<Expr *> getImplicitArguments() const {
- return ArrayRef(ImplicitArguments, ArgumentCount);
- }
-
- Expr *getAlignmentArgument() const {
- if (PassAlignment == AlignedAllocationMode::Yes)
- return ImplicitArguments[ArgumentCount - 1];
- return nullptr;
- }
-
- const LookupResult &
- updateLookupForMSVCCompatibility(Sema &, const LookupResult &,
- std::optional<LookupResult> &) const;
- TypeAwareAllocationMode PassTypeIdentity;
- AlignedAllocationMode PassAlignment;
- bool IsMSVCCompatibilityFallback;
-
-private:
- ImplicitAllocationArguments(Sema &SemaRef, Expr *TypeIdentityArg,
- Expr *SizeArg, Expr *AlignArg,
- bool IsMSVCCompatibilityFallback);
-
- // Type-identity, size, and alignment
- static constexpr unsigned MaxImplicitArguments = 3;
- unsigned ArgumentCount;
- Expr *ImplicitArguments[MaxImplicitArguments];
-};
-
-struct ResolvedAllocation {
- FunctionDecl *OperatorNew;
- FunctionDecl *OperatorDelete;
- ImplicitAllocationParameters IAP;
- // type-identity, size, alignment, nothrow or other single placement
- // parameter
- SmallVector<Expr *, 4> Arguments;
-};
-
-} // namespace clang
-
-#endif // LLVM_CLANG_SEMA_DYNAMICALLOCATIONARGUMENTSCXX_H
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index b1d2488d2163b..778c1a2f5c427 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -136,7 +136,6 @@ struct DeductionFailureInfo;
class DependentDiagnostic;
class Designation;
class IdentifierInfo;
-struct ImplicitAllocationArguments;
class ImplicitConversionSequence;
typedef MutableArrayRef<ImplicitConversionSequence> ConversionSequenceList;
class InitializationKind;
@@ -158,7 +157,6 @@ enum OverloadCandidateRewriteKind : unsigned;
class OverloadCandidateSet;
class Preprocessor;
struct APINotesSelectorDiagnosticState;
-struct ResolvedAllocation;
class SemaAMDGPU;
class SemaARM;
class SemaAVR;
@@ -226,10 +224,6 @@ enum class AssignmentAction {
Passing_CFAudited
};
-// Inline capacity for type-aware, aligned, and unaligned allocation argument
-// list candidates.
-using AllocationArgumentSet = SmallVector<ImplicitAllocationArguments, 3>;
-
namespace threadSafety {
class BeforeSet;
void threadSafetyCleanup(BeforeSet *Cache);
@@ -8665,11 +8659,12 @@ class Sema final : public SemaBase {
/// Finds the overloads of operator new and delete that are appropriate
/// for the allocation.
- std::optional<ResolvedAllocation> FindAllocationFunctions(
+ bool FindAllocationFunctions(
SourceLocation StartLoc, SourceRange Range,
AllocationFunctionScope NewScope, AllocationFunctionScope DeleteScope,
- QualType AllocType, bool IsArray, const ImplicitAllocationParameters &IAP,
- MultiExprArg PlaceArgs, bool Diagnose = true);
+ QualType AllocType, bool IsArray, ImplicitAllocationParameters &IAP,
+ MultiExprArg PlaceArgs, FunctionDecl *&OperatorNew,
+ FunctionDecl *&OperatorDelete, bool Diagnose = true);
/// DeclareGlobalNewDelete - Declare the global forms of operator new and
/// delete. These are:
@@ -8973,19 +8968,6 @@ class Sema final : public SemaBase {
void AnalyzeDeleteExprMismatch(FieldDecl *Field, SourceLocation DeleteLoc,
bool DeleteWasArrayForm);
- std::optional<AllocationArgumentSet>
- resolveAllocationArguments(LookupResult &R,
- const ImplicitAllocationParameters &,
- ArrayRef<Expr *> PlacementArguments);
-
- // Attempts to construct the type identity argument for the call to a
- // type aware operator new. Returns null on failure.
- Expr *tryGetTypeIdentityArgument(QualType Type, SourceLocation);
-
- Expr *AllocationSizeExpr = nullptr;
- Expr *AllocationAlignmentExpr = nullptr;
- llvm::DenseMap<QualType, Expr *> AllocationTypeIdentityArguments;
-
///@}
//
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 316b2a4f092f9..01cfdeb3ef0fb 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -37,8 +37,8 @@ static std::optional<bool> getBoolValue(const Expr *E) {
return std::nullopt;
}
-/// Check if \c E has side-effects. This is used to avoid some temporary
-/// variables and is supposed to be a quick check, not exhaustive. That's why
+/// Check if \c E has side-effects. This is used to avoid some tempoarary
+/// variables and is supposed to be a quick check, not exhausite. That's why
/// we're not using Expr::HasSideEffects().
static bool isSideEffectFree(const Expr *E) {
if (isa<IntegerLiteral, FloatingLiteral, CharacterLiteral,
diff --git a/clang/lib/AST/ByteCode/DynamicAllocator.cpp b/clang/lib/AST/ByteCode/DynamicAllocator.cpp
index f7909d313eaab..d70202b92e6e9 100644
--- a/clang/lib/AST/ByteCode/DynamicAllocator.cpp
+++ b/clang/lib/AST/ByteCode/DynamicAllocator.cpp
@@ -8,6 +8,7 @@
#include "DynamicAllocator.h"
#include "InterpBlock.h"
+#include "InterpState.h"
using namespace clang;
using namespace clang::interp;
diff --git a/clang/lib/AST/ByteCode/Function.cpp b/clang/lib/AST/ByteCode/Function.cpp
index 22d26e498c5b6..cd0f7eb125230 100644
--- a/clang/lib/AST/ByteCode/Function.cpp
+++ b/clang/lib/AST/ByteCode/Function.cpp
@@ -39,10 +39,9 @@ Function::Function(Program &P, FunctionDeclTy Source, unsigned ArgSize,
} else if (const auto *MD = dyn_cast<CXXMethodDecl>(F)) {
ExplicitThisPointer = MD->isExplicitObjectMemberFunction();
Virtual = MD->isVirtual();
- if (IsLambdaStaticInvoker) {
+ if (IsLambdaStaticInvoker)
Kind = FunctionKind::LambdaStaticInvoker;
- Constexpr = true;
- } else if (clang::isLambdaCallOperator(F))
+ else if (clang::isLambdaCallOperator(F))
Kind = FunctionKind::LambdaCallOperator;
else if (MD->isCopyAssignmentOperator() || MD->isMoveAssignmentOperator())
Kind = FunctionKind::CopyOrMoveOperator;
diff --git a/clang/lib/AST/ByteCode/Function.h b/clang/lib/AST/ByteCode/Function.h
index 9742a16b50f2c..27edfc6d08916 100644
--- a/clang/lib/AST/ByteCode/Function.h
+++ b/clang/lib/AST/ByteCode/Function.h
@@ -178,7 +178,7 @@ class Function final {
SourceInfo getSource(CodePtr PC) const;
/// Checks if the function is valid to call.
- bool isValid() const { return IsValid; }
+ bool isValid() const { return IsValid || isLambdaStaticInvoker(); }
/// Checks if the function is virtual.
bool isVirtual() const { return Virtual; };
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp
index ece2e71408731..f7e74811cc9f5 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -1153,6 +1153,10 @@ static bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F) {
return false;
}
+ // Implicitly constexpr.
+ if (F->isLambdaStaticInvoker())
+ return true;
+
return diagnoseCallableDecl(S, OpPC, DiagDecl);
}
@@ -2904,7 +2908,8 @@ bool arePotentiallyOverlappingStringLiterals(const Pointer &LHS,
return Shorter == Longer.take_front(Shorter.size());
}
-static void copyPrimitiveMemory(InterpState &S, PtrView Ptr, PrimType T) {
+static void copyPrimitiveMemory(InterpState &S, const Pointer &Ptr,
+ PrimType T) {
if (T == PT_IntAPS) {
auto &Val = Ptr.deref<IntegralAP<true>>();
if (!Val.singleWord()) {
@@ -2933,7 +2938,7 @@ static void copyPrimitiveMemory(InterpState &S, PtrView Ptr, PrimType T) {
}
template <typename T>
-static void copyPrimitiveMemory(InterpState &S, PtrView Ptr) {
+static void copyPrimitiveMemory(InterpState &S, const Pointer &Ptr) {
assert(needsAlloc<T>());
if constexpr (std::is_same_v<T, MemberPointer>) {
auto &Val = Ptr.deref<MemberPointer>();
@@ -2950,7 +2955,7 @@ static void copyPrimitiveMemory(InterpState &S, PtrView Ptr) {
}
}
-static void finishGlobalRecurse(InterpState &S, PtrView Ptr) {
+static void finishGlobalRecurse(InterpState &S, const Pointer &Ptr) {
if (const Record *R = Ptr.getRecord()) {
for (const Record::Field &Fi : R->fields()) {
if (Fi.Desc->isPrimitive()) {
@@ -2974,7 +2979,7 @@ static void finishGlobalRecurse(InterpState &S, PtrView Ptr) {
if (!needsAlloc(PT))
return;
assert(NumElems >= 1);
- PtrView EP = Ptr.atIndex(0);
+ const Pointer EP = Ptr.atIndex(0);
bool AllSingleWord = true;
TYPE_SWITCH_ALLOC(PT, {
if (!EP.deref<T>().singleWord()) {
@@ -2985,13 +2990,13 @@ static void finishGlobalRecurse(InterpState &S, PtrView Ptr) {
if (AllSingleWord)
return;
for (unsigned I = 1; I != D->getNumElems(); ++I) {
- PtrView EP = Ptr.atIndex(I);
+ const Pointer EP = Ptr.atIndex(I);
copyPrimitiveMemory(S, EP, PT);
}
} else {
assert(D->isCompositeArray());
for (unsigned I = 0; I != D->getNumElems(); ++I) {
- PtrView EP = Ptr.atIndex(I).narrow();
+ const Pointer EP = Ptr.atIndex(I).narrow();
finishGlobalRecurse(S, EP);
}
}
@@ -3001,7 +3006,7 @@ static void finishGlobalRecurse(InterpState &S, PtrView Ptr) {
bool FinishInitGlobal(InterpState &S) {
const Pointer &Ptr = S.Stk.pop<Pointer>();
- finishGlobalRecurse(S, Ptr.view());
+ finishGlobalRecurse(S, Ptr);
if (Ptr.canBeInitialized()) {
Ptr.initialize();
Ptr.activate();
diff --git a/clang/lib/AST/ByteCode/Pointer.cpp b/clang/lib/AST/ByteCode/Pointer.cpp
index 4f36d20b352cb..b987b350f9537 100644
--- a/clang/lib/AST/ByteCode/Pointer.cpp
+++ b/clang/lib/AST/ByteCode/Pointer.cpp
@@ -176,34 +176,28 @@ APValue Pointer::toAPValue(const ASTContext &ASTCtx) const {
if (isZero())
return APValue(APValue::LValueBase(), CharUnits::Zero(), Path,
/*IsOnePastEnd=*/false, /*IsNullPtr=*/true);
-
- switch (StorageKind) {
- case Storage::Int:
+ if (isIntegralPointer())
return APValue(static_cast<const Expr *>(nullptr),
CharUnits::fromQuantity(asIntPointer().Value + this->Offset),
Path,
/*IsOnePastEnd=*/false, /*IsNullPtr=*/false);
- case Storage::Block:
- // See below.
- break;
- case Storage::Fn: {
+ if (isFunctionPointer()) {
const FunctionPointer &FP = asFunctionPointer();
if (const FunctionDecl *FD = FP.Func->getDecl())
return APValue(FD, CharUnits::fromQuantity(Offset), {},
/*OnePastTheEnd=*/false, /*IsNull=*/false);
return APValue(FP.Func->getExpr(), CharUnits::fromQuantity(Offset), {},
/*OnePastTheEnd=*/false, /*IsNull=*/false);
- } break;
- case Storage::Typeid: {
+ }
+
+ if (isTypeidPointer()) {
TypeInfoLValue TypeInfo(Typeid.TypePtr);
return APValue(APValue::LValueBase::getTypeInfo(
TypeInfo, QualType(Typeid.TypeInfoType, 0)),
CharUnits::Zero(), {},
/*OnePastTheEnd=*/false, /*IsNull=*/false);
- } break;
}
- assert(isBlockPointer());
// Build the lvalue base from the block.
const Descriptor *Desc = getDeclDesc();
APValue::LValueBase Base;
diff --git a/clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp b/clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp
index a11f1cca25aca..cab409e3b8b5a 100644
--- a/clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp
+++ b/clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp
@@ -5,7 +5,6 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#include <algorithm>
#include <cassert>
#include <memory>
@@ -19,7 +18,6 @@
#include "clang/Analysis/CFG.h"
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/ImmutableList.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/raw_ostream.h"
@@ -177,14 +175,12 @@ class AnalysisImpl
using SearchState = std::pair<const CFGBlock *, OriginID>;
struct DFSNode {
SearchState CurrState;
- llvm::ImmutableList<OriginID> OriginFlowChain;
+ llvm::SmallVector<OriginID> OriginFlowChain;
};
llvm::SmallVector<DFSNode> PendingStates;
llvm::SmallSet<SearchState, 16> VistedStates;
- llvm::ImmutableList<OriginID>::Factory OriginFlowChainFactory;
- PendingStates.push_back(
- {{EndBlock, StartOID}, OriginFlowChainFactory.getEmptyList()});
+ PendingStates.push_back({{EndBlock, StartOID}, {}});
// DFS loop to trace loan backwards through CFG
while (!PendingStates.empty()) {
@@ -195,19 +191,13 @@ class AnalysisImpl
const auto [BuildResult, Complete] =
buildOriginFlowChain(CurrBlock, CurrOID, TargetLoan);
if (!BuildResult.empty()) {
- for (OriginID OID : BuildResult)
- CurrNode.OriginFlowChain =
- OriginFlowChainFactory.add(OID, CurrNode.OriginFlowChain);
+ CurrNode.OriginFlowChain.append(BuildResult);
CurrOID = BuildResult.back();
}
// If we found the IssueFact, we're done
- if (Complete) {
- llvm::SmallVector<OriginID> Result(CurrNode.OriginFlowChain.begin(),
- CurrNode.OriginFlowChain.end());
- std::reverse(Result.begin(), Result.end());
- return Result;
- }
+ if (Complete)
+ return CurrNode.OriginFlowChain;
// Only explore predecessor blocks where the target loan is present in the
// current origin.
@@ -219,8 +209,8 @@ class AnalysisImpl
}
}
- llvm_unreachable("Could not reconstruct origin flow. Search finished "
- "without reaching IssueFact");
+ llvm_unreachable(
+ "buildOriginFlowChain did not reach IssueFact for TargetLoan");
}
llvm::SmallVector<OriginID> buildOriginFlowChain(const UseFact *UF,
diff --git a/clang/lib/Basic/Targets/AMDGPU.cpp b/clang/lib/Basic/Targets/AMDGPU.cpp
index c15ac0462918d..4109066ec910e 100644
--- a/clang/lib/Basic/Targets/AMDGPU.cpp
+++ b/clang/lib/Basic/Targets/AMDGPU.cpp
@@ -229,9 +229,7 @@ AMDGPUTargetInfo::AMDGPUTargetInfo(const llvm::Triple &Triple,
MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
CUMode = !(GPUFeatures & llvm::AMDGPU::FEATURE_WGP);
- for (auto F : {"image-insts", "gws", "vmem-to-lds-load-insts", "supports-wgp",
- "supports-wave32", "xnack-support", "sramecc-support",
- "xnack-on-off-modes"}) {
+ for (auto F : {"image-insts", "gws", "vmem-to-lds-load-insts"}) {
if (GPUKind != llvm::AMDGPU::GK_NONE)
ReadOnlyFeatures.insert(F);
}
diff --git a/clang/lib/CIR/CodeGen/CIRGenBuiltinAMDGPU.cpp b/clang/lib/CIR/CodeGen/CIRGenBuiltinAMDGPU.cpp
index fb1a24179887b..e2a1c2b94dec4 100644
--- a/clang/lib/CIR/CodeGen/CIRGenBuiltinAMDGPU.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenBuiltinAMDGPU.cpp
@@ -211,16 +211,13 @@ CIRGenFunction::emitAMDGPUBuiltinExpr(unsigned builtinId,
return mlir::Value{};
}
case AMDGPU::BI__builtin_amdgcn_permlane16:
- case AMDGPU::BI__builtin_amdgcn_permlanex16: {
- llvm::StringRef intrinsicName =
- builtinId == AMDGPU::BI__builtin_amdgcn_permlane16
- ? "amdgcn.permlane16"
- : "amdgcn.permlanex16";
- return emitBuiltinWithOneOverloadedType<6>(expr, intrinsicName).getValue();
- }
- case AMDGPU::BI__builtin_amdgcn_permlane64:
- return emitBuiltinWithOneOverloadedType<1>(expr, "amdgcn.permlane64")
- .getValue();
+ case AMDGPU::BI__builtin_amdgcn_permlanex16:
+ case AMDGPU::BI__builtin_amdgcn_permlane64: {
+ cgm.errorNYI(expr->getSourceRange(),
+ std::string("unimplemented AMDGPU builtin call: ") +
+ getContext().BuiltinInfo.getName(builtinId));
+ return mlir::Value{};
+ }
case AMDGPU::BI__builtin_amdgcn_readlane:
return emitBuiltinWithOneOverloadedType<2>(expr, "amdgcn.readlane")
.getValue();
diff --git a/clang/lib/Sema/SemaCoroutine.cpp b/clang/lib/Sema/SemaCoroutine.cpp
index aceb5f2aa33a4..7f9b1d642cf9d 100644
--- a/clang/lib/Sema/SemaCoroutine.cpp
+++ b/clang/lib/Sema/SemaCoroutine.cpp
@@ -23,7 +23,6 @@
#include "clang/Basic/Builtins.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/Preprocessor.h"
-#include "clang/Sema/DynamicAllocationArgumentsCXX.h"
#include "clang/Sema/EnterExpressionEvaluationContext.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Overload.h"
@@ -1479,16 +1478,13 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
IAP = ImplicitAllocationParameters(
alignedAllocationModeFromBool(ShouldUseAlignedAlloc));
- auto FoundAllocations = S.FindAllocationFunctions(
+ FunctionDecl *UnusedResult = nullptr;
+ S.FindAllocationFunctions(
Loc, SourceRange(), NewScope,
/*DeleteScope=*/AllocationFunctionScope::Both, PromiseType,
/*isArray=*/false, IAP,
- WithoutPlacementArgs ? MultiExprArg{} : PlacementArgs,
- /*Diagnose=*/false);
- if (FoundAllocations) {
- IAP = FoundAllocations->IAP;
- OperatorNew = FoundAllocations->OperatorNew;
- }
+ WithoutPlacementArgs ? MultiExprArg{} : PlacementArgs, OperatorNew,
+ UnusedResult, /*Diagnose=*/false);
assert(!OperatorNew || !OperatorNew->isTypeAwareOperatorNewOrDelete());
};
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 6cc80c8254a78..538604aa2e64b 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -32,7 +32,6 @@
#include "clang/Basic/TokenKinds.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/DeclSpec.h"
-#include "clang/Sema/DynamicAllocationArgumentsCXX.h"
#include "clang/Sema/EnterExpressionEvaluationContext.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Lookup.h"
@@ -2439,7 +2438,6 @@ ExprResult Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
FunctionDecl *OperatorNew = nullptr;
FunctionDecl *OperatorDelete = nullptr;
- SmallVector<Expr *, 4> SelectedAllocationArgs;
unsigned Alignment =
AllocType->isDependentType() ? 0 : Context.getTypeAlign(AllocType);
unsigned NewAlignment = Context.getTargetInfo().getNewAlign();
@@ -2456,19 +2454,13 @@ ExprResult Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
SourceRange AllocationParameterRange = Range;
if (PlacementLParen.isValid() && PlacementRParen.isValid())
AllocationParameterRange = SourceRange(PlacementLParen, PlacementRParen);
-
if (!AllocType->isDependentType() &&
- !Expr::hasAnyTypeDependentArguments(PlacementArgs)) {
- auto FoundAllocation = FindAllocationFunctions(
- StartLoc, AllocationParameterRange, Scope, Scope, AllocType,
- /*IsArray=*/ArraySize.has_value(), IAP, PlacementArgs);
- if (!FoundAllocation)
- return ExprError();
- IAP = FoundAllocation->IAP;
- OperatorNew = FoundAllocation->OperatorNew;
- OperatorDelete = FoundAllocation->OperatorDelete;
- SelectedAllocationArgs = std::move(FoundAllocation->Arguments);
- }
+ !Expr::hasAnyTypeDependentArguments(PlacementArgs) &&
+ FindAllocationFunctions(StartLoc, AllocationParameterRange, Scope, Scope,
+ AllocType, ArraySize.has_value(), IAP,
+ PlacementArgs, OperatorNew, OperatorDelete))
+ return ExprError();
+
// If this is an array allocation, compute whether the usual array
// deallocation function for the type has a size_t parameter.
bool UsualArrayDeleteWantsSize = false;
@@ -2487,8 +2479,13 @@ ExprResult Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
// arguments. Skip the first parameter because we don't have a corresponding
// argument. Skip the second parameter too if we're passing in the
// alignment; we've already filled it in.
- unsigned NumImplicitArgs =
- SelectedAllocationArgs.size() - PlacementArgs.size();
+ unsigned NumImplicitArgs = 1;
+ if (isTypeAwareAllocation(IAP.PassTypeIdentity)) {
+ assert(OperatorNew->isTypeAwareOperatorNewOrDelete());
+ NumImplicitArgs++;
+ }
+ if (isAlignedAllocation(IAP.PassAlignment))
+ NumImplicitArgs++;
if (GatherArgumentsForCall(AllocationParameterRange.getBegin(), OperatorNew,
Proto, NumImplicitArgs, PlacementArgs,
AllPlaceArgs, CallType))
@@ -2726,9 +2723,9 @@ bool Sema::CheckAllocatedType(QualType AllocType, SourceLocation Loc,
}
static void diagnoseNoViableFunctionForAllocationOverloadResolution(
- Sema &S, const LookupResult &R, SourceRange Range, ArrayRef<Expr *> Args,
+ Sema &S, LookupResult &R, SourceRange Range, ArrayRef<Expr *> Args,
OverloadCandidateSet &Candidates, OverloadCandidateSet *AlignedCandidates,
- Expr *AlignArg, bool IncludedMSVCFallback) {
+ Expr *AlignArg) {
// If this is an allocation of the form 'new (p) X' for some object
// pointer p (or an expression that will decay to such a pointer),
// diagnose the reason for the error.
@@ -2788,81 +2785,114 @@ static void diagnoseNoViableFunctionForAllocationOverloadResolution(
AlignedCandidates->NoteCandidates(S, AlignedArgs, AlignedCands, "",
R.getNameLoc());
Candidates.NoteCandidates(S, Args, Cands, "", R.getNameLoc());
- if (IncludedMSVCFallback)
- S.Diag(R.getNameLoc(), diag::note_ovl_ms_allocation_fallback_failed)
- << Range;
}
-enum class AllocatorResolveResult { Success, Retry, Error };
-static AllocatorResolveResult resolveAllocationOverload(
- Sema &S, const LookupResult &BaseLookup, SourceRange Range,
- ImplicitAllocationArguments &AllocationArgs, MultiExprArg TrialArguments,
- FunctionDecl *&Operator, OverloadCandidateSet &Candidates, bool Diagnose) {
- std::optional<LookupResult> MSVCFallback;
- const LookupResult &LocalLookup =
- AllocationArgs.updateLookupForMSVCCompatibility(S, BaseLookup,
- MSVCFallback);
-
- bool ArgumentListIsTypeAware =
- isTypeAwareAllocation(AllocationArgs.PassTypeIdentity);
-
- for (LookupResult::iterator Alloc = LocalLookup.begin(),
- AllocEnd = LocalLookup.end();
+enum class ResolveMode { Typed, Untyped };
+static bool resolveAllocationOverloadInterior(
+ Sema &S, LookupResult &R, SourceRange Range, ResolveMode Mode,
+ SmallVectorImpl<Expr *> &Args, AlignedAllocationMode &PassAlignment,
+ FunctionDecl *&Operator, OverloadCandidateSet *AlignedCandidates,
+ Expr *AlignArg, bool Diagnose) {
+ unsigned NonTypeArgumentOffset = 0;
+ if (Mode == ResolveMode::Typed) {
+ ++NonTypeArgumentOffset;
+ }
+
+ OverloadCandidateSet Candidates(R.getNameLoc(),
+ OverloadCandidateSet::CSK_Normal);
+ for (LookupResult::iterator Alloc = R.begin(), AllocEnd = R.end();
Alloc != AllocEnd; ++Alloc) {
// Even member operator new/delete are implicitly treated as
// static, so don't use AddMemberCandidate.
NamedDecl *D = (*Alloc)->getUnderlyingDecl();
- bool CandidateIsTypeAware =
- D->getAsFunction()->isTypeAwareOperatorNewOrDelete();
- if (CandidateIsTypeAware != ArgumentListIsTypeAware)
+ bool IsTypeAware = D->getAsFunction()->isTypeAwareOperatorNewOrDelete();
+ if (IsTypeAware == (Mode != ResolveMode::Typed))
continue;
if (FunctionTemplateDecl *FnTemplate = dyn_cast<FunctionTemplateDecl>(D)) {
S.AddTemplateOverloadCandidate(FnTemplate, Alloc.getPair(),
- /*ExplicitTemplateArgs=*/nullptr,
- TrialArguments, Candidates,
+ /*ExplicitTemplateArgs=*/nullptr, Args,
+ Candidates,
/*SuppressUserConversions=*/false);
continue;
}
FunctionDecl *Fn = cast<FunctionDecl>(D);
- S.AddOverloadCandidate(Fn, Alloc.getPair(), TrialArguments, Candidates,
+ S.AddOverloadCandidate(Fn, Alloc.getPair(), Args, Candidates,
/*SuppressUserConversions=*/false);
}
// Do the resolution.
OverloadCandidateSet::iterator Best;
- switch (Candidates.BestViableFunction(S, LocalLookup.getNameLoc(), Best)) {
+ switch (Candidates.BestViableFunction(S, R.getNameLoc(), Best)) {
case OR_Success: {
+ // Got one!
FunctionDecl *FnDecl = Best->Function;
- if (S.CheckAllocationAccess(LocalLookup.getNameLoc(), Range,
- LocalLookup.getNamingClass(),
+ if (S.CheckAllocationAccess(R.getNameLoc(), Range, R.getNamingClass(),
Best->FoundDecl) == Sema::AR_inaccessible)
- return AllocatorResolveResult::Error;
+ return true;
Operator = FnDecl;
- return AllocatorResolveResult::Success;
+ return false;
}
case OR_No_Viable_Function:
- return AllocatorResolveResult::Retry;
+ // C++17 [expr.new]p13:
+ // If no matching function is found and the allocated object type has
+ // new-extended alignment, the alignment argument is removed from the
+ // argument list, and overload resolution is performed again.
+ if (isAlignedAllocation(PassAlignment)) {
+ PassAlignment = AlignedAllocationMode::No;
+ AlignArg = Args[NonTypeArgumentOffset + 1];
+ Args.erase(Args.begin() + NonTypeArgumentOffset + 1);
+ return resolveAllocationOverloadInterior(S, R, Range, Mode, Args,
+ PassAlignment, Operator,
+ &Candidates, AlignArg, Diagnose);
+ }
+
+ // MSVC will fall back on trying to find a matching global operator new
+ // if operator new[] cannot be found. Also, MSVC will leak by not
+ // generating a call to operator delete or operator delete[], but we
+ // will not replicate that bug.
+ // FIXME: Find out how this interacts with the std::align_val_t fallback
+ // once MSVC implements it.
+ if (R.getLookupName().getCXXOverloadedOperator() == OO_Array_New &&
+ S.Context.getLangOpts().MSVCCompat && Mode != ResolveMode::Typed) {
+ R.clear();
+ R.setLookupName(S.Context.DeclarationNames.getCXXOperatorName(OO_New));
+ S.LookupQualifiedName(R, S.Context.getTranslationUnitDecl());
+ // FIXME: This will give bad diagnostics pointing at the wrong functions.
+ return resolveAllocationOverloadInterior(S, R, Range, Mode, Args,
+ PassAlignment, Operator,
+ /*Candidates=*/nullptr,
+ /*AlignArg=*/nullptr, Diagnose);
+ }
+ if (Mode == ResolveMode::Typed) {
+ // If we can't find a matching type aware operator we don't consider this
+ // a failure.
+ Operator = nullptr;
+ return false;
+ }
+ if (Diagnose)
+ diagnoseNoViableFunctionForAllocationOverloadResolution(
+ S, R, Range, Args, Candidates, AlignedCandidates, AlignArg);
+ return true;
case OR_Ambiguous:
if (Diagnose) {
Candidates.NoteCandidates(
- PartialDiagnosticAt(LocalLookup.getNameLoc(),
+ PartialDiagnosticAt(R.getNameLoc(),
S.PDiag(diag::err_ovl_ambiguous_call)
- << LocalLookup.getLookupName() << Range),
- S, OCD_AmbiguousCandidates, TrialArguments);
+ << R.getLookupName() << Range),
+ S, OCD_AmbiguousCandidates, Args);
}
- return AllocatorResolveResult::Error;
+ return true;
case OR_Deleted: {
if (Diagnose)
- S.DiagnoseUseOfDeletedFunction(LocalLookup.getNameLoc(), Range,
- LocalLookup.getLookupName(), Candidates,
- Best->Function, TrialArguments);
- return AllocatorResolveResult::Error;
+ S.DiagnoseUseOfDeletedFunction(R.getNameLoc(), Range, R.getLookupName(),
+ Candidates, Best->Function, Args);
+ return true;
}
}
llvm_unreachable("Unreachable, bad result from BestViableFunction");
@@ -2888,187 +2918,55 @@ static void LookupGlobalDeallocationFunctions(Sema &S, SourceLocation Loc,
}
}
-static void
-DiagnoseAllocationLookupFailure(Sema &SemaRef, const LookupResult &R,
- SourceRange Range,
- AllocationArgumentSet &ArgumentCandidates,
- ArrayRef<Expr *> PlacementArguments) {
- ImplicitAllocationArguments *UnalignedArgumentList = nullptr;
- ImplicitAllocationArguments *AlignedArgumentList = nullptr;
- bool IncludedMSVCFallback = false;
- for (ImplicitAllocationArguments &AllocationArguments : ArgumentCandidates) {
- if (AllocationArguments.IsMSVCCompatibilityFallback) {
- IncludedMSVCFallback = true;
- continue;
- }
- if (AllocationArguments.PassTypeIdentity == TypeAwareAllocationMode::Yes)
- continue;
- if (AllocationArguments.PassAlignment == AlignedAllocationMode::Yes)
- AlignedArgumentList = &AllocationArguments;
- else
- UnalignedArgumentList = &AllocationArguments;
- }
- if (!UnalignedArgumentList)
- return;
-
- // We re-resolve the rejected candidates for diagnostics rather than requiring
- // them to be tracked during the initial resolution path. This both simplifies
- // the resolution logic, and helps with performance.
- auto Rerun = [&](ImplicitAllocationArguments &ArgumentList,
- OverloadCandidateSet &Candidates,
- SmallVectorImpl<Expr *> &Args) {
- assert(!ArgumentList.IsMSVCCompatibilityFallback);
- llvm::append_range(Args, ArgumentList.getImplicitArguments());
- llvm::append_range(Args, PlacementArguments);
- FunctionDecl *Unused = nullptr;
- resolveAllocationOverload(SemaRef, R, Range, ArgumentList, Args, Unused,
- Candidates, /*Diagnose=*/false);
- };
- std::optional<OverloadCandidateSet> AlignedCandidates;
- Expr *AlignArg = nullptr;
- if (AlignedArgumentList) {
- AlignedCandidates.emplace(R.getNameLoc(), OverloadCandidateSet::CSK_Normal);
- SmallVector<Expr *, 4> AlignedArgs;
- Rerun(*AlignedArgumentList, *AlignedCandidates, AlignedArgs);
- AlignArg = AlignedArgumentList->getAlignmentArgument();
- }
- OverloadCandidateSet UnalignedCandidates(R.getNameLoc(),
- OverloadCandidateSet::CSK_Normal);
- SmallVector<Expr *, 4> UnalignedArgs;
- Rerun(*UnalignedArgumentList, UnalignedCandidates, UnalignedArgs);
- diagnoseNoViableFunctionForAllocationOverloadResolution(
- SemaRef, R, Range, UnalignedArgs, UnalignedCandidates,
- AlignedCandidates ? &*AlignedCandidates : nullptr, AlignArg,
- IncludedMSVCFallback);
-}
-
-Expr *Sema::tryGetTypeIdentityArgument(QualType Type, SourceLocation Loc) {
- if (auto Found = AllocationTypeIdentityArguments.find(Type);
- Found != AllocationTypeIdentityArguments.end())
- return Found->second;
-
- QualType TypeIdentity = tryBuildStdTypeIdentity(Type, Loc);
- if (TypeIdentity.isNull() ||
- RequireCompleteType(Loc, TypeIdentity, diag::err_incomplete_type))
- return nullptr;
-
- Expr *TypeIdentityArgument =
- new (Context) CXXScalarValueInitExpr(TypeIdentity, nullptr, Loc);
- AllocationTypeIdentityArguments.insert({Type, TypeIdentityArgument});
- return TypeIdentityArgument;
-}
-
-ImplicitAllocationArguments::ImplicitAllocationArguments(
- Sema &SemaRef, Expr *TypeIdentityArg, Expr *SizeArg, Expr *AlignArg,
- bool IsMSVCCompatibilityFallback)
- : PassTypeIdentity(typeAwareAllocationModeFromBool(TypeIdentityArg)),
- PassAlignment(alignedAllocationModeFromBool(AlignArg)),
- IsMSVCCompatibilityFallback(IsMSVCCompatibilityFallback),
- ArgumentCount(0) {
- ASTContext &Ctx = SemaRef.getASTContext();
- if (TypeIdentityArg) {
- assert(SemaRef.isStdTypeIdentity(TypeIdentityArg->getType(), nullptr));
- ImplicitArguments[ArgumentCount++] = TypeIdentityArg;
- }
- assert(SizeArg);
- assert(Ctx.hasSameType(SizeArg->getType(), Ctx.getSizeType()));
- ImplicitArguments[ArgumentCount++] = SizeArg;
- if (AlignArg) {
- assert(AlignArg->getType()->isAlignValT());
- ImplicitArguments[ArgumentCount++] = AlignArg;
- }
-}
-
-const LookupResult &
-ImplicitAllocationArguments::updateLookupForMSVCCompatibility(
- Sema &S, const LookupResult &BaseLookup,
- std::optional<LookupResult> &Buffer) const {
- if (!IsMSVCCompatibilityFallback)
- return BaseLookup;
- // MSVC will fall back on trying to find a matching global operator new
- // if operator new[] cannot be found. Also, MSVC will leak by not
- // generating a call to operator delete or operator delete[], but we
- // will not replicate that bug.
- // FIXME: Find out how this interacts with the std::align_val_t fallback
- // once MSVC implements it.
- LookupResult &Fallback = Buffer.emplace(LookupResult::Temporary, BaseLookup);
- Fallback.setLookupName(S.Context.DeclarationNames.getCXXOperatorName(OO_New));
- // FIXME: This will give bad diagnostics pointing at the wrong functions.
- S.LookupQualifiedName(Fallback, S.Context.getTranslationUnitDecl());
- return Fallback;
-}
-
-std::optional<AllocationArgumentSet>
-Sema::resolveAllocationArguments(LookupResult &R,
- const ImplicitAllocationParameters &IAP,
- ArrayRef<Expr *> PlacementArguments) {
- // FIXME: Should Sema create per-callsite versions expressions so they can be
- // reused during codegen? This would likely create yet another case where we
- // need to serialize information, however it would ensure identical arguments
- // between Sema and CodeGen.
- if (!AllocationSizeExpr) {
- DeclareGlobalNewDelete();
- QualType SizeTy = Context.getSizeType();
- unsigned SizeTyWidth = Context.getTypeSize(SizeTy);
- AllocationSizeExpr = IntegerLiteral::Create(
- Context, llvm::APInt::getZero(SizeTyWidth), SizeTy, SourceLocation());
- }
- if (!AllocationAlignmentExpr) {
- DeclareGlobalNewDelete();
- if (EnumDecl *StdAlignValT = getStdAlignValT()) {
- QualType AlignValT = Context.getCanonicalTagType(StdAlignValT);
- AllocationAlignmentExpr = new (Context)
- CXXScalarValueInitExpr(AlignValT, nullptr, SourceLocation());
- }
- }
-
- AllocationArgumentSet FoundArguments;
+static bool resolveAllocationOverload(
+ Sema &S, LookupResult &R, SourceRange Range, SmallVectorImpl<Expr *> &Args,
+ ImplicitAllocationParameters &IAP, FunctionDecl *&Operator,
+ OverloadCandidateSet *AlignedCandidates, Expr *AlignArg, bool Diagnose) {
+ Operator = nullptr;
if (isTypeAwareAllocation(IAP.PassTypeIdentity)) {
- Expr *TypeIdentityArgument =
- tryGetTypeIdentityArgument(IAP.Type, R.getNameLoc());
- if (!TypeIdentityArgument)
- return std::nullopt;
-
- Expr *AlignmentExpr = AllocationAlignmentExpr;
- if (!PlacementArguments.empty() &&
- PlacementArguments.front()->getType()->isAlignValT())
- AlignmentExpr = nullptr;
- FoundArguments.push_back(ImplicitAllocationArguments(
- *this, TypeIdentityArgument, AllocationSizeExpr, AlignmentExpr,
- /*IsMSVCCompatibilityFallback=*/false));
- }
-
- ImplicitAllocationArguments UnalignedArguments(
- *this, /*TypeIdentityArg=*/nullptr, AllocationSizeExpr,
- /*AlignArg=*/nullptr, /*IsMSVCCompatibilityFallback=*/false);
- ImplicitAllocationArguments AlignedArguments(
- *this, /*TypeIdentityArg=*/nullptr, AllocationSizeExpr,
- AllocationAlignmentExpr, /*IsMSVCCompatibilityFallback=*/false);
-
- // C++17 [expr.new]p13:
- // If no matching function is found and the allocated object type has
- // new-extended alignment, the alignment argument is removed from the
- // argument list, and overload resolution is performed again.
- if (IAP.PassAlignment == AlignedAllocationMode::Yes)
- FoundArguments.push_back(AlignedArguments);
- FoundArguments.push_back(UnalignedArguments);
-
- // The MSVC global fallback path
- if (getLangOpts().MSVCCompat &&
- R.getLookupName().getCXXOverloadedOperator() == OO_Array_New)
- FoundArguments.push_back(ImplicitAllocationArguments(
- *this, /*TypeIdentityArg=*/nullptr, AllocationSizeExpr,
- /*AlignArg=*/nullptr, /*IsMSVCCompatibilityFallback=*/true));
- return FoundArguments;
-}
+ assert(S.isStdTypeIdentity(Args[0]->getType(), nullptr));
+ // The internal overload resolution work mutates the argument list
+ // in accordance with the spec. We may want to change that in future,
+ // but for now we deal with this by making a copy of the non-type-identity
+ // arguments.
+ SmallVector<Expr *> UntypedParameters;
+ UntypedParameters.reserve(Args.size() - 1);
+ UntypedParameters.push_back(Args[1]);
+ // Type aware allocation implicitly includes the alignment parameter so
+ // only include it in the untyped parameter list if alignment was explicitly
+ // requested
+ if (isAlignedAllocation(IAP.PassAlignment))
+ UntypedParameters.push_back(Args[2]);
+ UntypedParameters.append(Args.begin() + 3, Args.end());
+
+ AlignedAllocationMode InitialAlignmentMode = IAP.PassAlignment;
+ IAP.PassAlignment = AlignedAllocationMode::Yes;
+ if (resolveAllocationOverloadInterior(
+ S, R, Range, ResolveMode::Typed, Args, IAP.PassAlignment, Operator,
+ AlignedCandidates, AlignArg, Diagnose))
+ return true;
+ if (Operator)
+ return false;
-std::optional<ResolvedAllocation>
-Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
- AllocationFunctionScope NewScope,
- AllocationFunctionScope DeleteScope,
- QualType AllocType, bool IsArray,
- const ImplicitAllocationParameters &RequestedIAP,
- MultiExprArg PlaceArgs, bool Diagnose) {
+ // If we got to this point we could not find a matching typed operator
+ // so we update the IAP flags, and revert to our stored copy of the
+ // type-identity-less argument list.
+ IAP.PassTypeIdentity = TypeAwareAllocationMode::No;
+ IAP.PassAlignment = InitialAlignmentMode;
+ Args = std::move(UntypedParameters);
+ }
+ assert(!S.isStdTypeIdentity(Args[0]->getType(), nullptr));
+ return resolveAllocationOverloadInterior(
+ S, R, Range, ResolveMode::Untyped, Args, IAP.PassAlignment, Operator,
+ AlignedCandidates, AlignArg, Diagnose);
+}
+
+bool Sema::FindAllocationFunctions(
+ SourceLocation StartLoc, SourceRange Range,
+ AllocationFunctionScope NewScope, AllocationFunctionScope DeleteScope,
+ QualType AllocType, bool IsArray, ImplicitAllocationParameters &IAP,
+ MultiExprArg PlaceArgs, FunctionDecl *&OperatorNew,
+ FunctionDecl *&OperatorDelete, bool Diagnose) {
// --- Choosing an allocation function ---
// C++ 5.3.4p8 - 14 & 18
// 1) If looking in AllocationFunctionScope::Global scope for allocation
@@ -3081,6 +2979,9 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
// 3) The first argument is always size_t. Append the arguments from the
// placement form.
+ SmallVector<Expr*, 8> AllocArgs;
+ AllocArgs.reserve(IAP.getNumImplicitArgs() + PlaceArgs.size());
+
// C++ [expr.new]p8:
// If the allocated type is a non-array type, the allocation
// function's name is operator new and the deallocation function's
@@ -3092,10 +2993,49 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
QualType AllocElemType = Context.getBaseElementType(AllocType);
- ResolvedAllocation Result = {/*OperatorNew=*/nullptr,
- /*OperatorDelete=*/nullptr,
- RequestedIAP,
- {}};
+ // We don't care about the actual value of these arguments.
+ // FIXME: Should the Sema create the expression and embed it in the syntax
+ // tree? Or should the consumer just recalculate the value?
+ // FIXME: Using a dummy value will interact poorly with attribute enable_if.
+
+ // We use size_t as a stand in so that we can construct the init
+ // expr on the stack
+ QualType TypeIdentity = Context.getSizeType();
+ if (isTypeAwareAllocation(IAP.PassTypeIdentity)) {
+ QualType SpecializedTypeIdentity =
+ tryBuildStdTypeIdentity(IAP.Type, StartLoc);
+ if (!SpecializedTypeIdentity.isNull()) {
+ TypeIdentity = SpecializedTypeIdentity;
+ if (RequireCompleteType(StartLoc, TypeIdentity,
+ diag::err_incomplete_type))
+ return true;
+ } else
+ IAP.PassTypeIdentity = TypeAwareAllocationMode::No;
+ }
+ TypeAwareAllocationMode OriginalTypeAwareState = IAP.PassTypeIdentity;
+
+ CXXScalarValueInitExpr TypeIdentityParam(TypeIdentity, nullptr, StartLoc);
+ if (isTypeAwareAllocation(IAP.PassTypeIdentity))
+ AllocArgs.push_back(&TypeIdentityParam);
+
+ QualType SizeTy = Context.getSizeType();
+ unsigned SizeTyWidth = Context.getTypeSize(SizeTy);
+ IntegerLiteral Size(Context, llvm::APInt::getZero(SizeTyWidth), SizeTy,
+ SourceLocation());
+ AllocArgs.push_back(&Size);
+
+ QualType AlignValT = Context.VoidTy;
+ bool IncludeAlignParam = isAlignedAllocation(IAP.PassAlignment) ||
+ isTypeAwareAllocation(IAP.PassTypeIdentity);
+ if (IncludeAlignParam) {
+ DeclareGlobalNewDelete();
+ AlignValT = Context.getCanonicalTagType(getStdAlignValT());
+ }
+ CXXScalarValueInitExpr Align(AlignValT, nullptr, SourceLocation());
+ if (IncludeAlignParam)
+ AllocArgs.push_back(&Align);
+
+ llvm::append_range(AllocArgs, PlaceArgs);
// Find the allocation function.
{
@@ -3113,14 +3053,14 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
// We can see ambiguity here if the allocation function is found in
// multiple base classes.
if (R.isAmbiguous())
- return std::nullopt;
+ return true;
// If this lookup fails to find the name, or if the allocated type is not
// a class type, the allocation function's name is looked up in the
// global scope.
if (R.empty()) {
if (NewScope == AllocationFunctionScope::Class)
- return std::nullopt;
+ return true;
LookupQualifiedName(R, Context.getTranslationUnitDecl());
}
@@ -3131,7 +3071,7 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
} else {
Diag(StartLoc, diag::err_openclcxx_placement_new);
}
- return std::nullopt;
+ return true;
}
assert(!R.empty() && "implicitly declared allocation functions not found");
@@ -3140,44 +3080,17 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
// We do our own custom access checks below.
R.suppressDiagnostics();
- std::optional<AllocationArgumentSet> ArgumentListCandidates =
- resolveAllocationArguments(R, RequestedIAP, PlaceArgs);
- if (!ArgumentListCandidates)
- return std::nullopt;
-
- for (ImplicitAllocationArguments &ArgumentList : *ArgumentListCandidates) {
- SmallVector<Expr *, 4> TrialArguments(
- ArgumentList.getImplicitArguments());
- llvm::append_range(TrialArguments, PlaceArgs);
- OverloadCandidateSet OverloadCandidates(R.getNameLoc(),
- OverloadCandidateSet::CSK_Normal);
- FunctionDecl *Operator = nullptr;
- switch (resolveAllocationOverload(*this, R, Range, ArgumentList,
- TrialArguments, Operator,
- OverloadCandidates, Diagnose)) {
- case AllocatorResolveResult::Error:
- return std::nullopt;
- case AllocatorResolveResult::Retry:
- continue;
- case AllocatorResolveResult::Success:
- Result.OperatorNew = Operator;
- Result.IAP.PassTypeIdentity = ArgumentList.PassTypeIdentity;
- Result.IAP.PassAlignment = ArgumentList.PassAlignment;
- Result.Arguments = std::move(TrialArguments);
- goto foundCandidate;
- }
- }
- if (Diagnose)
- DiagnoseAllocationLookupFailure(*this, R, Range, *ArgumentListCandidates,
- PlaceArgs);
- return std::nullopt;
+ if (resolveAllocationOverload(*this, R, Range, AllocArgs, IAP, OperatorNew,
+ /*Candidates=*/nullptr,
+ /*AlignArg=*/nullptr, Diagnose))
+ return true;
}
-foundCandidate:
- FunctionDecl *OperatorNew = Result.OperatorNew;
// We don't need an operator delete if we're running under -fno-exceptions.
- if (!getLangOpts().Exceptions)
- return Result;
+ if (!getLangOpts().Exceptions) {
+ OperatorDelete = nullptr;
+ return false;
+ }
// Note, the name of OperatorNew might have been changed from array to
// non-array by resolveAllocationOverload.
@@ -3202,7 +3115,7 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
LookupQualifiedName(FoundDelete, RD);
}
if (FoundDelete.isAmbiguous())
- return std::nullopt; // FIXME: clean up expressions?
+ return true; // FIXME: clean up expressions?
// Filter out any destroying operator deletes. We can't possibly call such a
// function in this context, because we're handling the case where the object
@@ -3226,10 +3139,10 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
bool FoundGlobalDelete = FoundDelete.empty();
bool IsClassScopedTypeAwareNew =
- isTypeAwareAllocation(Result.IAP.PassTypeIdentity) &&
+ isTypeAwareAllocation(IAP.PassTypeIdentity) &&
OperatorNewContext->isRecord();
auto DiagnoseMissingTypeAwareCleanupOperator = [&](bool IsPlacementOperator) {
- assert(isTypeAwareAllocation(Result.IAP.PassTypeIdentity));
+ assert(isTypeAwareAllocation(IAP.PassTypeIdentity));
if (Diagnose) {
Diag(StartLoc, diag::err_mismatching_type_aware_cleanup_deallocator)
<< OperatorNew->getDeclName() << IsPlacementOperator << DeleteName;
@@ -3240,19 +3153,18 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
};
if (IsClassScopedTypeAwareNew && FoundDelete.empty()) {
DiagnoseMissingTypeAwareCleanupOperator(/*isPlacementNew=*/false);
- return std::nullopt;
+ return true;
}
if (FoundDelete.empty()) {
FoundDelete.clear(LookupOrdinaryName);
if (DeleteScope == AllocationFunctionScope::Class)
- return std::nullopt;
+ return true;
DeclareGlobalNewDelete();
- DeallocLookupMode LookupMode =
- isTypeAwareAllocation(RequestedIAP.PassTypeIdentity)
- ? DeallocLookupMode::OptionallyTyped
- : DeallocLookupMode::Untyped;
+ DeallocLookupMode LookupMode = isTypeAwareAllocation(OriginalTypeAwareState)
+ ? DeallocLookupMode::OptionallyTyped
+ : DeallocLookupMode::Untyped;
LookupGlobalDeallocationFunctions(*this, StartLoc, FoundDelete, LookupMode,
DeleteName);
}
@@ -3276,7 +3188,7 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
// type uses the sized or non-sized form of aligned operator delete.
unsigned NonPlacementNewArgCount = 1; // size parameter
- if (isTypeAwareAllocation(Result.IAP.PassTypeIdentity))
+ if (isTypeAwareAllocation(IAP.PassTypeIdentity))
NonPlacementNewArgCount =
/* type-identity */ 1 + /* size */ 1 + /* alignment */ 1;
bool isPlacementNew = !PlaceArgs.empty() ||
@@ -3300,8 +3212,8 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
SmallVector<QualType, 6> ArgTypes;
int InitialParamOffset = 0;
- if (isTypeAwareAllocation(Result.IAP.PassTypeIdentity)) {
- ArgTypes.push_back(Result.Arguments.front()->getType());
+ if (isTypeAwareAllocation(IAP.PassTypeIdentity)) {
+ ArgTypes.push_back(TypeIdentity);
InitialParamOffset = 1;
}
ArgTypes.push_back(Context.VoidPtrTy);
@@ -3343,9 +3255,9 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
if (getLangOpts().CUDA)
CUDA().EraseUnwantedMatches(getCurFunctionDecl(/*AllowLambda=*/true),
Matches);
- if (Matches.empty() && isTypeAwareAllocation(Result.IAP.PassTypeIdentity)) {
+ if (Matches.empty() && isTypeAwareAllocation(IAP.PassTypeIdentity)) {
DiagnoseMissingTypeAwareCleanupOperator(isPlacementNew);
- return std::nullopt;
+ return true;
}
} else {
// C++1y [expr.new]p22:
@@ -3357,7 +3269,7 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
// with a size_t where possible (which it always is in this case).
llvm::SmallVector<UsualDeallocFnInfo, 4> BestDeallocFns;
ImplicitDeallocationParameters IDP = {
- AllocElemType, RequestedIAP.PassTypeIdentity,
+ AllocElemType, OriginalTypeAwareState,
alignedAllocationModeFromBool(
hasNewExtendedAlignment(*this, AllocElemType)),
sizedDeallocationModeFromBool(FoundGlobalDelete)};
@@ -3378,8 +3290,7 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
// function, that function will be called; otherwise, no
// deallocation function will be called.
if (Matches.size() == 1) {
- Result.OperatorDelete = Matches[0].second;
- FunctionDecl *OperatorDelete = Result.OperatorDelete;
+ OperatorDelete = Matches[0].second;
DeclContext *OperatorDeleteContext = GetRedeclContext(OperatorDelete);
bool FoundTypeAwareOperator =
OperatorDelete->isTypeAwareOperatorNewOrDelete() ||
@@ -3437,8 +3348,7 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
IsSizedDelete = false;
}
- if (IsSizedDelete &&
- !isTypeAwareAllocation(Result.IAP.PassTypeIdentity)) {
+ if (IsSizedDelete && !isTypeAwareAllocation(IAP.PassTypeIdentity)) {
SourceRange R = PlaceArgs.empty()
? SourceRange()
: SourceRange(PlaceArgs.front()->getBeginLoc(),
@@ -3452,7 +3362,7 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
if (CheckDeleteOperator(*this, StartLoc, Range, Diagnose,
FoundDelete.getNamingClass(), Matches[0].first,
Matches[0].second))
- return std::nullopt;
+ return true;
} else if (!Matches.empty()) {
// We found multiple suitable operators. Per [expr.new]p20, that means we
@@ -3466,7 +3376,7 @@ Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
diag::note_member_declared_here) << DeleteName;
}
- return Result;
+ return false;
}
void Sema::DeclareGlobalNewDelete() {
diff --git a/clang/test/AST/ByteCode/invalid.cpp b/clang/test/AST/ByteCode/invalid.cpp
index 247c8ad732708..0e6d2d4b508b8 100644
--- a/clang/test/AST/ByteCode/invalid.cpp
+++ b/clang/test/AST/ByteCode/invalid.cpp
@@ -241,9 +241,3 @@ namespace InheritedCtor {
SS ss{42};
}
-
-namespace InvalidStaticInvoker {
- auto foo = [](bar) { int j; return j; }; // both-error {{unknown type name 'bar'}}
- constexpr int (*baz)(int) = foo;
- int i = baz(42);
-}
diff --git a/clang/test/CIR/CodeGenHIP/builtins-amdgcn-gfx10.hip b/clang/test/CIR/CodeGenHIP/builtins-amdgcn-gfx10.hip
deleted file mode 100644
index 0ff6a5f7b83d1..0000000000000
--- a/clang/test/CIR/CodeGenHIP/builtins-amdgcn-gfx10.hip
+++ /dev/null
@@ -1,58 +0,0 @@
-// REQUIRES: amdgpu-registered-target
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1010 -fcuda-is-device -emit-cir %s -o %t.cir
-// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1011 -fcuda-is-device -emit-cir %s -o %t.cir
-// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1012 -fcuda-is-device -emit-cir %s -o %t.cir
-// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1010 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1011 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \
-// RUN: -target-cpu gfx1012 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \
-// RUN: -target-cpu gfx1010 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \
-// RUN: -target-cpu gfx1011 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \
-// RUN: -target-cpu gfx1012 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-#define __device__ __attribute__((device))
-
-//===----------------------------------------------------------------------===//
-// Test AMDGPU builtins
-//===----------------------------------------------------------------------===//
-
-// CIR-LABEL: @_Z15test_permlane16Pjjjjj
-// CIR: cir.call_llvm_intrinsic "amdgcn.permlane16" {{.*}} : (!u32i, !u32i, !u32i, !u32i, !cir.bool, !cir.bool) -> !u32i
-// LLVM: define{{.*}} void @_Z15test_permlane16Pjjjjj
-// LLVM: call i32 @llvm.amdgcn.permlane16.i32(i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 false, i1 false)
-__device__ void test_permlane16(unsigned int* out, unsigned int a, unsigned int b, unsigned int c, unsigned int d) {
- *out = __builtin_amdgcn_permlane16(a, b, c, d, 0, 0);
-}
-
-// CIR-LABEL: @_Z16test_permlanex16Pjjjjj
-// CIR: cir.call_llvm_intrinsic "amdgcn.permlanex16" {{.*}} : (!u32i, !u32i, !u32i, !u32i, !cir.bool, !cir.bool) -> !u32i
-// LLVM: define{{.*}} void @_Z16test_permlanex16Pjjjjj
-// LLVM: call i32 @llvm.amdgcn.permlanex16.i32(i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i32 %{{.*}}, i1 false, i1 false)
-__device__ void test_permlanex16(unsigned int* out, unsigned int a, unsigned int b, unsigned int c, unsigned int d) {
- *out = __builtin_amdgcn_permlanex16(a, b, c, d, 0, 0);
-}
diff --git a/clang/test/CIR/CodeGenHIP/builtins-amdgcn-gfx11.hip b/clang/test/CIR/CodeGenHIP/builtins-amdgcn-gfx11.hip
deleted file mode 100644
index a6fb1c11e47ab..0000000000000
--- a/clang/test/CIR/CodeGenHIP/builtins-amdgcn-gfx11.hip
+++ /dev/null
@@ -1,110 +0,0 @@
-// REQUIRES: amdgpu-registered-target
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1100 -fcuda-is-device -emit-cir %s -o %t.cir
-// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1101 -fcuda-is-device -emit-cir %s -o %t.cir
-// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1102 -fcuda-is-device -emit-cir %s -o %t.cir
-// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1103 -fcuda-is-device -emit-cir %s -o %t.cir
-// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1150 -fcuda-is-device -emit-cir %s -o %t.cir
-// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1151 -fcuda-is-device -emit-cir %s -o %t.cir
-// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1152 -fcuda-is-device -emit-cir %s -o %t.cir
-// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1153 -fcuda-is-device -emit-cir %s -o %t.cir
-// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1100 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1101 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1102 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1103 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1150 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1151 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1152 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \
-// RUN: -target-cpu gfx1153 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \
-// RUN: -target-cpu gfx1100 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \
-// RUN: -target-cpu gfx1101 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \
-// RUN: -target-cpu gfx1102 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \
-// RUN: -target-cpu gfx1103 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \
-// RUN: -target-cpu gfx1150 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \
-// RUN: -target-cpu gfx1151 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \
-// RUN: -target-cpu gfx1152 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \
-// RUN: -target-cpu gfx1153 -fcuda-is-device -emit-llvm %s -o %t.ll
-// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
-
-#define __device__ __attribute__((device))
-
-//===----------------------------------------------------------------------===//
-// Test AMDGPU builtins
-//===----------------------------------------------------------------------===//
-
-// CIR-LABEL: @_Z15test_permlane64Pjj
-// CIR: cir.call_llvm_intrinsic "amdgcn.permlane64" {{.*}} : (!u32i) -> !u32i
-// LLVM: define{{.*}} void @_Z15test_permlane64Pjj
-// LLVM: call i32 @llvm.amdgcn.permlane64.i32(i32 %{{.*}})
-__device__ void test_permlane64(unsigned int* out, unsigned int a) {
- *out = __builtin_amdgcn_permlane64(a);
-}
diff --git a/clang/test/CodeGen/Sparc/sparcv9-vaarg.c b/clang/test/CodeGen/Sparc/sparcv9-vaarg.c
deleted file mode 100644
index a23d9f1c6506f..0000000000000
--- a/clang/test/CodeGen/Sparc/sparcv9-vaarg.c
+++ /dev/null
@@ -1,245 +0,0 @@
-// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 6
-// RUN: %clang_cc1 -triple sparc64 -emit-llvm -o - %s | FileCheck %s
-#include <stdarg.h>
-
-// CHECK-LABEL: define dso_local signext i32 @get_int(
-// CHECK-SAME: ptr noundef [[ARGS:%.*]]) #[[ATTR0:[0-9]+]] {
-// CHECK-NEXT: [[ENTRY:.*:]]
-// CHECK-NEXT: [[ARGS_ADDR:%.*]] = alloca ptr, align 8
-// CHECK-NEXT: store ptr [[ARGS]], ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[ARGP_CUR:%.*]] = load ptr, ptr [[TMP0]], align 8
-// CHECK-NEXT: [[ARGP_NEXT:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR]], i64 8
-// CHECK-NEXT: store ptr [[ARGP_NEXT]], ptr [[TMP0]], align 8
-// CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR]], i64 4
-// CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
-// CHECK-NEXT: ret i32 [[TMP2]]
-//
-int get_int(va_list *args) {
- return va_arg(*args, int);
-}
-
-enum RGB { R = 1, G = 2, B = 3 };
-
-// Enums are passed like integers.
-// CHECK-LABEL: define dso_local zeroext i32 @get_enum(
-// CHECK-SAME: ptr noundef [[ARGS:%.*]]) #[[ATTR0]] {
-// CHECK-NEXT: [[ENTRY:.*:]]
-// CHECK-NEXT: [[ARGS_ADDR:%.*]] = alloca ptr, align 8
-// CHECK-NEXT: store ptr [[ARGS]], ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[ARGP_CUR:%.*]] = load ptr, ptr [[TMP0]], align 8
-// CHECK-NEXT: [[ARGP_NEXT:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR]], i64 8
-// CHECK-NEXT: store ptr [[ARGP_NEXT]], ptr [[TMP0]], align 8
-// CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR]], i64 4
-// CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
-// CHECK-NEXT: ret i32 [[TMP2]]
-//
-enum RGB get_enum(va_list *args) {
- return va_arg(*args, enum RGB);
-}
-
-// long long (i64) is passed directly, note how ARGP_CUR is advanced by 8.
-// CHECK-LABEL: define dso_local i64 @get_long_long(
-// CHECK-SAME: ptr noundef [[ARGS:%.*]]) #[[ATTR0]] {
-// CHECK-NEXT: [[ENTRY:.*:]]
-// CHECK-NEXT: [[ARGS_ADDR:%.*]] = alloca ptr, align 8
-// CHECK-NEXT: store ptr [[ARGS]], ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[ARGP_CUR:%.*]] = load ptr, ptr [[TMP0]], align 8
-// CHECK-NEXT: [[ARGP_NEXT:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR]], i64 8
-// CHECK-NEXT: store ptr [[ARGP_NEXT]], ptr [[TMP0]], align 8
-// CHECK-NEXT: [[TMP1:%.*]] = load i64, ptr [[ARGP_CUR]], align 8
-// CHECK-NEXT: ret i64 [[TMP1]]
-//
-long long get_long_long(va_list *args) {
- return va_arg(*args, long long);
-}
-
-struct Tiny {
- char x;
-};
-
-// Structs up to 16 bytes are passed directly. Note how a small struct is left-aligned within the slot,
-// hence the shl by 56.
-// CHECK-LABEL: define dso_local i64 @get_struct_char(
-// CHECK-SAME: ptr noundef [[ARGS:%.*]]) #[[ATTR0]] {
-// CHECK-NEXT: [[ENTRY:.*:]]
-// CHECK-NEXT: [[RETVAL:%.*]] = alloca [[STRUCT_TINY:%.*]], align 1
-// CHECK-NEXT: [[ARGS_ADDR:%.*]] = alloca ptr, align 8
-// CHECK-NEXT: store ptr [[ARGS]], ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[ARGP_CUR:%.*]] = load ptr, ptr [[TMP0]], align 8
-// CHECK-NEXT: [[ARGP_NEXT:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR]], i64 8
-// CHECK-NEXT: store ptr [[ARGP_NEXT]], ptr [[TMP0]], align 8
-// CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 [[RETVAL]], ptr align 8 [[ARGP_CUR]], i64 1, i1 false)
-// CHECK-NEXT: [[COERCE_DIVE:%.*]] = getelementptr inbounds nuw [[STRUCT_TINY]], ptr [[RETVAL]], i32 0, i32 0
-// CHECK-NEXT: [[TMP1:%.*]] = load i8, ptr [[COERCE_DIVE]], align 1
-// CHECK-NEXT: [[COERCE_VAL_II:%.*]] = zext i8 [[TMP1]] to i64
-// CHECK-NEXT: [[COERCE_HIGHBITS:%.*]] = shl i64 [[COERCE_VAL_II]], 56
-// CHECK-NEXT: ret i64 [[COERCE_HIGHBITS]]
-//
-struct Tiny get_struct_char(va_list *args) {
- return va_arg(*args, struct Tiny);
-}
-
-struct Large {
- long long x;
- long long y;
- long long z;
-};
-
-// Larger aggregates are passed indirectly, note how ARGP_CUR is advanced by 8.
-// CHECK-LABEL: define dso_local %struct.Large @get_struct_long_long(
-// CHECK-SAME: ptr noundef [[ARGS:%.*]]) #[[ATTR0]] {
-// CHECK-NEXT: [[ENTRY:.*:]]
-// CHECK-NEXT: [[RETVAL:%.*]] = alloca [[STRUCT_LARGE:%.*]], align 8
-// CHECK-NEXT: [[ARGS_ADDR:%.*]] = alloca ptr, align 8
-// CHECK-NEXT: store ptr [[ARGS]], ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[ARGP_CUR:%.*]] = load ptr, ptr [[TMP0]], align 8
-// CHECK-NEXT: [[ARGP_NEXT:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR]], i64 8
-// CHECK-NEXT: store ptr [[ARGP_NEXT]], ptr [[TMP0]], align 8
-// CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr [[ARGP_CUR]], align 8
-// CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[RETVAL]], ptr align 8 [[TMP1]], i64 24, i1 false)
-// CHECK-NEXT: [[TMP2:%.*]] = load [[STRUCT_LARGE]], ptr [[RETVAL]], align 8
-// CHECK-NEXT: ret [[STRUCT_LARGE]] [[TMP2]]
-//
-struct Large get_struct_long_long(va_list *args) {
- return va_arg(*args, struct Large);
-}
-
-// long double is passed directly, and aligned to 16.
-// CHECK-LABEL: define dso_local fp128 @get_long_double(
-// CHECK-SAME: ptr noundef [[ARGS:%.*]]) #[[ATTR0]] {
-// CHECK-NEXT: [[ENTRY:.*:]]
-// CHECK-NEXT: [[ARGS_ADDR:%.*]] = alloca ptr, align 8
-// CHECK-NEXT: store ptr [[ARGS]], ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[ARGP_CUR:%.*]] = load ptr, ptr [[TMP0]], align 8
-// CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR]], i32 15
-// CHECK-NEXT: [[ARGP_CUR_ALIGNED:%.*]] = call ptr @llvm.ptrmask.p0.i64(ptr [[TMP1]], i64 -16)
-// CHECK-NEXT: [[ARGP_NEXT:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR_ALIGNED]], i64 16
-// CHECK-NEXT: store ptr [[ARGP_NEXT]], ptr [[TMP0]], align 8
-// CHECK-NEXT: [[TMP2:%.*]] = load fp128, ptr [[ARGP_CUR_ALIGNED]], align 16
-// CHECK-NEXT: ret fp128 [[TMP2]]
-//
-long double get_long_double(va_list *args) {
- return va_arg(*args, long double);
-}
-
-// __int128 is passed directly, and aligned to 16.
-// CHECK-LABEL: define dso_local i128 @get_int128(
-// CHECK-SAME: ptr noundef [[ARGS:%.*]]) #[[ATTR0]] {
-// CHECK-NEXT: [[ENTRY:.*:]]
-// CHECK-NEXT: [[ARGS_ADDR:%.*]] = alloca ptr, align 8
-// CHECK-NEXT: store ptr [[ARGS]], ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[ARGP_CUR:%.*]] = load ptr, ptr [[TMP0]], align 8
-// CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR]], i32 15
-// CHECK-NEXT: [[ARGP_CUR_ALIGNED:%.*]] = call ptr @llvm.ptrmask.p0.i64(ptr [[TMP1]], i64 -16)
-// CHECK-NEXT: [[ARGP_NEXT:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR_ALIGNED]], i64 16
-// CHECK-NEXT: store ptr [[ARGP_NEXT]], ptr [[TMP0]], align 8
-// CHECK-NEXT: [[TMP2:%.*]] = load i128, ptr [[ARGP_CUR_ALIGNED]], align 16
-// CHECK-NEXT: ret i128 [[TMP2]]
-//
-__int128 get_int128(va_list *args) {
- return va_arg(*args, __int128);
-}
-
-_Complex char complex_char_sink;
-
-// FIXME: _Complex char should be passed in the right-most bytes of the slot, using a getelementptr with a value of 6.
-// CHECK-LABEL: define dso_local void @get_complex_char(
-// CHECK-SAME: ptr noundef [[ARGS:%.*]]) #[[ATTR0]] {
-// CHECK-NEXT: [[ENTRY:.*:]]
-// CHECK-NEXT: [[ARGS_ADDR:%.*]] = alloca ptr, align 8
-// CHECK-NEXT: store ptr [[ARGS]], ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[ARGP_CUR:%.*]] = load ptr, ptr [[TMP0]], align 8
-// CHECK-NEXT: [[ARGP_NEXT:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR]], i64 8
-// CHECK-NEXT: store ptr [[ARGP_NEXT]], ptr [[TMP0]], align 8
-// CHECK-NEXT: [[ARGP_CUR_REALP:%.*]] = getelementptr inbounds nuw { i8, i8 }, ptr [[ARGP_CUR]], i32 0, i32 0
-// CHECK-NEXT: [[ARGP_CUR_REAL:%.*]] = load i8, ptr [[ARGP_CUR_REALP]], align 8
-// CHECK-NEXT: [[ARGP_CUR_IMAGP:%.*]] = getelementptr inbounds nuw { i8, i8 }, ptr [[ARGP_CUR]], i32 0, i32 1
-// CHECK-NEXT: [[ARGP_CUR_IMAG:%.*]] = load i8, ptr [[ARGP_CUR_IMAGP]], align 1
-// CHECK-NEXT: store i8 [[ARGP_CUR_REAL]], ptr @complex_char_sink, align 1
-// CHECK-NEXT: store i8 [[ARGP_CUR_IMAG]], ptr getelementptr inbounds nuw (i8, ptr @complex_char_sink, i64 1), align 1
-// CHECK-NEXT: ret void
-//
-void get_complex_char(va_list *args) {
- complex_char_sink = va_arg(*args, _Complex char);
-}
-
-_Complex int complex_int_sink;
-
-// _Complex int is passed directly.
-// CHECK-LABEL: define dso_local void @get_complex_int(
-// CHECK-SAME: ptr noundef [[ARGS:%.*]]) #[[ATTR0]] {
-// CHECK-NEXT: [[ENTRY:.*:]]
-// CHECK-NEXT: [[ARGS_ADDR:%.*]] = alloca ptr, align 8
-// CHECK-NEXT: store ptr [[ARGS]], ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[ARGP_CUR:%.*]] = load ptr, ptr [[TMP0]], align 8
-// CHECK-NEXT: [[ARGP_NEXT:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR]], i64 8
-// CHECK-NEXT: store ptr [[ARGP_NEXT]], ptr [[TMP0]], align 8
-// CHECK-NEXT: [[ARGP_CUR_REALP:%.*]] = getelementptr inbounds nuw { i32, i32 }, ptr [[ARGP_CUR]], i32 0, i32 0
-// CHECK-NEXT: [[ARGP_CUR_REAL:%.*]] = load i32, ptr [[ARGP_CUR_REALP]], align 8
-// CHECK-NEXT: [[ARGP_CUR_IMAGP:%.*]] = getelementptr inbounds nuw { i32, i32 }, ptr [[ARGP_CUR]], i32 0, i32 1
-// CHECK-NEXT: [[ARGP_CUR_IMAG:%.*]] = load i32, ptr [[ARGP_CUR_IMAGP]], align 4
-// CHECK-NEXT: store i32 [[ARGP_CUR_REAL]], ptr @complex_int_sink, align 4
-// CHECK-NEXT: store i32 [[ARGP_CUR_IMAG]], ptr getelementptr inbounds nuw (i8, ptr @complex_int_sink, i64 4), align 4
-// CHECK-NEXT: ret void
-//
-void get_complex_int(va_list *args) {
- complex_int_sink = va_arg(*args, _Complex int);
-}
-
-_Complex long long complex_long_long_sink;
-
-// _Complex long long is passed directly, note how ARGP_CUR is advanced by 16.
-// CHECK-LABEL: define dso_local void @get_complex_long_long(
-// CHECK-SAME: ptr noundef [[ARGS:%.*]]) #[[ATTR0]] {
-// CHECK-NEXT: [[ENTRY:.*:]]
-// CHECK-NEXT: [[ARGS_ADDR:%.*]] = alloca ptr, align 8
-// CHECK-NEXT: store ptr [[ARGS]], ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[ARGP_CUR:%.*]] = load ptr, ptr [[TMP0]], align 8
-// CHECK-NEXT: [[ARGP_NEXT:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR]], i64 16
-// CHECK-NEXT: store ptr [[ARGP_NEXT]], ptr [[TMP0]], align 8
-// CHECK-NEXT: [[ARGP_CUR_REALP:%.*]] = getelementptr inbounds nuw { i64, i64 }, ptr [[ARGP_CUR]], i32 0, i32 0
-// CHECK-NEXT: [[ARGP_CUR_REAL:%.*]] = load i64, ptr [[ARGP_CUR_REALP]], align 8
-// CHECK-NEXT: [[ARGP_CUR_IMAGP:%.*]] = getelementptr inbounds nuw { i64, i64 }, ptr [[ARGP_CUR]], i32 0, i32 1
-// CHECK-NEXT: [[ARGP_CUR_IMAG:%.*]] = load i64, ptr [[ARGP_CUR_IMAGP]], align 8
-// CHECK-NEXT: store i64 [[ARGP_CUR_REAL]], ptr @complex_long_long_sink, align 8
-// CHECK-NEXT: store i64 [[ARGP_CUR_IMAG]], ptr getelementptr inbounds nuw (i8, ptr @complex_long_long_sink, i64 8), align 8
-// CHECK-NEXT: ret void
-//
-void get_complex_long_long (va_list *args) {
- complex_long_long_sink = va_arg(*args, _Complex long long );
-}
-
-_Complex long double complex_long_double_sink;
-
-// _Complex long double is passed indirectly, note how ARGP_CUR is advanced by 8.
-// CHECK-LABEL: define dso_local void @get_complex_long_double(
-// CHECK-SAME: ptr noundef [[ARGS:%.*]]) #[[ATTR0]] {
-// CHECK-NEXT: [[ENTRY:.*:]]
-// CHECK-NEXT: [[ARGS_ADDR:%.*]] = alloca ptr, align 8
-// CHECK-NEXT: store ptr [[ARGS]], ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGS_ADDR]], align 8
-// CHECK-NEXT: [[ARGP_CUR:%.*]] = load ptr, ptr [[TMP0]], align 8
-// CHECK-NEXT: [[ARGP_NEXT:%.*]] = getelementptr inbounds i8, ptr [[ARGP_CUR]], i64 8
-// CHECK-NEXT: store ptr [[ARGP_NEXT]], ptr [[TMP0]], align 8
-// CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr [[ARGP_CUR]], align 8
-// CHECK-NEXT: [[DOTREALP:%.*]] = getelementptr inbounds nuw { fp128, fp128 }, ptr [[TMP1]], i32 0, i32 0
-// CHECK-NEXT: [[DOTREAL:%.*]] = load fp128, ptr [[DOTREALP]], align 16
-// CHECK-NEXT: [[DOTIMAGP:%.*]] = getelementptr inbounds nuw { fp128, fp128 }, ptr [[TMP1]], i32 0, i32 1
-// CHECK-NEXT: [[DOTIMAG:%.*]] = load fp128, ptr [[DOTIMAGP]], align 16
-// CHECK-NEXT: store fp128 [[DOTREAL]], ptr @complex_long_double_sink, align 16
-// CHECK-NEXT: store fp128 [[DOTIMAG]], ptr getelementptr inbounds nuw (i8, ptr @complex_long_double_sink, i64 16), align 16
-// CHECK-NEXT: ret void
-//
-void get_complex_long_double(va_list *args) {
- complex_long_double_sink = va_arg(*args, _Complex long double);
-}
diff --git a/clang/test/CodeGen/kcfi-hash.c b/clang/test/CodeGen/kcfi-hash.c
index 68ff2a9217e51..636d265feb9b4 100644
--- a/clang/test/CodeGen/kcfi-hash.c
+++ b/clang/test/CodeGen/kcfi-hash.c
@@ -2,12 +2,6 @@
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fsanitize=kcfi -fsanitize-kcfi-hash=xxHash64 -o - %s | FileCheck --check-prefix=XXHASH %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -fsanitize=kcfi -fsanitize-kcfi-hash=FNV-1a -o - %s | FileCheck --check-prefix=FNV %s
-// Invalid and empty values are rejected.
-// RUN: not %clang_cc1 -triple x86_64-unknown-linux-gnu -fsanitize=kcfi -fsanitize-kcfi-hash=bogus %s 2>&1 | FileCheck --check-prefix=BAD %s
-// RUN: not %clang_cc1 -triple x86_64-unknown-linux-gnu -fsanitize=kcfi -fsanitize-kcfi-hash= %s 2>&1 | FileCheck --check-prefix=EMPTY %s
-// BAD: error: invalid value 'bogus' in '-fsanitize-kcfi-hash=bogus'
-// EMPTY: error: invalid value '' in '-fsanitize-kcfi-hash='
-
void foo(void) {}
// DEFAULT: ![[#]] = !{i32 4, !"kcfi-hash", !"xxHash64"}
diff --git a/clang/test/Driver/fsanitize-cfi.c b/clang/test/Driver/fsanitize-cfi.c
index db3bfa494ff41..a13ad152dcb0b 100644
--- a/clang/test/Driver/fsanitize-cfi.c
+++ b/clang/test/Driver/fsanitize-cfi.c
@@ -102,7 +102,7 @@
// CHECK-KCFI-ARITY: "-fsanitize-kcfi-arity"
// Without -fsanitize=kcfi, -fsanitize-kcfi-arity is unused.
-// RUN: %clang --target=x86_64-linux-gnu -fsanitize-kcfi-arity %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-KCFI-ARITY-UNUSED
+// RUN: %clang --target=x86_64-linux-gnu -fsanitize-kcfi-arity -c %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-KCFI-ARITY-UNUSED
// CHECK-KCFI-ARITY-UNUSED: warning: argument unused during compilation: '-fsanitize-kcfi-arity'
// -fsanitize-kcfi-hash= is forwarded to cc1 when KCFI is enabled.
@@ -117,11 +117,14 @@
// CHECK-KCFI-HASH-LAST: "-fsanitize-kcfi-hash=FNV-1a"
// CHECK-KCFI-HASH-LAST-NOT: "-fsanitize-kcfi-hash=xxHash64"
-// An explicitly empty value is still forwarded (not dropped) so cc1 can
-// diagnose it.
-// RUN: %clang --target=x86_64-linux-gnu -fsanitize=kcfi -fsanitize-kcfi-hash= %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-KCFI-HASH-EMPTY
-// CHECK-KCFI-HASH-EMPTY: "-fsanitize-kcfi-hash="
+// Invalid values are diagnosed by cc1 (driver forwards verbatim).
+// RUN: not %clang --target=x86_64-linux-gnu -fsanitize=kcfi -fsanitize-kcfi-hash=bogus -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-KCFI-HASH-BAD
+// CHECK-KCFI-HASH-BAD: error: invalid value 'bogus' in '-fsanitize-kcfi-hash=bogus'
+
+// An explicitly empty value is still forwarded so cc1 can diagnose it.
+// RUN: not %clang --target=x86_64-linux-gnu -fsanitize=kcfi -fsanitize-kcfi-hash= -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-KCFI-HASH-EMPTY
+// CHECK-KCFI-HASH-EMPTY: error: invalid value '' in '-fsanitize-kcfi-hash='
// Without -fsanitize=kcfi, -fsanitize-kcfi-hash= is unused.
-// RUN: %clang --target=x86_64-linux-gnu -fsanitize-kcfi-hash=FNV-1a %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-KCFI-HASH-UNUSED
+// RUN: %clang --target=x86_64-linux-gnu -fsanitize-kcfi-hash=FNV-1a -c %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-KCFI-HASH-UNUSED
// CHECK-KCFI-HASH-UNUSED: warning: argument unused during compilation: '-fsanitize-kcfi-hash=FNV-1a'
diff --git a/clang/test/SemaCXX/microsoft-new-array-fallback.cpp b/clang/test/SemaCXX/microsoft-new-array-fallback.cpp
deleted file mode 100644
index 7e2ca1bc5a4c9..0000000000000
--- a/clang/test/SemaCXX/microsoft-new-array-fallback.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-// RUN: %clang_cc1 -fms-compatibility -fsyntax-only -verify -std=c++11 %s
-
-typedef __SIZE_TYPE__ size_t;
-
-void *operator new[](size_t); // #new_array_decl
-void *operator new(size_t); // #new_decl
-
-struct Tag {};
-
-void f() {
- int *p = new (Tag{}) int[4]; // #new_expr
- // expected-error@#new_expr {{no matching function for call to 'operator new[]'}}
- // expected-note@#new_array_decl {{candidate function not viable: requires 1 argument, but 2 were provided}}
- // expected-note@#new_expr {{Microsoft compatibility array allocation fallback to '::operator new(size_t)' failed}}
- (void)p;
-}
diff --git a/clang/test/SemaCXX/type-aware-new-invalid-alignvalt-cache.cpp b/clang/test/SemaCXX/type-aware-new-invalid-alignvalt-cache.cpp
deleted file mode 100644
index b1b9e67d6203a..0000000000000
--- a/clang/test/SemaCXX/type-aware-new-invalid-alignvalt-cache.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -std=c++26 \
-// RUN: -fno-aligned-allocation -Wno-ext-cxx-type-aware-allocators -verify %s
-
-void first() {
- new int;
-}
-
-namespace std {
- using size_t = __SIZE_TYPE__;
- template <class T> struct type_identity { using type = T; };
-}
-
-void second() {
- new float;
-}
-
-namespace std {
- enum class align_val_t : size_t {};
-}
-
-template <class T> void *operator new(std::type_identity<T>, std::size_t, std::align_val_t) = delete; // #new_decl
-template <class T> void operator delete(std::type_identity<T>, void *, std::size_t, std::align_val_t) = delete;
-
-struct Foo {
- int x;
-};
-
-void third() {
- (void)new Foo; // #new_expr
- // expected-error@#new_expr {{call to deleted function 'operator new'}}
- // expected-note@#new_decl {{candidate function [with T = Foo] has been explicitly deleted}}
-}
diff --git a/clang/test/SemaCXX/type-aware-new-invalid-type-identity.cpp b/clang/test/SemaCXX/type-aware-new-invalid-type-identity.cpp
index 7456e2db7eeda..502f4fab6b519 100644
--- a/clang/test/SemaCXX/type-aware-new-invalid-type-identity.cpp
+++ b/clang/test/SemaCXX/type-aware-new-invalid-type-identity.cpp
@@ -3,11 +3,11 @@
// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-ext-cxx-type-aware-allocators -std=c++26 -DINVALID_TYPE_IDENTITY_VERSION=2
// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-ext-cxx-type-aware-allocators -std=c++26 -DINVALID_TYPE_IDENTITY_VERSION=3
// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-ext-cxx-type-aware-allocators -std=c++26 -DINVALID_TYPE_IDENTITY_VERSION=4
-// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-ext-cxx-type-aware-allocators -std=c++26 -DINVALID_TYPE_IDENTITY_VERSION=5
// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify %s -Wno-ext-cxx-type-aware-allocators -std=c++26
namespace std {
#if !defined(INVALID_TYPE_IDENTITY_VERSION)
+ // expected-no-diagnostics
template <class T> struct type_identity {
};
#define TYPE_IDENTITY(T) std::type_identity<T>
@@ -30,11 +30,6 @@ namespace std {
template <class T> struct inner {};
template <class T> using type_identity = inner<T>;
#define TYPE_IDENTITY(T) std::type_identity<T>
-#elif INVALID_TYPE_IDENTITY_VERSION==5
-template <class T> struct type_identity { // #reentrant_type_identity_decl
- using type = decltype(new T); // #reentrant_type_identity_type_decl
-};
-#define TYPE_IDENTITY(T) std::type_identity<T>
#endif
using size_t = __SIZE_TYPE__;
enum class align_val_t : long {};
@@ -43,14 +38,6 @@ template <class T> struct type_identity { // #reentrant_type_identity_decl
template <class T> void *operator new(TYPE_IDENTITY(T), std::size_t, std::align_val_t); // #operator_new
template <class T> void operator delete(TYPE_IDENTITY(T), void*, std::size_t, std::align_val_t); // #operator_delete
-using size_t = __SIZE_TYPE__;
-struct TestType {};
-
-void reentrant_type_identity() {
- TestType *t = new TestType; // #reentrant_new
- delete t;
-}
-
// These error messages aren't great, but they fall out of the way we model
// alias types. Getting them in this way requires extremely unlikely code to be
// used, so this is not terrible.
@@ -61,24 +48,12 @@ void reentrant_type_identity() {
#elif INVALID_TYPE_IDENTITY_VERSION==4
// expected-error@#operator_new {{'operator new' cannot take a dependent type as its 1st parameter; use size_t ('unsigned long') instead}}
// expected-error@#operator_delete {{'operator delete' cannot take a dependent type as its 1st parameter; use 'void *' instead}}
-#elif INVALID_TYPE_IDENTITY_VERSION==5
-// expected-error@#reentrant_type_identity_type_decl {{incomplete type 'std::type_identity<TestType>' where a complete type is required}}
-// expected-note@#reentrant_type_identity_decl {{definition of 'std::type_identity<TestType>' is not complete until the closing '}'}}
-// expected-note@#reentrant_new {{in instantiation of template class 'std::type_identity<TestType>' requested here}}
#endif
-#if !defined(INVALID_TYPE_IDENTITY_VERSION)
-struct Bad {};
-template <> struct std::type_identity<Bad>; // #incomplete_specialization
+using size_t = __SIZE_TYPE__;
+struct TestType {};
-// This is a pure implementation test to ensure correct caching behavior if
-// constructing the type_identity argument fails.
-void failedTypeIdentitySpecialization() {
- Bad *a = new Bad;
- // expected-error at -1 {{incomplete type 'std::type_identity<Bad>' where a complete type is required}}
- // expected-note@#incomplete_specialization {{forward declaration of 'std::type_identity<Bad>'}}
- Bad *b = new Bad;
- // expected-error at -1 {{incomplete type 'std::type_identity<Bad>' where a complete type is required}}
- // expected-note@#incomplete_specialization {{forward declaration of 'std::type_identity<Bad>'}}
+void f() {
+ TestType *t = new TestType;
+ delete t;
}
-#endif
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index e7827f2201b43..84a8956df18e8 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -295,30 +295,6 @@ if(COMPILER_RT_USE_LIBC_MATH)
use_libc_builtin(GENERIC_SOURCES extendsfdf2)
use_libc_builtin(GENERIC_TF_SOURCES extendsftf2)
use_libc_builtin(x86_80_BIT_SOURCES extendxftf2)
- use_libc_builtin(GENERIC_SOURCES fixdfsi)
- use_libc_builtin(GENERIC_SOURCES fixdfdi)
- use_libc_builtin(GENERIC_SOURCES fixdfti)
- use_libc_builtin(GENERIC_SOURCES fixsfsi)
- use_libc_builtin(GENERIC_SOURCES fixsfdi)
- use_libc_builtin(GENERIC_SOURCES fixsfti)
- use_libc_builtin(GENERIC_SOURCES fixunsdfsi)
- use_libc_builtin(GENERIC_SOURCES fixunsdfdi)
- use_libc_builtin(GENERIC_SOURCES fixunsdfti)
- use_libc_builtin(GENERIC_SOURCES fixunssfsi)
- use_libc_builtin(GENERIC_SOURCES fixunssfdi)
- use_libc_builtin(GENERIC_SOURCES fixunssfti)
- use_libc_builtin(GENERIC_SOURCES floatsidf)
- use_libc_builtin(GENERIC_SOURCES floatdidf)
- use_libc_builtin(GENERIC_SOURCES floattidf)
- use_libc_builtin(GENERIC_SOURCES floatsisf)
- use_libc_builtin(GENERIC_SOURCES floatdisf)
- use_libc_builtin(GENERIC_SOURCES floattisf)
- use_libc_builtin(GENERIC_SOURCES floatunsidf)
- use_libc_builtin(GENERIC_SOURCES floatundidf)
- use_libc_builtin(GENERIC_SOURCES floatuntidf)
- use_libc_builtin(GENERIC_SOURCES floatunsisf)
- use_libc_builtin(GENERIC_SOURCES floatundisf)
- use_libc_builtin(GENERIC_SOURCES floatuntisf)
use_libc_builtin(GENERIC_SOURCES muldf3)
use_libc_builtin(GENERIC_SOURCES mulsf3)
use_libc_builtin(GENERIC_TF_SOURCES multf3)
diff --git a/compiler-rt/lib/builtins/fixdfdi.cpp b/compiler-rt/lib/builtins/fixdfdi.cpp
deleted file mode 100644
index 41041c81eb540..0000000000000
--- a/compiler-rt/lib/builtins/fixdfdi.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __fixdfdi, truncating double -> int64_t
-/// conversion (saturating), on top of LLVM-libc's shared::fixdfdi.
-///
-//===----------------------------------------------------------------------===//
-
-#define DOUBLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/fixdfdi.h"
-
-extern "C" COMPILER_RT_ABI di_int __fixdfdi(fp_t a) {
- return LIBC_NAMESPACE::shared::fixdfdi(a);
-}
diff --git a/compiler-rt/lib/builtins/fixdfsi.cpp b/compiler-rt/lib/builtins/fixdfsi.cpp
deleted file mode 100644
index 8f80fcc7a0d99..0000000000000
--- a/compiler-rt/lib/builtins/fixdfsi.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __fixdfsi, truncating double -> int32_t
-/// conversion (saturating), on top of LLVM-libc's shared::fixdfsi.
-///
-//===----------------------------------------------------------------------===//
-
-#define DOUBLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/fixdfsi.h"
-
-extern "C" COMPILER_RT_ABI si_int __fixdfsi(fp_t a) {
- return LIBC_NAMESPACE::shared::fixdfsi(a);
-}
diff --git a/compiler-rt/lib/builtins/fixdfti.cpp b/compiler-rt/lib/builtins/fixdfti.cpp
deleted file mode 100644
index 6529f1efd9427..0000000000000
--- a/compiler-rt/lib/builtins/fixdfti.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __fixdfti, truncating double ->
-/// __int128_t conversion (saturating), on top of LLVM-libc's shared::fixdfti.
-///
-//===----------------------------------------------------------------------===//
-
-#include "int_lib.h"
-
-#ifdef CRT_HAS_128BIT
-#define DOUBLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "shared/builtins/fixdfti.h"
-
-extern "C" COMPILER_RT_ABI ti_int __fixdfti(fp_t a) {
- return LIBC_NAMESPACE::shared::fixdfti(a);
-}
-
-#endif // CRT_HAS_128BIT
diff --git a/compiler-rt/lib/builtins/fixsfdi.cpp b/compiler-rt/lib/builtins/fixsfdi.cpp
deleted file mode 100644
index 9fdedaf87544e..0000000000000
--- a/compiler-rt/lib/builtins/fixsfdi.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __fixsfdi, truncating float -> int64_t
-/// conversion (saturating), on top of LLVM-libc's shared::fixsfdi.
-///
-//===----------------------------------------------------------------------===//
-
-#define SINGLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/fixsfdi.h"
-
-extern "C" COMPILER_RT_ABI di_int __fixsfdi(fp_t a) {
- return LIBC_NAMESPACE::shared::fixsfdi(a);
-}
diff --git a/compiler-rt/lib/builtins/fixsfsi.cpp b/compiler-rt/lib/builtins/fixsfsi.cpp
deleted file mode 100644
index 8c73789ee42c5..0000000000000
--- a/compiler-rt/lib/builtins/fixsfsi.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __fixsfsi, truncating float -> int32_t
-/// conversion (saturating), on top of LLVM-libc's shared::fixsfsi.
-///
-//===----------------------------------------------------------------------===//
-
-#define SINGLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/fixsfsi.h"
-
-extern "C" COMPILER_RT_ABI si_int __fixsfsi(fp_t a) {
- return LIBC_NAMESPACE::shared::fixsfsi(a);
-}
diff --git a/compiler-rt/lib/builtins/fixsfti.cpp b/compiler-rt/lib/builtins/fixsfti.cpp
deleted file mode 100644
index df5b99f905842..0000000000000
--- a/compiler-rt/lib/builtins/fixsfti.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __fixsfti, truncating float -> __int128_t
-/// conversion (saturating), on top of LLVM-libc's shared::fixsfti.
-///
-//===----------------------------------------------------------------------===//
-
-#include "int_lib.h"
-
-#ifdef CRT_HAS_128BIT
-#define SINGLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "shared/builtins/fixsfti.h"
-
-extern "C" COMPILER_RT_ABI ti_int __fixsfti(fp_t a) {
- return LIBC_NAMESPACE::shared::fixsfti(a);
-}
-
-#endif // CRT_HAS_128BIT
diff --git a/compiler-rt/lib/builtins/fixunsdfdi.cpp b/compiler-rt/lib/builtins/fixunsdfdi.cpp
deleted file mode 100644
index 4d3488e4317a2..0000000000000
--- a/compiler-rt/lib/builtins/fixunsdfdi.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __fixunsdfdi, truncating double ->
-/// uint64_t conversion (saturating), on top of LLVM-libc's shared::fixunsdfdi.
-///
-//===----------------------------------------------------------------------===//
-
-#define DOUBLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/fixunsdfdi.h"
-
-extern "C" COMPILER_RT_ABI du_int __fixunsdfdi(fp_t a) {
- return LIBC_NAMESPACE::shared::fixunsdfdi(a);
-}
diff --git a/compiler-rt/lib/builtins/fixunsdfsi.cpp b/compiler-rt/lib/builtins/fixunsdfsi.cpp
deleted file mode 100644
index b0ae84532156c..0000000000000
--- a/compiler-rt/lib/builtins/fixunsdfsi.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __fixunsdfsi, truncating double ->
-/// uint32_t conversion (saturating), on top of LLVM-libc's shared::fixunsdfsi.
-///
-//===----------------------------------------------------------------------===//
-
-#define DOUBLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/fixunsdfsi.h"
-
-extern "C" COMPILER_RT_ABI su_int __fixunsdfsi(fp_t a) {
- return LIBC_NAMESPACE::shared::fixunsdfsi(a);
-}
diff --git a/compiler-rt/lib/builtins/fixunsdfti.cpp b/compiler-rt/lib/builtins/fixunsdfti.cpp
deleted file mode 100644
index 374162ab886f7..0000000000000
--- a/compiler-rt/lib/builtins/fixunsdfti.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __fixunsdfti, truncating double ->
-/// __uint128_t conversion (saturating), on top of LLVM-libc's
-/// shared::fixunsdfti.
-///
-//===----------------------------------------------------------------------===//
-
-#include "int_lib.h"
-
-#ifdef CRT_HAS_128BIT
-#define DOUBLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "shared/builtins/fixunsdfti.h"
-
-extern "C" COMPILER_RT_ABI tu_int __fixunsdfti(fp_t a) {
- return LIBC_NAMESPACE::shared::fixunsdfti(a);
-}
-
-#endif // CRT_HAS_128BIT
diff --git a/compiler-rt/lib/builtins/fixunssfdi.cpp b/compiler-rt/lib/builtins/fixunssfdi.cpp
deleted file mode 100644
index 7dbea8001e14e..0000000000000
--- a/compiler-rt/lib/builtins/fixunssfdi.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __fixunssfdi, truncating float ->
-/// uint64_t conversion (saturating), on top of LLVM-libc's shared::fixunssfdi.
-///
-//===----------------------------------------------------------------------===//
-
-#define SINGLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/fixunssfdi.h"
-
-extern "C" COMPILER_RT_ABI du_int __fixunssfdi(fp_t a) {
- return LIBC_NAMESPACE::shared::fixunssfdi(a);
-}
diff --git a/compiler-rt/lib/builtins/fixunssfsi.cpp b/compiler-rt/lib/builtins/fixunssfsi.cpp
deleted file mode 100644
index b2c1706bdc4b7..0000000000000
--- a/compiler-rt/lib/builtins/fixunssfsi.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __fixunssfsi, truncating float ->
-/// uint32_t conversion (saturating), on top of LLVM-libc's shared::fixunssfsi.
-///
-//===----------------------------------------------------------------------===//
-
-#define SINGLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/fixunssfsi.h"
-
-extern "C" COMPILER_RT_ABI su_int __fixunssfsi(fp_t a) {
- return LIBC_NAMESPACE::shared::fixunssfsi(a);
-}
diff --git a/compiler-rt/lib/builtins/fixunssfti.cpp b/compiler-rt/lib/builtins/fixunssfti.cpp
deleted file mode 100644
index 3dab1cff9cca2..0000000000000
--- a/compiler-rt/lib/builtins/fixunssfti.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __fixunssfti, truncating float ->
-/// __uint128_t conversion (saturating), on top of LLVM-libc's
-/// shared::fixunssfti.
-///
-//===----------------------------------------------------------------------===//
-
-#include "int_lib.h"
-
-#ifdef CRT_HAS_128BIT
-#define SINGLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "shared/builtins/fixunssfti.h"
-
-extern "C" COMPILER_RT_ABI tu_int __fixunssfti(fp_t a) {
- return LIBC_NAMESPACE::shared::fixunssfti(a);
-}
-
-#endif // CRT_HAS_128BIT
diff --git a/compiler-rt/lib/builtins/floatdidf.cpp b/compiler-rt/lib/builtins/floatdidf.cpp
deleted file mode 100644
index 4bc0a12090f1d..0000000000000
--- a/compiler-rt/lib/builtins/floatdidf.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __floatdidf, int64_t -> double conversion
-/// (round to nearest), on top of LLVM-libc's shared::floatdidf.
-///
-//===----------------------------------------------------------------------===//
-
-#define DOUBLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/floatdidf.h"
-
-extern "C" COMPILER_RT_ABI fp_t __floatdidf(di_int a) {
- return LIBC_NAMESPACE::shared::floatdidf(a);
-}
diff --git a/compiler-rt/lib/builtins/floatdisf.cpp b/compiler-rt/lib/builtins/floatdisf.cpp
deleted file mode 100644
index bfe1b8be533c1..0000000000000
--- a/compiler-rt/lib/builtins/floatdisf.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __floatdisf, int64_t -> float conversion
-/// (round to nearest), on top of LLVM-libc's shared::floatdisf.
-///
-//===----------------------------------------------------------------------===//
-
-#define SINGLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/floatdisf.h"
-
-extern "C" COMPILER_RT_ABI fp_t __floatdisf(di_int a) {
- return LIBC_NAMESPACE::shared::floatdisf(a);
-}
diff --git a/compiler-rt/lib/builtins/floatsidf.cpp b/compiler-rt/lib/builtins/floatsidf.cpp
deleted file mode 100644
index cac1a66b0869c..0000000000000
--- a/compiler-rt/lib/builtins/floatsidf.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __floatsidf, int32_t -> double conversion
-/// (round to nearest), on top of LLVM-libc's shared::floatsidf.
-///
-//===----------------------------------------------------------------------===//
-
-#define DOUBLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/floatsidf.h"
-
-extern "C" COMPILER_RT_ABI fp_t __floatsidf(si_int a) {
- return LIBC_NAMESPACE::shared::floatsidf(a);
-}
diff --git a/compiler-rt/lib/builtins/floatsisf.cpp b/compiler-rt/lib/builtins/floatsisf.cpp
deleted file mode 100644
index 5229ffc3614af..0000000000000
--- a/compiler-rt/lib/builtins/floatsisf.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __floatsisf, int32_t -> float conversion
-/// (round to nearest), on top of LLVM-libc's shared::floatsisf.
-///
-//===----------------------------------------------------------------------===//
-
-#define SINGLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/floatsisf.h"
-
-extern "C" COMPILER_RT_ABI fp_t __floatsisf(si_int a) {
- return LIBC_NAMESPACE::shared::floatsisf(a);
-}
diff --git a/compiler-rt/lib/builtins/floattidf.cpp b/compiler-rt/lib/builtins/floattidf.cpp
deleted file mode 100644
index f92d1e2659460..0000000000000
--- a/compiler-rt/lib/builtins/floattidf.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __floattidf, __int128_t -> double
-/// conversion (round to nearest), on top of LLVM-libc's shared::floattidf.
-///
-//===----------------------------------------------------------------------===//
-
-#include "int_lib.h"
-
-#ifdef CRT_HAS_128BIT
-#define DOUBLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "shared/builtins/floattidf.h"
-
-extern "C" COMPILER_RT_ABI fp_t __floattidf(ti_int a) {
- return LIBC_NAMESPACE::shared::floattidf(a);
-}
-
-#endif // CRT_HAS_128BIT
diff --git a/compiler-rt/lib/builtins/floattisf.cpp b/compiler-rt/lib/builtins/floattisf.cpp
deleted file mode 100644
index 324b32d641dfc..0000000000000
--- a/compiler-rt/lib/builtins/floattisf.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __floattisf, __int128_t -> float
-/// conversion (round to nearest), on top of LLVM-libc's shared::floattisf.
-///
-//===----------------------------------------------------------------------===//
-
-#include "int_lib.h"
-
-#ifdef CRT_HAS_128BIT
-#define SINGLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "shared/builtins/floattisf.h"
-
-extern "C" COMPILER_RT_ABI fp_t __floattisf(ti_int a) {
- return LIBC_NAMESPACE::shared::floattisf(a);
-}
-
-#endif // CRT_HAS_128BIT
diff --git a/compiler-rt/lib/builtins/floatundidf.cpp b/compiler-rt/lib/builtins/floatundidf.cpp
deleted file mode 100644
index 3a5b5b85047aa..0000000000000
--- a/compiler-rt/lib/builtins/floatundidf.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __floatundidf, uint64_t -> double
-/// conversion (round to nearest), on top of LLVM-libc's shared::floatundidf.
-///
-//===----------------------------------------------------------------------===//
-
-#define DOUBLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/floatundidf.h"
-
-extern "C" COMPILER_RT_ABI fp_t __floatundidf(du_int a) {
- return LIBC_NAMESPACE::shared::floatundidf(a);
-}
diff --git a/compiler-rt/lib/builtins/floatundisf.cpp b/compiler-rt/lib/builtins/floatundisf.cpp
deleted file mode 100644
index 60844ce1b9cd6..0000000000000
--- a/compiler-rt/lib/builtins/floatundisf.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __floatundisf, uint64_t -> float
-/// conversion (round to nearest), on top of LLVM-libc's shared::floatundisf.
-///
-//===----------------------------------------------------------------------===//
-
-#define SINGLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/floatundisf.h"
-
-extern "C" COMPILER_RT_ABI fp_t __floatundisf(du_int a) {
- return LIBC_NAMESPACE::shared::floatundisf(a);
-}
diff --git a/compiler-rt/lib/builtins/floatunsidf.cpp b/compiler-rt/lib/builtins/floatunsidf.cpp
deleted file mode 100644
index 4cdff38e3e793..0000000000000
--- a/compiler-rt/lib/builtins/floatunsidf.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __floatunsidf, uint32_t -> double
-/// conversion (round to nearest), on top of LLVM-libc's shared::floatunsidf.
-///
-//===----------------------------------------------------------------------===//
-
-#define DOUBLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/floatunsidf.h"
-
-extern "C" COMPILER_RT_ABI fp_t __floatunsidf(su_int a) {
- return LIBC_NAMESPACE::shared::floatunsidf(a);
-}
diff --git a/compiler-rt/lib/builtins/floatunsisf.cpp b/compiler-rt/lib/builtins/floatunsisf.cpp
deleted file mode 100644
index aac12daa3d1aa..0000000000000
--- a/compiler-rt/lib/builtins/floatunsisf.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __floatunsisf, uint32_t -> float
-/// conversion (round to nearest), on top of LLVM-libc's shared::floatunsisf.
-///
-//===----------------------------------------------------------------------===//
-
-#define SINGLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "int_lib.h"
-#include "shared/builtins/floatunsisf.h"
-
-extern "C" COMPILER_RT_ABI fp_t __floatunsisf(su_int a) {
- return LIBC_NAMESPACE::shared::floatunsisf(a);
-}
diff --git a/compiler-rt/lib/builtins/floatuntidf.cpp b/compiler-rt/lib/builtins/floatuntidf.cpp
deleted file mode 100644
index 22c9c443e3079..0000000000000
--- a/compiler-rt/lib/builtins/floatuntidf.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __floatuntidf, __uint128_t -> double
-/// conversion (round to nearest), on top of LLVM-libc's shared::floatuntidf.
-///
-//===----------------------------------------------------------------------===//
-
-#include "int_lib.h"
-
-#ifdef CRT_HAS_128BIT
-#define DOUBLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "shared/builtins/floatuntidf.h"
-
-extern "C" COMPILER_RT_ABI fp_t __floatuntidf(tu_int a) {
- return LIBC_NAMESPACE::shared::floatuntidf(a);
-}
-
-#endif // CRT_HAS_128BIT
diff --git a/compiler-rt/lib/builtins/floatuntisf.cpp b/compiler-rt/lib/builtins/floatuntisf.cpp
deleted file mode 100644
index 4a8d32c089def..0000000000000
--- a/compiler-rt/lib/builtins/floatuntisf.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This file implements compiler-rt's __floatuntisf, __uint128_t -> float
-/// conversion (round to nearest), on top of LLVM-libc's shared::floatuntisf.
-///
-//===----------------------------------------------------------------------===//
-
-#include "int_lib.h"
-
-#ifdef CRT_HAS_128BIT
-#define SINGLE_PRECISION
-#include "fp_lib.h"
-
-#include "fp_libc_config.h"
-#include "shared/builtins/floatuntisf.h"
-
-extern "C" COMPILER_RT_ABI fp_t __floatuntisf(tu_int a) {
- return LIBC_NAMESPACE::shared::floatuntisf(a);
-}
-
-#endif // CRT_HAS_128BIT
diff --git a/compiler-rt/test/profile/Inputs/mock-coroutine.h b/compiler-rt/test/profile/Inputs/mock-coroutine.h
deleted file mode 100644
index 4c862158d8de9..0000000000000
--- a/compiler-rt/test/profile/Inputs/mock-coroutine.h
+++ /dev/null
@@ -1,114 +0,0 @@
-// This is a mock file for <coroutine>. Copied from clang/test/CodeGenCoroutines/Inputs/coroutine.h.
-#pragma once
-
-namespace std {
-
-template <typename R, typename...> struct coroutine_traits {
- using promise_type = typename R::promise_type;
-};
-
-template <typename Promise = void> struct coroutine_handle;
-
-template <> struct coroutine_handle<void> {
- static coroutine_handle from_address(void *addr) noexcept {
- coroutine_handle me;
- me.ptr = addr;
- return me;
- }
- void operator()() { resume(); }
- void *address() const noexcept { return ptr; }
- void resume() const { __builtin_coro_resume(ptr); }
- void destroy() const { __builtin_coro_destroy(ptr); }
- bool done() const { return __builtin_coro_done(ptr); }
- coroutine_handle &operator=(decltype(nullptr)) {
- ptr = nullptr;
- return *this;
- }
- coroutine_handle(decltype(nullptr)) : ptr(nullptr) {}
- coroutine_handle() : ptr(nullptr) {}
- // void reset() { ptr = nullptr; } // add to P0057?
- explicit operator bool() const { return ptr; }
-
-protected:
- void *ptr;
-};
-
-template <typename Promise> struct coroutine_handle : coroutine_handle<> {
- using coroutine_handle<>::operator=;
-
- static coroutine_handle from_address(void *addr) noexcept {
- coroutine_handle me;
- me.ptr = addr;
- return me;
- }
-
- Promise &promise() const {
- return *reinterpret_cast<Promise *>(
- __builtin_coro_promise(ptr, alignof(Promise), false));
- }
- static coroutine_handle from_promise(Promise &promise) {
- coroutine_handle p;
- p.ptr = __builtin_coro_promise(&promise, alignof(Promise), true);
- return p;
- }
-};
-
-template <typename _PromiseT>
-bool operator==(coroutine_handle<_PromiseT> const &_Left,
- coroutine_handle<_PromiseT> const &_Right) noexcept {
- return _Left.address() == _Right.address();
-}
-
-template <typename _PromiseT>
-bool operator!=(coroutine_handle<_PromiseT> const &_Left,
- coroutine_handle<_PromiseT> const &_Right) noexcept {
- return !(_Left == _Right);
-}
-
-struct noop_coroutine_promise {};
-
-template <> struct coroutine_handle<noop_coroutine_promise> {
- operator coroutine_handle<>() const noexcept {
- return coroutine_handle<>::from_address(address());
- }
-
- constexpr explicit operator bool() const noexcept { return true; }
- constexpr bool done() const noexcept { return false; }
-
- constexpr void operator()() const noexcept {}
- constexpr void resume() const noexcept {}
- constexpr void destroy() const noexcept {}
-
- noop_coroutine_promise &promise() const noexcept {
- return *static_cast<noop_coroutine_promise *>(__builtin_coro_promise(
- this->__handle_, alignof(noop_coroutine_promise), false));
- }
-
- constexpr void *address() const noexcept { return __handle_; }
-
-private:
- friend coroutine_handle<noop_coroutine_promise> noop_coroutine() noexcept;
-
- coroutine_handle() noexcept { this->__handle_ = __builtin_coro_noop(); }
-
- void *__handle_ = nullptr;
-};
-
-using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;
-
-inline noop_coroutine_handle noop_coroutine() noexcept {
- return noop_coroutine_handle();
-}
-
-struct suspend_always {
- bool await_ready() noexcept { return false; }
- void await_suspend(coroutine_handle<>) noexcept {}
- void await_resume() noexcept {}
-};
-struct suspend_never {
- bool await_ready() noexcept { return true; }
- void await_suspend(coroutine_handle<>) noexcept {}
- void await_resume() noexcept {}
-};
-
-} // namespace std
diff --git a/compiler-rt/test/profile/instrprof-coroutine-profile.cpp b/compiler-rt/test/profile/instrprof-coroutine-profile.cpp
index 524218a50879a..e4c8bd47ceca5 100644
--- a/compiler-rt/test/profile/instrprof-coroutine-profile.cpp
+++ b/compiler-rt/test/profile/instrprof-coroutine-profile.cpp
@@ -2,7 +2,7 @@
// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
// RUN: llvm-profdata show -function=foo -counts %t.profraw | FileCheck %s
-#include "Inputs/mock-coroutine.h"
+#include <coroutine>
struct State {
struct promise_type {
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Darwin/malloc_zone.cpp b/compiler-rt/test/sanitizer_common/TestCases/Darwin/malloc_zone.cpp
index 27effa1e01262..5aa087fb4ca12 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Darwin/malloc_zone.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Darwin/malloc_zone.cpp
@@ -20,8 +20,6 @@
// Currently fails on darwin/lsan
// XFAIL: darwin && lsan
-// UNSUPPORTED: rtsan
-
#include <malloc/malloc.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/allow_user_segv.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/allow_user_segv.cpp
index a393e17ccb9b4..b9ce950d6f96c 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/allow_user_segv.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/allow_user_segv.cpp
@@ -21,8 +21,6 @@
// Flaky errors in debuggerd with "waitpid returned unexpected pid (0)" in logcat.
// UNSUPPORTED: android && i386-target-arch
-// UNSUPPORTED: rtsan
-
// Note: this test case is unusual because it retrieves the original
// (ASan-installed) signal handler; thus, it is incompatible with the
// cloak_sanitizer_signal_handlers runtime option.
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/assert.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/assert.cpp
index 1c252352e1645..2a73c508844bb 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/assert.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/assert.cpp
@@ -5,8 +5,6 @@
// RUN: %env_tool_opts=handle_abort=0 not --crash %run %t 2>&1 | FileCheck --check-prefix=CHECK0 %s
// RUN: %env_tool_opts=handle_abort=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK1 %s
-// UNSUPPORTED: rtsan
-
#include <assert.h>
#include <stdio.h>
#include <sanitizer/asan_interface.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/cloak_sigaction.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/cloak_sigaction.cpp
index f697fcbc96b49..422e4abe880c5 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/cloak_sigaction.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/cloak_sigaction.cpp
@@ -17,8 +17,6 @@
// RUN: %env_tool_opts=handle_segv=2:cloak_sanitizer_signal_handlers=false not %run %t 2>&1 | FileCheck %s --check-prefixes=NONDEFAULT,SANITIZER
// RUN: %env_tool_opts=handle_segv=2:cloak_sanitizer_signal_handlers=true not %run %t 2>&1 | FileCheck %s --check-prefixes=DEFAULT,SANITIZER
-// UNSUPPORTED: rtsan
-
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/cloak_signal.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/cloak_signal.cpp
index 4a916318cb135..48e54756c2d0c 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/cloak_signal.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/cloak_signal.cpp
@@ -1,6 +1,5 @@
// UNSUPPORTED: android
// UNSUPPORTED: hwasan
-// UNSUPPORTED: rtsan
// RUN: %clangxx -O0 %s -o %t
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cpp
index 5f7bfdb8e8558..4482713dd424d 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/deepbind.cpp
@@ -3,7 +3,6 @@
// FIXME: Implement.
// XFAIL: hwasan
-// UNSUPPORTED: rtsan
#include <dlfcn.h>
#include <stdio.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/dump_registers_aarch64.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/dump_registers_aarch64.cpp
index 3d6695271f484..d1015a4e36956 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/dump_registers_aarch64.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/dump_registers_aarch64.cpp
@@ -5,8 +5,6 @@
//
// REQUIRES: aarch64-target-arch && glibc
-// UNSUPPORTED: rtsan
-
#include <signal.h>
int main() {
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/malloc_usable_size.c b/compiler-rt/test/sanitizer_common/TestCases/Linux/malloc_usable_size.c
index 58606e450aa61..0fdec468e08ae 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/malloc_usable_size.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/malloc_usable_size.c
@@ -3,8 +3,6 @@
// Must not be implemented, no other reason to install interceptors.
// XFAIL: ubsan
-// UNSUPPORTED: rtsan
-
#include <assert.h>
#include <malloc.h>
#include <sanitizer/allocator_interface.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cpp
index 24660cb763b7c..09b05d1a44434 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cpp
@@ -7,8 +7,6 @@
// FIXME: Implement.
// XFAIL: hwasan
-// UNSUPPORTED: rtsan
-
#include <assert.h>
#include <sys/mman.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cpp
index c5e97855ddd11..7633eb4762292 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/mprobe.cpp
@@ -1,6 +1,5 @@
// RUN: %clangxx %s -o %t && %run %t 2>&1 | FileCheck %s
// UNSUPPORTED: android, hwasan, ubsan
-// UNSUPPORTED: rtsan
#include <stdio.h>
#include <stdlib.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/release_to_os_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/release_to_os_test.cpp
index ef8c84741477d..c7a5534696361 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/release_to_os_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/release_to_os_test.cpp
@@ -14,8 +14,6 @@
// Page size is hardcoded below, but test still fails even if not hardcoded.
// REQUIRES: page-size-4096
-// UNSUPPORTED: rtsan
-
#include <algorithm>
#include <assert.h>
#include <fcntl.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/replace_dlopen_main_program_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/replace_dlopen_main_program_test.cpp
index b007fb1cf0db4..72fff2719def2 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/replace_dlopen_main_program_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/replace_dlopen_main_program_test.cpp
@@ -13,8 +13,6 @@
// Flag has no effect with dynamic runtime
// UNSUPPORTED: asan-dynamic-runtime
-// UNSUPPORTED: rtsan
-
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_line.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_line.cpp
index 13478a91c7773..c3f73dbb960f9 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_line.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_line.cpp
@@ -6,8 +6,6 @@
// RUN: %env_tool_opts=handle_segv=1:print_stacktrace=1 not %run %t 1 2>&1 | FileCheck --check-prefixes=CHECK1,CHECK %s
// RUN: %env_tool_opts=handle_segv=1:print_stacktrace=1 not %run %t 2 2>&1 | FileCheck --check-prefixes=CHECK2,CHECK %s
-// UNSUPPORTED: rtsan
-
#include <cstdio>
#include <cstdlib>
#include <string>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.c b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.c
index 9f6b15429e469..58a2d457f359e 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.c
@@ -9,8 +9,6 @@
// FIXME: Hwasan misclassify TRAP as tag missmatch.
// XFAIL: hwasan && !hwasan-aliasing
-// UNSUPPORTED: rtsan
-
#include <signal.h>
#include <stdlib.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cpp
index 2ef9144dc1db1..05c78940613cb 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cpp
@@ -22,8 +22,6 @@
// Symbolizer needs to allocated memory when reporting.
// UNSUPPORTED: internal_symbolizer
-// UNSUPPORTED: rtsan
-
// FIXME: The test fails flakily, see e.g. PRs #170911, #171469, #188441.
// Flaky on llvm-clang-x86_64-gcc-ubuntu, llvm-clang-x86_64-gcc-ubuntu-no-asserts and https://crbug.com/481656455.
// UNSUPPORTED: true
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_malloc_hook.c b/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_malloc_hook.c
index 39821e0aa70b8..587f3b1401f10 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_malloc_hook.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/tls_malloc_hook.c
@@ -9,8 +9,6 @@
// No allocator and hooks.
// XFAIL: ubsan
-// UNSUPPORTED: rtsan
-
#ifndef BUILD_SO
# include <assert.h>
# include <dlfcn.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cpp
index a1e6a5a27e91a..fdce916ad1e1a 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cpp
@@ -3,7 +3,6 @@
// UNSUPPORTED: lsan
// UNSUPPORTED: msan
// UNSUPPORTED: ubsan
-// UNSUPPORTED: rtsan
#include <stdio.h>
int main() {
int a;
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cpp
index e6ebd7e605fbc..37bfee4806173 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cpp
@@ -16,8 +16,6 @@
// XFAIL: target={{.*netbsd.*}} && !asan
-// UNSUPPORTED: rtsan
-
volatile int *null = 0;
namespace Xyz {
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/illegal_read_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/illegal_read_test.cpp
index ab6e90f247feb..45d3f256378fc 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/illegal_read_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/illegal_read_test.cpp
@@ -5,7 +5,6 @@
// REQUIRES: stable-runtime
// XFAIL: target={{(powerpc64|s390x).*}}
-// UNSUPPORTED: rtsan
volatile int *null = 0;
volatile int a;
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/illegal_write_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/illegal_write_test.cpp
index 686f1e53b4fb7..9b94b8d0237ce 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/illegal_write_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/illegal_write_test.cpp
@@ -5,7 +5,6 @@
// REQUIRES: stable-runtime
// XFAIL: target={{(powerpc64|s390x).*}}
-// UNSUPPORTED: rtsan
volatile int *null = 0;
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/mmap_write_exec.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/mmap_write_exec.cpp
index 7d52a02b2d0e9..eec2161573a77 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/mmap_write_exec.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/mmap_write_exec.cpp
@@ -7,8 +7,6 @@
// TODO: Fix option on Android, it hangs there for unknown reasons.
// XFAIL: android
-// UNSUPPORTED: rtsan
-
#if defined(__APPLE__)
#include <Availability.h>
#endif
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_memalign-alignment.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_memalign-alignment.cpp
index 3a91908aac488..70fba25f59b84 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_memalign-alignment.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_memalign-alignment.cpp
@@ -18,7 +18,6 @@
// REQUIRES: stable-runtime
// UNSUPPORTED: ubsan
-// UNSUPPORTED: rtsan
#include <assert.h>
#include <errno.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/print-module-map.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/print-module-map.cpp
index cb6fb159c0b04..00df7242b9ed2 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/print-module-map.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/print-module-map.cpp
@@ -21,8 +21,6 @@
// FIXME: Implement.
// XFAIL: lsan, hwasan
-// UNSUPPORTED: rtsan
-
int global;
int main() {
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cpp
index 1242378b6dcf5..9c5ae13cfd8b7 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cpp
@@ -6,8 +6,6 @@
// FIXME: On Darwin, LSAn detects the leak, but does not invoke the death_callback.
// XFAIL: darwin && lsan
-// UNSUPPORTED: rtsan
-
#include <sanitizer/common_interface_defs.h>
#include <stdio.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_fd_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_fd_test.cpp
index e41fff7a0a601..e4064828015aa 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_fd_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_fd_test.cpp
@@ -8,7 +8,6 @@
// REQUIRES: stable-runtime
// UNSUPPORTED: android && asan
-// UNSUPPORTED: rtsan
#include <sanitizer/common_interface_defs.h>
#include <stdio.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cpp
index 1543027b2b3c6..e95de739fe784 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/weak_hook_test.cpp
@@ -7,8 +7,6 @@
// FIXME: Implement.
// XFAIL: hwasan
-// UNSUPPORTED: rtsan
-
#include <assert.h>
#include <string.h>
#if defined(_GNU_SOURCE)
diff --git a/compiler-rt/test/sanitizer_common/TestCases/allocator_interface.cpp b/compiler-rt/test/sanitizer_common/TestCases/allocator_interface.cpp
index e8d879cd7e2fc..6f5f05639800a 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/allocator_interface.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/allocator_interface.cpp
@@ -4,8 +4,6 @@
// No allocator.
// UNSUPPORTED: ubsan
-// UNSUPPORTED: rtsan
-
#include <assert.h>
#include <sanitizer/allocator_interface.h>
#include <stdio.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp b/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp
index 6343d87bc5c5d..ca6f637b9a3f5 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp
@@ -38,8 +38,6 @@
// TODO(alekseyshl): win32 is disabled due to failing errno tests, fix it there.
// UNSUPPORTED: ubsan, target={{.*windows-msvc.*}}
-// UNSUPPORTED: rtsan
-
#include <assert.h>
#include <errno.h>
#include <stdio.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/compress_stack_depot.cpp b/compiler-rt/test/sanitizer_common/TestCases/compress_stack_depot.cpp
index cdbb7a646fd8c..7ad0ff08df33d 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/compress_stack_depot.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/compress_stack_depot.cpp
@@ -14,8 +14,6 @@
// Similar to D114934, something is broken with background thread on THUMB and Asan.
// XFAIL: target=thumb{{.*}} && asan
-// UNSUPPORTED: rtsan
-
#include <sanitizer/common_interface_defs.h>
#include <memory>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/corelimit.cpp b/compiler-rt/test/sanitizer_common/TestCases/corelimit.cpp
index 05f86c8dd0c0b..9b56471905aaf 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/corelimit.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/corelimit.cpp
@@ -1,5 +1,5 @@
// RUN: %clangxx -O0 %s -o %t && %run %t
-// UNSUPPORTED: lsan,ubsan,rtsan
+// UNSUPPORTED: lsan,ubsan
#include <assert.h>
#include <sys/time.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp b/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp
index 59589a88366fa..7ae2df5d5647b 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/get_allocated_begin.cpp
@@ -3,8 +3,6 @@
// Must not be implemented, no other reason to install interceptors.
// XFAIL: ubsan
-// UNSUPPORTED: rtsan
-
#include <assert.h>
#include <sanitizer/allocator_interface.h>
#include <stdio.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cpp
index 232a97d1dac27..4eb2247b1d38f 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cpp
@@ -13,7 +13,6 @@
// Ubsan does not intercept pthread_create.
// XFAIL: ubsan
// UNSUPPORTED: target={{.*(freebsd|solaris).*}}, darwin
-// UNSUPPORTED: rtsan
// THUMB starts background thead only for Asan.
// XFAIL: target=thumb{{.*}} && !asan
diff --git a/compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp b/compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp
index b11045091aa3c..44dffcd47a51a 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp
@@ -6,8 +6,6 @@
// Must not be implemented, no other reason to install interceptors.
// XFAIL: ubsan
-// UNSUPPORTED: rtsan
-
#include <stdlib.h>
#include <unistd.h>
#include <sanitizer/allocator_interface.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/malloc_hook_get_allocated_size_fast.cpp b/compiler-rt/test/sanitizer_common/TestCases/malloc_hook_get_allocated_size_fast.cpp
index f605f2a3e0346..68b22d4f99f63 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/malloc_hook_get_allocated_size_fast.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/malloc_hook_get_allocated_size_fast.cpp
@@ -6,8 +6,6 @@
// Must not be implemented, no other reason to install interceptors.
// XFAIL: ubsan
-// UNSUPPORTED: rtsan
-
#include <assert.h>
#include <sanitizer/allocator_interface.h>
#include <stdlib.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/max_allocation_size.cpp b/compiler-rt/test/sanitizer_common/TestCases/max_allocation_size.cpp
index 864d05f87e4c6..2fde16fbed3d2 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/max_allocation_size.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/max_allocation_size.cpp
@@ -46,8 +46,6 @@
// Symbolizer needs to allocated memory when reporting.
// UNSUPPORTED: internal_symbolizer
-// UNSUPPORTED: rtsan
-
#include <assert.h>
#include <errno.h>
#include <limits>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_control_flow.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_control_flow.cpp
index 5c440000762bd..5223af07f18ae 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_control_flow.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_control_flow.cpp
@@ -6,8 +6,6 @@
// RUN: %clangxx -O0 -std=c++11 -fsanitize-coverage=control-flow %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: rtsan
-
#include <cstdint>
#include <cstdio>
#if __has_feature(ptrauth_calls)
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cpp
index 60fdbfbff2432..68eca85eb4d42 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_inline8bit_counter.cpp
@@ -6,8 +6,6 @@
// RUN: %clangxx -O0 %s -fsanitize-coverage=inline-8bit-counters,pc-table -o %t
// RUN: %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: rtsan
-
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_inline_bool_flag.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_inline_bool_flag.cpp
index 59e63eab09077..d62ffe613b5b0 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_inline_bool_flag.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_inline_bool_flag.cpp
@@ -6,8 +6,6 @@
// RUN: %clangxx -O0 %s -fsanitize-coverage=inline-bool-flag,pc-table -o %t
// RUN: %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: rtsan
-
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cpp
index e985229673301..6a7bb0dda0a82 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_no_prune.cpp
@@ -4,7 +4,6 @@
// UNSUPPORTED: i386-darwin
// XFAIL: ubsan
// XFAIL: android && asan
-// UNSUPPORTED: rtsan
// RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=trace-pc,bb,no-prune 2>&1 | grep "call void @__sanitizer_cov_trace_pc" | count 3
// RUN: %clangxx -O0 %s -S -o - -emit-llvm -fsanitize-coverage=trace-pc,bb 2>&1 | grep "call void @__sanitizer_cov_trace_pc" | count 2
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_stack_depth.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_stack_depth.cpp
index 7765b39ecb739..29a63c0a92f32 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_stack_depth.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_stack_depth.cpp
@@ -6,8 +6,6 @@
// RUN: %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s --implicit-check-not Assertion{{.*}}failed
-// UNSUPPORTED: rtsan
-
#include <cstdint>
#include <cstdio>
#include <cassert>
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cpp
index 6518bcf1cb470..f6ccbb6981352 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard-dso.cpp
@@ -5,7 +5,6 @@
// UNSUPPORTED: ubsan,target={{(powerpc64|s390x|sparc|thumb).*}}
// XFAIL: tsan,darwin
// XFAIL: android && asan
-// UNSUPPORTED: rtsan
// RUN: rm -rf %t_workdir
// RUN: mkdir -p %t_workdir
diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp
index cfd65d6158f0e..3797c469eb186 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp
@@ -7,7 +7,6 @@
// XFAIL: tsan
// XFAIL: android && asan
// XFAIL: darwin-remote
-// UNSUPPORTED: rtsan
// RUN: rm -rf %t_workdir
// RUN: mkdir -p %t_workdir
diff --git a/flang-rt/lib/runtime/__fortran_builtins.f90 b/flang-rt/lib/runtime/__fortran_builtins.f90
index 8c3983f38dd31..840ad33eb2674 100644
--- a/flang-rt/lib/runtime/__fortran_builtins.f90
+++ b/flang-rt/lib/runtime/__fortran_builtins.f90
@@ -108,10 +108,6 @@
type(__builtin_dummy_team_descriptor_type), pointer, private :: info => null()
end type
- type, public, bind(C) :: __builtin_prif_coarray_handle_type
- type(__builtin_c_ptr), private :: info
- end type
-
integer, parameter, public :: __builtin_atomic_int_kind = selected_int_kind(18)
integer, parameter, public :: &
__builtin_atomic_logical_kind = __builtin_atomic_int_kind
diff --git a/flang/docs/FAQ.md b/flang/docs/FAQ.md
index b6a9069145cc8..c220d469380ce 100644
--- a/flang/docs/FAQ.md
+++ b/flang/docs/FAQ.md
@@ -32,11 +32,11 @@ An executable stack increases the risk and impact of certain classes of security
Therefore, modern linkers often issue a warning or an error if an executable stack is not explicitly requested by the developer.
For instance, the GNU Linker (`ld`) issues a warning while the LLVM Linker (`lld`) emits an error.
-:::{note}
+```{note}
The trampoline code generated by Flang is not itself a security risk.
The risk comes from the possibility of executing malicious code that an attacker has placed on the stack.
You should determine whether such risks are appropriate for your software.
-:::
+```
When you use the Flang driver (the `flang` command) to generate executables, you can instruct the linker to enable an executable stack with the `-Wl,-z,execstack` or `-Xlinker -zexecstack` flag.
diff --git a/flang/docs/GettingStarted.md b/flang/docs/GettingStarted.md
index 98620e6eafb07..62920bbb73ce4 100644
--- a/flang/docs/GettingStarted.md
+++ b/flang/docs/GettingStarted.md
@@ -86,14 +86,14 @@ cmake \
ninja
```
-:::{note}
+```{note}
Contributions to Flang are expected not to produce any new compiler warnings.
This is enforced by post-commit buildbots. To do the same locally, add
`-DFLANG_ENABLE_WERROR=ON` to the above `cmake` command.
Only Clang builds are checked for this, so we do not recommend using this
option with GCC as there will be preexisting warnings.
-:::
+```
On Darwin, to make flang able to link binaries with the default sysroot without
having to specify additional flags, use the `DEFAULT_SYSROOT` CMake flag, e.g.
@@ -163,14 +163,14 @@ cmake \
ninja
```
-:::{note}
+```{note}
Contributions to Flang are expected not to produce any new compiler warnings.
This is enforced by post-commit buildbots. To do the same locally, add
`-DFLANG_ENABLE_WERROR=ON` to the above `cmake` command.
Only Clang builds are checked for this, so we do not recommend using this
option with GCC as there will be preexisting warnings.
-:::
+```
To run the flang tests on this build, execute the command in the `flang/build`
directory:
diff --git a/flang/docs/ReleaseNotes.md b/flang/docs/ReleaseNotes.md
index bbc7084c4a757..2871b4b66c155 100644
--- a/flang/docs/ReleaseNotes.md
+++ b/flang/docs/ReleaseNotes.md
@@ -3,13 +3,13 @@ ReleaseNotes.md and ReleaseNotesTemplate.txt. -->
# Flang {{version}} {{in_progress}}Release Notes
-::::{only} PreRelease
-:::{warning}
+````{only} PreRelease
+```{warning}
These are in-progress notes for the upcoming LLVM {{version}} release.
Release notes for previous releases can be found on [the Download
Page](https://releases.llvm.org/download.html).
-:::
-::::
+```
+````
## Introduction
diff --git a/flang/docs/ReleaseNotesTemplate.txt b/flang/docs/ReleaseNotesTemplate.txt
index 0d320d364ba95..888da4d58b868 100644
--- a/flang/docs/ReleaseNotesTemplate.txt
+++ b/flang/docs/ReleaseNotesTemplate.txt
@@ -3,13 +3,13 @@ ReleaseNotes.md and ReleaseNotesTemplate.txt. -->
# Flang {{version}} {{in_progress}}Release Notes
-::::{only} PreRelease
-:::{warning}
+````{only} PreRelease
+```{warning}
These are in-progress notes for the upcoming LLVM {{version}} release.
Release notes for previous releases can be found on [the Download
Page](https://releases.llvm.org/download.html).
-:::
-::::
+```
+````
## Introduction
diff --git a/flang/include/flang/Optimizer/Dialect/FIROps.td b/flang/include/flang/Optimizer/Dialect/FIROps.td
index 9f9d45776b120..7635e3bf82035 100644
--- a/flang/include/flang/Optimizer/Dialect/FIROps.td
+++ b/flang/include/flang/Optimizer/Dialect/FIROps.td
@@ -93,9 +93,6 @@ def fir_AllocaOp : fir_Op<"alloca", [
an optional name. The allocation may have a dynamic repetition count
for allocating a sequence of locations for the specified type.
- A `fir.alloca` cannot be defined directly in a `builtin.module` because
- module scope does not provide a stack allocation context.
-
```
%c = ... : i64
%x = fir.alloca i32
diff --git a/flang/lib/Optimizer/Dialect/FIROps.cpp b/flang/lib/Optimizer/Dialect/FIROps.cpp
index c681c03fba777..970efae5488a2 100644
--- a/flang/lib/Optimizer/Dialect/FIROps.cpp
+++ b/flang/lib/Optimizer/Dialect/FIROps.cpp
@@ -382,8 +382,6 @@ void fir::AllocaOp::print(mlir::OpAsmPrinter &p) {
}
llvm::LogicalResult fir::AllocaOp::verify() {
- if (mlir::isa_and_nonnull<mlir::ModuleOp>((*this)->getParentOp()))
- return emitOpError("must not be defined at module scope");
llvm::SmallVector<llvm::StringRef> visited;
if (verifyInType(getInType(), visited, numShapeOperands()))
return emitOpError("invalid type for allocation");
diff --git a/flang/lib/Optimizer/Transforms/MIFOpConversion.cpp b/flang/lib/Optimizer/Transforms/MIFOpConversion.cpp
index fb3c794c0cd9e..efcb465016935 100644
--- a/flang/lib/Optimizer/Transforms/MIFOpConversion.cpp
+++ b/flang/lib/Optimizer/Transforms/MIFOpConversion.cpp
@@ -13,7 +13,6 @@
#include "flang/Optimizer/Builder/MIFCommon.h"
#include "flang/Optimizer/Builder/MutableBox.h"
#include "flang/Optimizer/Builder/Runtime/Inquiry.h"
-#include "flang/Optimizer/Builder/Runtime/Pointer.h"
#include "flang/Optimizer/Builder/Runtime/RTBuilder.h"
#include "flang/Optimizer/CodeGen/TypeConverter.h"
#include "flang/Optimizer/Dialect/FIRDialect.h"
@@ -64,31 +63,47 @@ genBoxedSequenceType(mlir::Type eleTy,
static mlir::Type getCoarrayHandleType(fir::FirOpBuilder &builder,
mlir::Location loc) {
// Defining the coarray handle type
- std::string handleDTName = fir::NameUniquer::doType(
- {"__fortran_builtins"}, {}, 0, "__builtin_prif_coarray_handle_type", {});
+ std::string handleDTName =
+ fir::NameUniquer::doType({"prif"}, {}, 0, "prif_coarray_handle", {});
fir::RecordType handleTy =
fir::RecordType::get(builder.getContext(), handleDTName);
-
- std::string cPtrTypeName = fir::NameUniquer::doType(
- {"__fortran_builtins"}, {}, 0, "__builtin_c_ptr", {});
- fir::RecordType cPtrType =
- fir::RecordType::get(builder.getContext(), cPtrTypeName);
- cPtrType.finalize({}, {{"__c_ptr_c_address", builder.getI64Type()}});
- handleTy.finalize({}, {{"info", cPtrType}});
+ mlir::Type infoTy =
+ fir::BoxType::get(fir::PointerType::get(builder.getNoneType()));
+ handleTy.finalize({}, {{"info", infoTy}});
+
+ // Checking if the type information was generated
+ fir::TypeInfoOp dt;
+ fir::RecordType parentType{};
+ mlir::OpBuilder::InsertPoint insertPointIfCreated;
+ std::tie(dt, insertPointIfCreated) =
+ builder.createTypeInfoOp(loc, handleTy, parentType);
+ if (insertPointIfCreated.isSet()) {
+ // fir.type_info wasn't built in a previous call.
+ dt->setAttr(dt.getNoInitAttrName(), builder.getUnitAttr());
+ dt->setAttr(dt.getNoDestroyAttrName(), builder.getUnitAttr());
+ dt->setAttr(dt.getNoFinalAttrName(), builder.getUnitAttr());
+ builder.restoreInsertionPoint(insertPointIfCreated);
+ // Create global op
+ // FIXME: replace handleTy by the Derived type that describe handleTy
+ std::string globalName =
+ fir::NameUniquer::getTypeDescriptorName(handleDTName);
+ auto linkage = builder.createLinkOnceODRLinkage();
+ builder.createGlobal(loc, handleTy, globalName, linkage);
+ }
return handleTy;
}
mlir::Value getCoarrayHandle(fir::FirOpBuilder &builder, mlir::Location loc,
mlir::Value coarray) {
- mlir::Type handleTy = getCoarrayHandleType(builder, loc);
+ mlir::Type boxTy = fir::BoxType::get(builder.getNoneType());
std::string uniqName = mif::getFullUniqName(coarray);
if (!uniqName.empty()) {
std::string globalName = uniqName + coarrayHandleSuffix.str();
mlir::SymbolRefAttr symAttr =
mlir::SymbolRefAttr::get(builder.getContext(), globalName);
- mlir::Value coarrayHandle = fir::AddrOfOp::create(
- builder, loc, builder.getRefType(handleTy), symAttr);
- return coarrayHandle;
+ mlir::Value coarrayHandle =
+ fir::AddrOfOp::create(builder, loc, builder.getRefType(boxTy), symAttr);
+ return fir::LoadOp::create(builder, loc, coarrayHandle);
}
mlir::emitError(coarray.getLoc(),
"Unable to locate the coarray handle for this argument.");
@@ -98,27 +113,27 @@ mlir::Value getCoarrayHandle(fir::FirOpBuilder &builder, mlir::Location loc,
// Storing the coarray descriptor as a global variable
void storeCoarrayHandle(fir::FirOpBuilder &builder, mlir::Location loc,
mlir::Value coarrayHandle, std::string uniqName) {
- mlir::Type handleTy = getCoarrayHandleType(builder, loc);
std::string globalName = uniqName + coarrayHandleSuffix.str();
fir::GlobalOp global = builder.getNamedGlobal(globalName);
if (!global) {
- global = builder.createGlobal(loc, handleTy, globalName,
+ global = builder.createGlobal(loc, coarrayHandle.getType(), globalName,
builder.createLinkOnceLinkage());
mlir::Region ®ion = global.getRegion();
region.push_back(new mlir::Block);
mlir::Block &block = region.back();
auto insertPt = builder.saveInsertionPoint();
builder.setInsertionPointToStart(&block);
- mlir::Value zeroValue = fir::ZeroOp::create(builder, loc, handleTy);
- fir::HasValueOp::create(builder, loc, zeroValue);
+ auto box = fir::factory::createUnallocatedBox(builder, loc,
+ coarrayHandle.getType(), {});
+ fir::HasValueOp::create(builder, loc, box);
builder.restoreInsertionPoint(insertPt);
}
mlir::SymbolRefAttr symAttr =
mlir::SymbolRefAttr::get(builder.getContext(), globalName);
- auto addrOf = fir::AddrOfOp::create(builder, loc,
- builder.getRefType(handleTy), symAttr);
- fir::CopyOp::create(builder, loc, coarrayHandle, addrOf);
+ auto addrOf = fir::AddrOfOp::create(
+ builder, loc, builder.getRefType(coarrayHandle.getType()), symAttr);
+ fir::StoreOp::create(builder, loc, coarrayHandle, addrOf);
}
std::int64_t getCorank(mlir::Value coarray) {
@@ -456,6 +471,7 @@ struct MIFThisImageOpConversion
mlir::Type i64Ty = builder.getI64Type();
mlir::Type i32Ty = builder.getI32Type();
+ mlir::Type boxTy = fir::BoxType::get(rewriter.getNoneType());
mlir::Type refTy = builder.getRefType(rewriter.getNoneType());
mlir::Value teamArg = op.getTeam();
@@ -476,7 +492,7 @@ struct MIFThisImageOpConversion
result = builder.createTemporary(loc, i64Ty);
ftype = mlir::FunctionType::get(builder.getContext(),
/*inputs*/
- {refTy, builder.getRefType(i32Ty),
+ {boxTy, builder.getRefType(i32Ty),
refTy, builder.getRefType(i64Ty)},
/*results*/ {});
funcOp = builder.createFunction(
@@ -493,7 +509,7 @@ struct MIFThisImageOpConversion
result = builder.createBox(loc, builder.createTemporary(loc, resTy));
ftype = mlir::FunctionType::get(
builder.getContext(),
- /*inputs*/ {refTy, refTy, fir::BoxType::get(resTy)},
+ /*inputs*/ {boxTy, refTy, fir::BoxType::get(resTy)},
/*results*/ {});
funcOp = builder.createFunction(
loc, getPRIFProcName("this_image_with_coarray"), ftype);
@@ -1088,19 +1104,20 @@ struct MIFAllocCoarrayOpConversion
mlir::Type i64Ty = builder.getI64Type();
mlir::Type ptrTy = fir::PointerType::get(builder.getNoneType());
- mlir::Type refTy = builder.getRefType(builder.getNoneType());
+ mlir::Type boxTy = fir::BoxType::get(builder.getNoneType());
mlir::Type errmsgTy = getPRIFErrmsgType(builder);
mlir::Type coboundsTy = genBoxedSequenceType(i64Ty);
// Type of the procedure pointed by final_func will be the following :
mlir::Type procTypePtr = fir::BoxProcType::get(
builder.getContext(),
mlir::FunctionType::get(builder.getContext(),
- {refTy, getPRIFStatType(builder), errmsgTy},
+ {boxTy, getPRIFStatType(builder), errmsgTy},
{}));
mlir::FunctionType ftype = mlir::FunctionType::get(
builder.getContext(),
/*inputs*/
- {coboundsTy, coboundsTy, builder.getRefType(i64Ty), refTy, refTy, ptrTy,
+ {coboundsTy, coboundsTy, builder.getRefType(i64Ty),
+ builder.getRefType(builder.getNoneType()), boxTy, ptrTy,
getPRIFStatType(builder), errmsgTy, errmsgTy},
/*results*/ {});
mlir::func::FuncOp funcOp =
@@ -1114,7 +1131,8 @@ struct MIFAllocCoarrayOpConversion
// Allocate instance of prif_coarray_handle type based on the PRIF
// specification.
mlir::Type handleTy = getCoarrayHandleType(builder, loc);
- mlir::Value coarrayHandle = builder.createTemporary(loc, handleTy);
+ mlir::Value coarrayHandle =
+ builder.createBox(loc, builder.createTemporary(loc, handleTy));
mlir::Value allocMem =
fir::ConvertOp::create(builder, loc, ptrTy, op.getBox());
@@ -1157,11 +1175,11 @@ struct MIFDeallocCoarrayOpConversion
mlir::Location loc = op.getLoc();
mlir::Type errmsgTy = getPRIFErrmsgType(builder);
- mlir::Type refTy = builder.getRefType(builder.getNoneType());
+ mlir::Type boxTy = fir::BoxType::get(builder.getNoneType());
mlir::FunctionType ftype = mlir::FunctionType::get(
builder.getContext(),
/*inputs*/
- {refTy, getPRIFStatType(builder), errmsgTy, errmsgTy},
+ {boxTy, getPRIFStatType(builder), errmsgTy, errmsgTy},
/*results*/ {});
mlir::func::FuncOp funcOp = builder.createFunction(
loc, getPRIFProcName("deallocate_coarray"), ftype);
@@ -1175,16 +1193,6 @@ struct MIFDeallocCoarrayOpConversion
llvm::SmallVector<mlir::Value> args = fir::runtime::createArguments(
builder, loc, ftype, coarrayHandle, stat, errmsgArg, errmsgAllocArg);
fir::CallOp callOp = fir::CallOp::create(builder, loc, funcOp, args);
-
- // The coarray is deallocated in the coarray_handle but we need to
- // set the address of the variable to null.
- mlir::Type coarrayType = op.getCoarray().getType();
- if (fir::isAllocatableType(coarrayType)) {
- mlir::Value absent = fir::AbsentOp::create(builder, loc, coarrayType);
- fir::runtime::genPointerAssociateScalar(builder, loc, op.getCoarray(),
- absent);
- }
-
rewriter.replaceOp(op, callOp);
return mlir::success();
}
@@ -1201,11 +1209,11 @@ struct MIFCoshapeOpConversion : public mlir::OpRewritePattern<mif::CoshapeOp> {
fir::FirOpBuilder builder(rewriter, mod);
mlir::Location loc = op.getLoc();
mlir::Type i64Ty = builder.getI64Type();
- mlir::Type refTy = builder.getRefType(builder.getNoneType());
+ mlir::Type boxTy = fir::BoxType::get(builder.getNoneType());
mlir::FunctionType ftype =
mlir::FunctionType::get(builder.getContext(),
- /*inputs*/ {refTy, genBoxedSequenceType(i64Ty)},
+ /*inputs*/ {boxTy, genBoxedSequenceType(i64Ty)},
/*results*/ {});
mlir::func::FuncOp funcOp =
builder.createFunction(loc, getPRIFProcName("coshape"), ftype);
@@ -1239,14 +1247,14 @@ mlir::LogicalResult CoboundOpConversion(T op, mlir::PatternRewriter &rewriter,
fir::FirOpBuilder builder(rewriter, mod);
mlir::Location loc = op.getLoc();
mlir::Type i64Ty = builder.getI64Type();
- mlir::Type refTy = builder.getRefType(builder.getNoneType());
+ mlir::Type boxTy = fir::BoxType::get(builder.getNoneType());
mlir::Value coarrayHandle = getCoarrayHandle(builder, loc, op.getCoarray());
mlir::Type i32Ty = builder.getI32Type();
mlir::FunctionType ftype = mlir::FunctionType::get(
builder.getContext(),
/*inputs*/
- {refTy, builder.getRefType(i32Ty), builder.getRefType(i64Ty)},
+ {boxTy, builder.getRefType(i32Ty), builder.getRefType(i64Ty)},
/*results*/ {});
mlir::func::FuncOp funcOp =
builder.createFunction(loc, getPRIFProcName(prefix + "_with_dim"), ftype);
@@ -1306,7 +1314,7 @@ struct MIFImageIndexOpConversion
mlir::Type i64Ty = builder.getI64Type();
mlir::Type i32Ty = builder.getI32Type();
mlir::Type resTy = builder.getRefType(i32Ty);
- mlir::Type refTy = builder.getRefType(builder.getNoneType());
+ mlir::Type boxTy = fir::BoxType::get(builder.getNoneType());
mlir::Value result = builder.createTemporary(loc, i32Ty);
mlir::func::FuncOp funcOp;
@@ -1315,7 +1323,7 @@ struct MIFImageIndexOpConversion
if (!op.getTeam() && !op.getTeamNumber()) {
mlir::FunctionType ftype = mlir::FunctionType::get(
builder.getContext(),
- /*inputs*/ {refTy, genBoxedSequenceType(i64Ty), resTy},
+ /*inputs*/ {boxTy, genBoxedSequenceType(i64Ty), resTy},
/*results*/ {});
funcOp =
builder.createFunction(loc, getPRIFProcName("image_index"), ftype);
@@ -1335,7 +1343,7 @@ struct MIFImageIndexOpConversion
}
mlir::FunctionType ftype = mlir::FunctionType::get(
builder.getContext(),
- /*inputs*/ {refTy, genBoxedSequenceType(i64Ty), teamTy, resTy},
+ /*inputs*/ {boxTy, genBoxedSequenceType(i64Ty), teamTy, resTy},
/*results*/ {});
funcOp = builder.createFunction(loc, imageIndexName, ftype);
@@ -1356,11 +1364,10 @@ static void genCoarrayHandle(fir::FirOpBuilder &builder, mlir::ModuleOp mod,
if (auto boxTy = mlir::dyn_cast<fir::BaseBoxType>(ty)) {
if (boxTy.isCoarray()) {
- mlir::Type handleTy = getCoarrayHandleType(builder, loc);
+ mlir::Type handleTy =
+ fir::BoxType::get(getCoarrayHandleType(builder, loc));
std::string globalName =
op.getUniqName().str() + coarrayHandleSuffix.str();
- if (builder.getNamedGlobal(globalName))
- return;
fir::GlobalOp global = builder.createGlobal(
loc, handleTy, globalName, builder.createLinkOnceLinkage());
mlir::Region ®ion = global.getRegion();
@@ -1368,8 +1375,8 @@ static void genCoarrayHandle(fir::FirOpBuilder &builder, mlir::ModuleOp mod,
mlir::Block &block = region.back();
auto insertPt = builder.saveInsertionPoint();
builder.setInsertionPointToStart(&block);
- mlir::Value zeroValue = fir::ZeroOp::create(builder, loc, handleTy);
- fir::HasValueOp::create(builder, loc, zeroValue);
+ auto box = fir::factory::createUnallocatedBox(builder, loc, handleTy, {});
+ fir::HasValueOp::create(builder, loc, box);
builder.restoreInsertionPoint(insertPt);
}
}
diff --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp
index 27c4e96d269aa..613696852aa88 100644
--- a/flang/lib/Semantics/resolve-names.cpp
+++ b/flang/lib/Semantics/resolve-names.cpp
@@ -795,9 +795,6 @@ class ScopeHandler : public ImplicitRulesVisitor {
bool deferImplicitTyping_{false};
bool skipImplicitTyping_{false};
bool inEquivalenceStmt_{false};
- // Whether the DATA statement whose objects are being visited appeared in
- // a specification part (as opposed to an execution part)
- bool dataStmtObjectInSpecPart_{false};
// Some information is collected from a specification part for deferred
// processing in DeclarationPartVisitor functions (e.g., CheckSaveStmts())
@@ -811,10 +808,6 @@ class ScopeHandler : public ImplicitRulesVisitor {
std::vector<const std::list<parser::EquivalenceObject> *> equivalenceSets;
// Names of all common block objects in the scope
std::set<SourceName> commonBlockObjects;
- // data-implied-do index variables whose typing is deferred to the end
- // of the specification part, since the declaration typing the index's
- // name may follow the DATA statement (F'2023 19.4 p5)
- std::vector<MutableSymbolRef> deferredDataIDoVars;
// Info about SAVE statements and attributes in current scope
struct {
std::optional<SourceName> saveAll; // "SAVE" without entity list
@@ -8310,14 +8303,8 @@ Symbol *DeclarationVisitor::DeclareStatementEntity(
// an explicit "integer(k)::" in an implied DO.
context().NoteDefinedSymbol(*prev);
name.symbol = nullptr; // undo the "FindSymbol()" above
- if (!dataStmtObjectInSpecPart_ || type) {
- // F'2023 19.4 p5: the index adopts the type of a visible declaration
- // of its name (see Extensions.md on 19.4 p5). But for a DATA
- // statement in a specification part, defer typing to
- // FinishSpecificationPart(), where a local declaration following the
- // DATA statement takes precedence over this outer one.
- declTypeSpec = prev->GetType();
- }
+ // F'2023 19.4 p5 ambiguous rule about outer declarations
+ declTypeSpec = prev->GetType();
}
Symbol &symbol{DeclareEntity<ObjectEntityDetails>(name, {})};
if (!symbol.has<ObjectEntityDetails>()) {
@@ -8332,12 +8319,6 @@ Symbol *DeclarationVisitor::DeclareStatementEntity(
auto restorer{
common::ScopedSet(charInfo_.length, std::optional<ParamValue>{})};
SetType(name, *declTypeSpec);
- } else if (dataStmtObjectInSpecPart_) {
- // F'2023 19.4 p5: the index takes the type its name has in the scoping
- // unit, and that declaration may follow the DATA statement; defer
- // typing to FinishSpecificationPart(). (8.6.7 p3 restricts only the
- // data-stmt-objects, not this statement entity.)
- specPartState_.deferredDataIDoVars.emplace_back(symbol);
} else {
ApplyImplicitRules(symbol);
}
@@ -8769,8 +8750,6 @@ bool ConstructVisitor::Pre(const parser::DataStmtObject &x) {
// for purposes of implicit variable declaration vs. host association.
// When a name first appears as an object in a DATA statement, it should
// be implicitly declared locally as if it had been assigned.
- auto specPartRestorer{
- common::ScopedSet(dataStmtObjectInSpecPart_, inSpecificationPart_)};
auto flagRestorer{common::ScopedSet(inSpecificationPart_, false)};
common::visit(
common::visitors{
@@ -10778,24 +10757,6 @@ void ResolveNamesVisitor::FinishSpecificationPart(
}
}
}
- // Type the deferred data-implied-do index variables now that the whole
- // specification part has been visited (F'2023 19.4 p5). Plain
- // Symbol::SetType suffices: the symbol is untyped, so no conflict
- // diagnostics can arise.
- for (MutableSymbolRef ref : specPartState_.deferredDataIDoVars) {
- Symbol &symbol{*ref};
- if (!symbol.GetType()) {
- if (const Symbol *outer{currScope().FindSymbol(symbol.name())};
- outer && outer->GetType()) {
- symbol.SetType(*outer->GetType());
- // Inhibit unused-variable diagnostics: the outer declaration may
- // exist solely to give the index its type.
- context().NoteDefinedSymbol(*outer);
- } else {
- ApplyImplicitRules(symbol);
- }
- }
- }
currScope().InstantiateDerivedTypes();
for (const auto &decl : decls) {
if (const auto *statement{std::get_if<
diff --git a/flang/test/Fir/MIF/coarray-alloc.mlir b/flang/test/Fir/MIF/coarray-alloc.mlir
index c32f80c8866b4..a96bfc5935534 100644
--- a/flang/test/Fir/MIF/coarray-alloc.mlir
+++ b/flang/test/Fir/MIF/coarray-alloc.mlir
@@ -1,264 +1,242 @@
// RUN: fir-opt --mif-convert %s | FileCheck %s
-// CEHCK-LABEL: @_QQmain
-func.func @_QQmain() attributes {fir.bindc_name = "ALLOC_TEST"} {
- %c0_i32 = arith.constant 0 : i32
- %c1_i32 = arith.constant 1 : i32
- %c100_i32 = arith.constant 100 : i32
- %c5_i32 = arith.constant 5 : i32
- %c4_i32 = arith.constant 4 : i32
- %c3_i32 = arith.constant 3 : i32
- %c2_i32 = arith.constant 2 : i32
- %c3 = arith.constant 3 : index
- %c10 = arith.constant 10 : index
- %c5_i64 = arith.constant 5 : i64
- %c4_i64 = arith.constant 4 : i64
- %c3_i64 = arith.constant 3 : i64
- %c2_i64 = arith.constant 2 : i64
- %c0 = arith.constant 0 : index
- %c1_i64 = arith.constant 1 : i64
- %c7 = arith.constant 7 : index
- %c1 = arith.constant 1 : index
- %c2 = arith.constant 2 : index
- %c8 = arith.constant 8 : index
- %0 = fir.alloca !fir.array<0xi64>
- %1 = fir.alloca !fir.array<1xi64>
- %2 = fir.alloca !fir.array<0xi64>
- %3 = fir.alloca !fir.array<1xi64>
- %4 = fir.alloca !fir.array<2xi64>
- %5 = fir.alloca !fir.array<3xi64>
- %6 = fir.alloca !fir.array<1xi64>
- %7 = fir.alloca !fir.array<2xi64>
- %8 = fir.alloca !fir.array<0xi64>
- %9 = fir.alloca !fir.array<1xi64>
- %10 = fir.alloca !fir.array<2xi64>
- %11 = fir.alloca !fir.array<3xi64>
- %12 = fir.alloca !fir.array<1xi64>
- %13 = fir.alloca !fir.array<2xi64>
- %14 = fir.dummy_scope : !fir.dscope
- %15 = fir.address_of(@_QFE.n.my_type2) : !fir.ref<!fir.char<1,8>>
- %16 = fir.declare %15 typeparams %c8 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.n.my_type2"} : (!fir.ref<!fir.char<1,8>>, index) -> !fir.ref<!fir.char<1,8>>
- %17 = fir.address_of(@_QFE.n.co) : !fir.ref<!fir.char<1,2>>
- %18 = fir.declare %17 typeparams %c2 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.n.co"} : (!fir.ref<!fir.char<1,2>>, index) -> !fir.ref<!fir.char<1,2>>
- %19 = fir.address_of(@_QFE.n.x) : !fir.ref<!fir.char<1>>
- %20 = fir.declare %19 typeparams %c1 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.n.x"} : (!fir.ref<!fir.char<1>>, index) -> !fir.ref<!fir.char<1>>
- %21 = fir.address_of(@_QFE.n.y) : !fir.ref<!fir.char<1>>
- %22 = fir.declare %21 typeparams %c1 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.n.y"} : (!fir.ref<!fir.char<1>>, index) -> !fir.ref<!fir.char<1>>
- %23 = fir.address_of(@_QFE.n.z) : !fir.ref<!fir.char<1>>
- %24 = fir.declare %23 typeparams %c1 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.n.z"} : (!fir.ref<!fir.char<1>>, index) -> !fir.ref<!fir.char<1>>
- %25 = fir.address_of(@_QFE.n.my_type) : !fir.ref<!fir.char<1,7>>
- %26 = fir.declare %25 typeparams %c7 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.n.my_type"} : (!fir.ref<!fir.char<1,7>>, index) -> !fir.ref<!fir.char<1,7>>
- %27 = fir.address_of(@_QFEa) : !fir.ref<i32>
- %28 = fir.coordinate_of %13, %c0 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
- fir.store %c1_i64 to %28 : !fir.ref<i64>
- %29 = fir.coordinate_of %13, %c1 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
- fir.store %c1_i64 to %29 : !fir.ref<i64>
- %30 = fir.embox %13 : (!fir.ref<!fir.array<2xi64>>) -> !fir.box<!fir.array<2xi64>>
- %31 = fir.coordinate_of %12, %c0 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
- fir.store %c2_i64 to %31 : !fir.ref<i64>
- %32 = fir.embox %12 : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
- mif.alloc_coarray %27 lcobounds %30 ucobounds %32 {uniq_name = "_QFEa"} : (!fir.ref<i32>, !fir.box<!fir.array<2xi64>>, !fir.box<!fir.array<1xi64>>) -> ()
-// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.ref<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
- %33 = fir.declare %27 {uniq_name = "_QFEa"} : (!fir.ref<i32>) -> !fir.ref<i32>
- %34 = fir.address_of(@_QFEa2) : !fir.ref<!fir.box<!fir.heap<i32>, corank:2>>
- %35 = fir.declare %34 {fortran_attrs = #fir.var_attrs<allocatable>, uniq_name = "_QFEa2"} : (!fir.ref<!fir.box<!fir.heap<i32>, corank:2>>) -> !fir.ref<!fir.box<!fir.heap<i32>, corank:2>>
- %36 = fir.address_of(@_QFEb) : !fir.ref<f32>
- %37 = fir.coordinate_of %11, %c0 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
- fir.store %c3_i64 to %37 : !fir.ref<i64>
- %38 = fir.coordinate_of %11, %c1 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
- fir.store %c1_i64 to %38 : !fir.ref<i64>
- %39 = fir.coordinate_of %11, %c2 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
- fir.store %c1_i64 to %39 : !fir.ref<i64>
- %40 = fir.embox %11 : (!fir.ref<!fir.array<3xi64>>) -> !fir.box<!fir.array<3xi64>>
- %41 = fir.coordinate_of %10, %c0 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
- fir.store %c4_i64 to %41 : !fir.ref<i64>
- %42 = fir.coordinate_of %10, %c1 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
- fir.store %c5_i64 to %42 : !fir.ref<i64>
- %43 = fir.embox %10 : (!fir.ref<!fir.array<2xi64>>) -> !fir.box<!fir.array<2xi64>>
- mif.alloc_coarray %36 lcobounds %40 ucobounds %43 {uniq_name = "_QFEb"} : (!fir.ref<f32>, !fir.box<!fir.array<3xi64>>, !fir.box<!fir.array<2xi64>>) -> ()
-// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.ref<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
- %44 = fir.declare %36 {uniq_name = "_QFEb"} : (!fir.ref<f32>) -> !fir.ref<f32>
- %45 = fir.address_of(@_QFEb2) : !fir.ref<!fir.box<!fir.heap<f32>, corank:3>>
- %46 = fir.declare %45 {fortran_attrs = #fir.var_attrs<allocatable>, uniq_name = "_QFEb2"} : (!fir.ref<!fir.box<!fir.heap<f32>, corank:3>>) -> !fir.ref<!fir.box<!fir.heap<f32>, corank:3>>
- %47 = fir.address_of(@_QFEc) : !fir.ref<!fir.char<1,10>>
- %48 = fir.coordinate_of %9, %c0 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
- fir.store %c1_i64 to %48 : !fir.ref<i64>
- %49 = fir.embox %9 : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
- %50 = fir.embox %8 : (!fir.ref<!fir.array<0xi64>>) -> !fir.box<!fir.array<0xi64>>
- mif.alloc_coarray %47 lcobounds %49 ucobounds %50 {uniq_name = "_QFEc"} : (!fir.ref<!fir.char<1,10>>, !fir.box<!fir.array<1xi64>>, !fir.box<!fir.array<0xi64>>) -> ()
-// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.ref<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
- %51 = fir.declare %47 typeparams %c10 {uniq_name = "_QFEc"} : (!fir.ref<!fir.char<1,10>>, index) -> !fir.ref<!fir.char<1,10>>
- %52 = fir.address_of(@_QFEc2) : !fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>, corank:1>>
- %53 = fir.declare %52 {fortran_attrs = #fir.var_attrs<allocatable>, uniq_name = "_QFEc2"} : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>, corank:1>>) -> !fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>, corank:1>>
- %54 = fir.address_of(@_QFEd) : !fir.ref<!fir.type<_QFTmy_type{x:i32,y:!fir.box<!fir.heap<!fir.array<?xi32>>>,z:!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>, corank:1>}>}>>
- %55 = fir.declare %54 {uniq_name = "_QFEd"} : (!fir.ref<!fir.type<_QFTmy_type{x:i32,y:!fir.box<!fir.heap<!fir.array<?xi32>>>,z:!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>, corank:1>}>}>>) -> !fir.ref<!fir.type<_QFTmy_type{x:i32,y:!fir.box<!fir.heap<!fir.array<?xi32>>>,z:!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>, corank:1>}>}>>
- %56 = fir.address_of(@_QFE.c.my_type2) : !fir.ref<!fir.array<1x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>
- %57 = fir.shape_shift %c0, %c1 : (index, index) -> !fir.shapeshift<1>
- %58 = fir.declare %56(%57) {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.c.my_type2"} : (!fir.ref<!fir.array<1x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>, !fir.shapeshift<1>) -> !fir.ref<!fir.array<1x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>
- %59 = fir.embox %58(%57) : (!fir.ref<!fir.array<1x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>, !fir.shapeshift<1>) -> !fir.box<!fir.array<1x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>
- %60 = fir.address_of(@_QFE.dt.my_type) : !fir.ref<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>
- %61 = fir.declare %60 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.dt.my_type"} : (!fir.ref<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>) -> !fir.ref<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>
- %62 = fir.address_of(@_QFE.dt.my_type2) : !fir.ref<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>
- %63 = fir.declare %62 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.dt.my_type2"} : (!fir.ref<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>) -> !fir.ref<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>
- %64 = fir.address_of(@_QFE.c.my_type) : !fir.ref<!fir.array<3x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>
- %65 = fir.shape_shift %c0, %c3 : (index, index) -> !fir.shapeshift<1>
- %66 = fir.declare %64(%65) {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.c.my_type"} : (!fir.ref<!fir.array<3x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>, !fir.shapeshift<1>) -> !fir.ref<!fir.array<3x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>
- %67 = fir.embox %66(%65) : (!fir.ref<!fir.array<3x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>, !fir.shapeshift<1>) -> !fir.box<!fir.array<3x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>
- %68 = fir.absent !fir.box<none>
- %69 = fir.convert %c2_i32 : (i32) -> i64
- %70 = fir.coordinate_of %7, %c0 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
- fir.store %c1_i64 to %70 : !fir.ref<i64>
- %71 = fir.coordinate_of %6, %c0 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
- fir.store %69 to %71 : !fir.ref<i64>
- %72 = fir.coordinate_of %7, %c1 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
- fir.store %c1_i64 to %72 : !fir.ref<i64>
- %73 = fir.embox %7 : (!fir.ref<!fir.array<2xi64>>) -> !fir.box<!fir.array<2xi64>>
- %74 = fir.embox %6 : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
- mif.alloc_coarray %35 lcobounds %73 ucobounds %74 errmsg %68 {uniq_name = "_QFEa2"} : (!fir.ref<!fir.box<!fir.heap<i32>, corank:2>>, !fir.box<!fir.array<2xi64>>, !fir.box<!fir.array<1xi64>>, !fir.box<none>) -> ()
-// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.ref<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
- %75 = fir.absent !fir.box<none>
- %76 = fir.convert %c3_i32 : (i32) -> i64
- %77 = fir.convert %c4_i32 : (i32) -> i64
- %78 = fir.coordinate_of %5, %c0 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
- fir.store %76 to %78 : !fir.ref<i64>
- %79 = fir.coordinate_of %4, %c0 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
- fir.store %77 to %79 : !fir.ref<i64>
- %80 = fir.convert %c5_i32 : (i32) -> i64
- %81 = fir.coordinate_of %5, %c1 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
- fir.store %c1_i64 to %81 : !fir.ref<i64>
- %82 = fir.coordinate_of %4, %c1 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
- fir.store %80 to %82 : !fir.ref<i64>
- %83 = fir.coordinate_of %5, %c2 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
- fir.store %c1_i64 to %83 : !fir.ref<i64>
- %84 = fir.embox %5 : (!fir.ref<!fir.array<3xi64>>) -> !fir.box<!fir.array<3xi64>>
- %85 = fir.embox %4 : (!fir.ref<!fir.array<2xi64>>) -> !fir.box<!fir.array<2xi64>>
- mif.alloc_coarray %46 lcobounds %84 ucobounds %85 errmsg %75 {uniq_name = "_QFEb2"} : (!fir.ref<!fir.box<!fir.heap<f32>, corank:3>>, !fir.box<!fir.array<3xi64>>, !fir.box<!fir.array<2xi64>>, !fir.box<none>) -> ()
-// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.ref<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
- %86 = fir.absent !fir.box<none>
- %87 = fir.convert %53 : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>, corank:1>>) -> !fir.ref<!fir.box<none>>
- %88 = fir.convert %c100_i32 : (i32) -> i64
- fir.call @_FortranAAllocatableInitCharacterForAllocate(%87, %88, %c1_i32, %c1_i32, %c0_i32) fastmath<contract> : (!fir.ref<!fir.box<none>>, i64, i32, i32, i32) -> ()
- %89 = fir.convert %53 : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>, corank:1>>) -> !fir.ref<!fir.box<none>>
- %90 = fir.convert %c1 : (index) -> i64
- %91 = fir.convert %c5_i32 : (i32) -> i64
- fir.call @_FortranAAllocatableSetBounds(%89, %c0_i32, %90, %91) fastmath<contract> : (!fir.ref<!fir.box<none>>, i32, i64, i64) -> ()
- %92 = fir.coordinate_of %3, %c0 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
- fir.store %c1_i64 to %92 : !fir.ref<i64>
- %93 = fir.embox %3 : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
- %94 = fir.embox %2 : (!fir.ref<!fir.array<0xi64>>) -> !fir.box<!fir.array<0xi64>>
- mif.alloc_coarray %53 lcobounds %93 ucobounds %94 errmsg %86 {uniq_name = "_QFEc2"} : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>, corank:1>>, !fir.box<!fir.array<1xi64>>, !fir.box<!fir.array<0xi64>>, !fir.box<none>) -> ()
-// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.ref<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
- %95 = fir.absent !fir.box<none>
- %96 = fir.field_index z, !fir.type<_QFTmy_type{x:i32,y:!fir.box<!fir.heap<!fir.array<?xi32>>>,z:!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>, corank:1>}>}>
- %97 = fir.coordinate_of %55, z : (!fir.ref<!fir.type<_QFTmy_type{x:i32,y:!fir.box<!fir.heap<!fir.array<?xi32>>>,z:!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>, corank:1>}>}>>) -> !fir.ref<!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>, corank:1>}>>
- %98 = fir.field_index co, !fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>, corank:1>}>
- %99 = fir.coordinate_of %97, co : (!fir.ref<!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>, corank:1>}>>) -> !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>
- %100 = fir.coordinate_of %1, %c0 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
- fir.store %c1_i64 to %100 : !fir.ref<i64>
- %101 = fir.embox %1 : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
- %102 = fir.embox %0 : (!fir.ref<!fir.array<0xi64>>) -> !fir.box<!fir.array<0xi64>>
- mif.alloc_coarray %99 lcobounds %101 ucobounds %102 errmsg %95 {uniq_name = "_QFEd.z.co"} : (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>, !fir.box<!fir.array<1xi64>>, !fir.box<!fir.array<0xi64>>, !fir.box<none>) -> ()
-// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.ref<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
- %103 = fir.absent !fir.box<none>
- %104 = fir.absent !fir.ref<i32>
- mif.dealloc_coarray %35 stat %104 errmsg %103 : (!fir.ref<!fir.box<!fir.heap<i32>, corank:2>>, !fir.ref<i32>, !fir.box<none>) -> ()
-// CHECK: fir.call @_QMprifPprif_deallocate_coarray({{.*}}) : (!fir.ref<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
- %105 = fir.absent !fir.ref<i32>
- mif.dealloc_coarray %46 stat %105 errmsg %103 : (!fir.ref<!fir.box<!fir.heap<f32>, corank:3>>, !fir.ref<i32>, !fir.box<none>) -> ()
-// CHECK: fir.call @_QMprifPprif_deallocate_coarray({{.*}}) : (!fir.ref<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
- %106 = fir.absent !fir.ref<i32>
- mif.dealloc_coarray %53 stat %106 errmsg %103 : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>, corank:1>>, !fir.ref<i32>, !fir.box<none>) -> ()
-// CHECK: fir.call @_QMprifPprif_deallocate_coarray({{.*}}) : (!fir.ref<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
- %107 = fir.absent !fir.box<none>
- %108 = fir.field_index z, !fir.type<_QFTmy_type{x:i32,y:!fir.box<!fir.heap<!fir.array<?xi32>>>,z:!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>, corank:1>}>}>
- %109 = fir.coordinate_of %55, z : (!fir.ref<!fir.type<_QFTmy_type{x:i32,y:!fir.box<!fir.heap<!fir.array<?xi32>>>,z:!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>, corank:1>}>}>>) -> !fir.ref<!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>, corank:1>}>>
- %110 = fir.field_index co, !fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>, corank:1>}>
- %111 = fir.coordinate_of %109, co : (!fir.ref<!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>, corank:1>}>>) -> !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>
- %112 = fir.absent !fir.ref<i32>
- mif.dealloc_coarray %111 stat %112 errmsg %107 : (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>, !fir.ref<i32>, !fir.box<none>) -> ()
-// CHECK: fir.call @_QMprifPprif_deallocate_coarray({{.*}}) : (!fir.ref<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
- return
-}
-
-// CEHCK-LABEL: @_QPtest_alloc2
-func.func @_QPtest_alloc2() {
- %c0_i64 = arith.constant 0 : i64
- %c0 = arith.constant 0 : index
- %c1_i32 = arith.constant 1 : i32
- %c0_i32 = arith.constant 0 : i32
- %c4_i32 = arith.constant 4 : i32
- %c2_i32 = arith.constant 2 : i32
- %0 = fir.alloca !fir.array<0xi64>
- %1 = fir.alloca !fir.array<1xi64>
- %2 = fir.alloca i32
- %3 = fir.alloca !fir.array<0xi64>
- %4 = fir.alloca !fir.array<1xi64>
- %5 = fir.dummy_scope : !fir.dscope
- %6 = fir.alloca !fir.class<!fir.heap<none>, corank:1> {bindc_name = "a", uniq_name = "_QFtest_alloc2Ea"}
- %7 = fir.zero_bits !fir.heap<none>
- %8 = fir.embox %7 : (!fir.heap<none>) -> !fir.class<!fir.heap<none>, corank:1>
- fir.store %8 to %6 : !fir.ref<!fir.class<!fir.heap<none>, corank:1>>
- %9 = fir.declare %6 {fortran_attrs = #fir.var_attrs<allocatable>, uniq_name = "_QFtest_alloc2Ea"} : (!fir.ref<!fir.class<!fir.heap<none>, corank:1>>) -> !fir.ref<!fir.class<!fir.heap<none>, corank:1>>
- %10 = fir.alloca !fir.class<!fir.heap<none>, corank:1> {bindc_name = "b", uniq_name = "_QFtest_alloc2Eb"}
- %11 = fir.zero_bits !fir.heap<none>
- %12 = fir.embox %11 : (!fir.heap<none>) -> !fir.class<!fir.heap<none>, corank:1>
- fir.store %12 to %10 : !fir.ref<!fir.class<!fir.heap<none>, corank:1>>
- %13 = fir.declare %10 {fortran_attrs = #fir.var_attrs<allocatable>, uniq_name = "_QFtest_alloc2Eb"} : (!fir.ref<!fir.class<!fir.heap<none>, corank:1>>) -> !fir.ref<!fir.class<!fir.heap<none>, corank:1>>
- %14 = fir.alloca i32 {bindc_name = "ierr", uniq_name = "_QFtest_alloc2Eierr"}
- %15 = fir.declare %14 {uniq_name = "_QFtest_alloc2Eierr"} : (!fir.ref<i32>) -> !fir.ref<i32>
- %16 = fir.absent !fir.box<none>
- %17 = fir.convert %9 : (!fir.ref<!fir.class<!fir.heap<none>, corank:1>>) -> !fir.ref<!fir.box<none>>
- fir.call @_FortranAAllocatableInitIntrinsicForAllocate(%17, %c2_i32, %c4_i32, %c0_i32, %c0_i32) fastmath<contract> : (!fir.ref<!fir.box<none>>, i32, i32, i32, i32) -> ()
- %18 = fir.convert %c1_i32 : (i32) -> i64
- %19 = fir.coordinate_of %4, %c0 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
- fir.store %18 to %19 : !fir.ref<i64>
- %20 = fir.embox %4 : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
- %21 = fir.embox %3 : (!fir.ref<!fir.array<0xi64>>) -> !fir.box<!fir.array<0xi64>>
- mif.alloc_coarray %9 lcobounds %20 ucobounds %21 errmsg %16 {uniq_name = "_QFtest_alloc2Ea"} : (!fir.ref<!fir.class<!fir.heap<none>, corank:1>>, !fir.box<!fir.array<1xi64>>, !fir.box<!fir.array<0xi64>>, !fir.box<none>) -> ()
-// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.ref<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
- %22 = fir.absent !fir.box<none>
- %23 = fir.convert %13 : (!fir.ref<!fir.class<!fir.heap<none>, corank:1>>) -> !fir.ref<!fir.box<none>>
- fir.call @_FortranAAllocatableInitIntrinsicForAllocate(%23, %c2_i32, %c4_i32, %c0_i32, %c0_i32) fastmath<contract> : (!fir.ref<!fir.box<none>>, i32, i32, i32, i32) -> ()
- %24 = fir.convert %c2_i32 : (i32) -> i64
- %25 = fir.coordinate_of %1, %c0 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
- fir.store %24 to %25 : !fir.ref<i64>
- %26 = fir.embox %1 : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
- %27 = fir.embox %0 : (!fir.ref<!fir.array<0xi64>>) -> !fir.box<!fir.array<0xi64>>
-// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.ref<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
- mif.alloc_coarray %13 lcobounds %26 ucobounds %27 stat %2 errmsg %22 {uniq_name = "_QFtest_alloc2Eb"} : (!fir.ref<!fir.class<!fir.heap<none>, corank:1>>, !fir.box<!fir.array<1xi64>>, !fir.box<!fir.array<0xi64>>, !fir.ref<i32>, !fir.box<none>) -> ()
- %28 = fir.convert %2 : (!fir.ref<i32>) -> i32
- fir.store %28 to %15 : !fir.ref<i32>
- %29 = fir.load %13 : !fir.ref<!fir.class<!fir.heap<none>, corank:1>>
- %30 = fir.box_addr %29 : (!fir.class<!fir.heap<none>, corank:1>) -> !fir.heap<none>
- %31 = fir.convert %30 : (!fir.heap<none>) -> i64
- %32 = arith.cmpi ne, %31, %c0_i64 : i64
- fir.if %32 {
- %37 = fir.absent !fir.box<none>
- %38 = fir.absent !fir.ref<i32>
- mif.dealloc_coarray %13 stat %38 errmsg %37 : (!fir.ref<!fir.class<!fir.heap<none>, corank:1>>, !fir.ref<i32>, !fir.box<none>) -> ()
-// CHECK: fir.call @_QMprifPprif_deallocate_coarray({{.*}}) : (!fir.ref<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
- }
- %33 = fir.load %9 : !fir.ref<!fir.class<!fir.heap<none>, corank:1>>
- %34 = fir.box_addr %33 : (!fir.class<!fir.heap<none>, corank:1>) -> !fir.heap<none>
- %35 = fir.convert %34 : (!fir.heap<none>) -> i64
- %36 = arith.cmpi ne, %35, %c0_i64 : i64
- fir.if %36 {
- %37 = fir.absent !fir.box<none>
- %38 = fir.absent !fir.ref<i32>
- mif.dealloc_coarray %9 stat %38 errmsg %37 : (!fir.ref<!fir.class<!fir.heap<none>, corank:1>>, !fir.ref<i32>, !fir.box<none>) -> ()
-// CHECK: fir.call @_QMprifPprif_deallocate_coarray({{.*}}) : (!fir.ref<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ func.func @_QQmain() attributes {fir.bindc_name = "ALLOC_TEST"} {
+ %0 = fir.alloca !fir.array<1xi64>
+ %1 = fir.alloca !fir.array<1xi64>
+ %2 = fir.alloca !fir.array<1xi64>
+ %3 = fir.alloca !fir.array<1xi64>
+ %4 = fir.alloca !fir.array<3xi64>
+ %5 = fir.alloca !fir.array<3xi64>
+ %6 = fir.alloca !fir.array<2xi64>
+ %7 = fir.alloca !fir.array<2xi64>
+ %8 = fir.alloca !fir.array<1xi64>
+ %9 = fir.alloca !fir.array<1xi64>
+ %10 = fir.alloca !fir.array<3xi64>
+ %11 = fir.alloca !fir.array<3xi64>
+ %12 = fir.alloca !fir.array<2xi64>
+ %13 = fir.alloca !fir.array<2xi64>
+ %14 = fir.dummy_scope : !fir.dscope
+ %15 = fir.address_of(@_QFE.n.my_type2) : !fir.ref<!fir.char<1,8>>
+ %c8 = arith.constant 8 : index
+ %16:2 = hlfir.declare %15 typeparams %c8 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.n.my_type2"} : (!fir.ref<!fir.char<1,8>>, index) -> (!fir.ref<!fir.char<1,8>>, !fir.ref<!fir.char<1,8>>)
+ %17 = fir.address_of(@_QFE.n.co) : !fir.ref<!fir.char<1,2>>
+ %c2 = arith.constant 2 : index
+ %18:2 = hlfir.declare %17 typeparams %c2 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.n.co"} : (!fir.ref<!fir.char<1,2>>, index) -> (!fir.ref<!fir.char<1,2>>, !fir.ref<!fir.char<1,2>>)
+ %19 = fir.address_of(@_QFE.n.x) : !fir.ref<!fir.char<1>>
+ %c1 = arith.constant 1 : index
+ %20:2 = hlfir.declare %19 typeparams %c1 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.n.x"} : (!fir.ref<!fir.char<1>>, index) -> (!fir.ref<!fir.char<1>>, !fir.ref<!fir.char<1>>)
+ %21 = fir.address_of(@_QFE.n.y) : !fir.ref<!fir.char<1>>
+ %c1_0 = arith.constant 1 : index
+ %22:2 = hlfir.declare %21 typeparams %c1_0 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.n.y"} : (!fir.ref<!fir.char<1>>, index) -> (!fir.ref<!fir.char<1>>, !fir.ref<!fir.char<1>>)
+ %23 = fir.address_of(@_QFE.n.z) : !fir.ref<!fir.char<1>>
+ %c1_1 = arith.constant 1 : index
+ %24:2 = hlfir.declare %23 typeparams %c1_1 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.n.z"} : (!fir.ref<!fir.char<1>>, index) -> (!fir.ref<!fir.char<1>>, !fir.ref<!fir.char<1>>)
+ %25 = fir.address_of(@_QFE.n.my_type) : !fir.ref<!fir.char<1,7>>
+ %c7 = arith.constant 7 : index
+ %26:2 = hlfir.declare %25 typeparams %c7 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.n.my_type"} : (!fir.ref<!fir.char<1,7>>, index) -> (!fir.ref<!fir.char<1,7>>, !fir.ref<!fir.char<1,7>>)
+ %27 = fir.address_of(@_QFEa) : !fir.ref<i32>
+ %c1_i64 = arith.constant 1 : i64
+ %c0 = arith.constant 0 : index
+ %28 = fir.coordinate_of %13, %c0 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64 to %28 : !fir.ref<i64>
+ %c1_i64_2 = arith.constant 1 : i64
+ %c1_3 = arith.constant 1 : index
+ %29 = fir.coordinate_of %13, %c1_3 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_2 to %29 : !fir.ref<i64>
+ %30 = fir.embox %13 : (!fir.ref<!fir.array<2xi64>>) -> !fir.box<!fir.array<2xi64>>
+ %c1_i64_4 = arith.constant 1 : i64
+ %c0_5 = arith.constant 0 : index
+ %31 = fir.coordinate_of %12, %c0_5 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_4 to %31 : !fir.ref<i64>
+ %c1_i64_6 = arith.constant 1 : i64
+ %c1_7 = arith.constant 1 : index
+ %32 = fir.coordinate_of %12, %c1_7 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_6 to %32 : !fir.ref<i64>
+ %33 = fir.embox %12 : (!fir.ref<!fir.array<2xi64>>) -> !fir.box<!fir.array<2xi64>>
+// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.box<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ mif.alloc_coarray %27 lcobounds %30 ucobounds %33 {uniq_name = "_QFEa"} : (!fir.ref<i32>, !fir.box<!fir.array<2xi64>>, !fir.box<!fir.array<2xi64>>) -> ()
+ %34:2 = hlfir.declare %27 {uniq_name = "_QFEa"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>)
+ %35 = fir.address_of(@_QFEa2) : !fir.ref<!fir.box<!fir.heap<i32>>>
+ %36:2 = hlfir.declare %35 {fortran_attrs = #fir.var_attrs<allocatable>, uniq_name = "_QFEa2"} : (!fir.ref<!fir.box<!fir.heap<i32>>>) -> (!fir.ref<!fir.box<!fir.heap<i32>>>, !fir.ref<!fir.box<!fir.heap<i32>>>)
+ %37 = fir.address_of(@_QFEb) : !fir.ref<f32>
+ %c3_i64 = arith.constant 3 : i64
+ %c0_8 = arith.constant 0 : index
+ %38 = fir.coordinate_of %11, %c0_8 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
+ fir.store %c3_i64 to %38 : !fir.ref<i64>
+ %c1_i64_9 = arith.constant 1 : i64
+ %c1_10 = arith.constant 1 : index
+ %39 = fir.coordinate_of %11, %c1_10 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_9 to %39 : !fir.ref<i64>
+ %c1_i64_11 = arith.constant 1 : i64
+ %c2_12 = arith.constant 2 : index
+ %40 = fir.coordinate_of %11, %c2_12 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_11 to %40 : !fir.ref<i64>
+ %41 = fir.embox %11 : (!fir.ref<!fir.array<3xi64>>) -> !fir.box<!fir.array<3xi64>>
+ %c3_i64_13 = arith.constant 3 : i64
+ %c0_14 = arith.constant 0 : index
+ %42 = fir.coordinate_of %10, %c0_14 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
+ fir.store %c3_i64_13 to %42 : !fir.ref<i64>
+ %c1_i64_15 = arith.constant 1 : i64
+ %c1_16 = arith.constant 1 : index
+ %43 = fir.coordinate_of %10, %c1_16 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_15 to %43 : !fir.ref<i64>
+ %c1_i64_17 = arith.constant 1 : i64
+ %c2_18 = arith.constant 2 : index
+ %44 = fir.coordinate_of %10, %c2_18 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_17 to %44 : !fir.ref<i64>
+ %45 = fir.embox %10 : (!fir.ref<!fir.array<3xi64>>) -> !fir.box<!fir.array<3xi64>>
+// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.box<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ mif.alloc_coarray %37 lcobounds %41 ucobounds %45 {uniq_name = "_QFEb"} : (!fir.ref<f32>, !fir.box<!fir.array<3xi64>>, !fir.box<!fir.array<3xi64>>) -> ()
+ %46:2 = hlfir.declare %37 {uniq_name = "_QFEb"} : (!fir.ref<f32>) -> (!fir.ref<f32>, !fir.ref<f32>)
+ %47 = fir.address_of(@_QFEb2) : !fir.ref<!fir.box<!fir.heap<f32>>>
+ %48:2 = hlfir.declare %47 {fortran_attrs = #fir.var_attrs<allocatable>, uniq_name = "_QFEb2"} : (!fir.ref<!fir.box<!fir.heap<f32>>>) -> (!fir.ref<!fir.box<!fir.heap<f32>>>, !fir.ref<!fir.box<!fir.heap<f32>>>)
+ %49 = fir.address_of(@_QFEc) : !fir.ref<!fir.char<1,10>>
+ %c10 = arith.constant 10 : index
+ %c1_i64_19 = arith.constant 1 : i64
+ %c0_20 = arith.constant 0 : index
+ %50 = fir.coordinate_of %9, %c0_20 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_19 to %50 : !fir.ref<i64>
+ %51 = fir.embox %9 : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
+ %c1_i64_21 = arith.constant 1 : i64
+ %c0_22 = arith.constant 0 : index
+ %52 = fir.coordinate_of %8, %c0_22 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_21 to %52 : !fir.ref<i64>
+ %53 = fir.embox %8 : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
+// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.box<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ mif.alloc_coarray %49 lcobounds %51 ucobounds %53 {uniq_name = "_QFEc"} : (!fir.ref<!fir.char<1,10>>, !fir.box<!fir.array<1xi64>>, !fir.box<!fir.array<1xi64>>) -> ()
+ %54:2 = hlfir.declare %49 typeparams %c10 {uniq_name = "_QFEc"} : (!fir.ref<!fir.char<1,10>>, index) -> (!fir.ref<!fir.char<1,10>>, !fir.ref<!fir.char<1,10>>)
+ %55 = fir.address_of(@_QFEc2) : !fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>>>
+ %56:2 = hlfir.declare %55 {fortran_attrs = #fir.var_attrs<allocatable>, uniq_name = "_QFEc2"} : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>>>) -> (!fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>>>, !fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>>>)
+ %57 = fir.address_of(@_QFEd) : !fir.ref<!fir.type<_QFTmy_type{x:i32,y:!fir.box<!fir.heap<!fir.array<?xi32>>>,z:!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>>}>}>>
+ %58:2 = hlfir.declare %57 {uniq_name = "_QFEd"} : (!fir.ref<!fir.type<_QFTmy_type{x:i32,y:!fir.box<!fir.heap<!fir.array<?xi32>>>,z:!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>>}>}>>) -> (!fir.ref<!fir.type<_QFTmy_type{x:i32,y:!fir.box<!fir.heap<!fir.array<?xi32>>>,z:!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>>}>}>>, !fir.ref<!fir.type<_QFTmy_type{x:i32,y:!fir.box<!fir.heap<!fir.array<?xi32>>>,z:!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>>}>}>>)
+ %59 = fir.address_of(@_QFE.c.my_type2) : !fir.ref<!fir.array<1x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>
+ %c0_23 = arith.constant 0 : index
+ %c1_24 = arith.constant 1 : index
+ %60 = fir.shape_shift %c0_23, %c1_24 : (index, index) -> !fir.shapeshift<1>
+ %61:2 = hlfir.declare %59(%60) {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.c.my_type2"} : (!fir.ref<!fir.array<1x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>, !fir.shapeshift<1>) -> (!fir.box<!fir.array<1x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>, !fir.ref<!fir.array<1x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>)
+ %62 = fir.address_of(@_QFE.dt.my_type) : !fir.ref<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>
+ %63:2 = hlfir.declare %62 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.dt.my_type"} : (!fir.ref<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>) -> (!fir.ref<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>, !fir.ref<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>)
+ %64 = fir.address_of(@_QFE.dt.my_type2) : !fir.ref<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>
+ %65:2 = hlfir.declare %64 {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.dt.my_type2"} : (!fir.ref<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>) -> (!fir.ref<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>, !fir.ref<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>)
+ %66 = fir.address_of(@_QFE.c.my_type) : !fir.ref<!fir.array<3x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>
+ %c0_25 = arith.constant 0 : index
+ %c3 = arith.constant 3 : index
+ %67 = fir.shape_shift %c0_25, %c3 : (index, index) -> !fir.shapeshift<1>
+ %68:2 = hlfir.declare %66(%67) {fortran_attrs = #fir.var_attrs<target>, uniq_name = "_QFE.c.my_type"} : (!fir.ref<!fir.array<3x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>, !fir.shapeshift<1>) -> (!fir.box<!fir.array<3x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>, !fir.ref<!fir.array<3x!fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,memoryspace:i8,__padding0:!fir.array<3xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,specialcaseflag:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,nodefinedassignment:i8,__padding0:!fir.array<3xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>>>)
+ %69 = fir.absent !fir.box<none>
+ %c1_i64_26 = arith.constant 1 : i64
+ %c2_i32 = arith.constant 2 : i32
+ %70 = fir.convert %c2_i32 : (i32) -> i64
+ %c0_27 = arith.constant 0 : index
+ %71 = fir.coordinate_of %7, %c0_27 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_26 to %71 : !fir.ref<i64>
+ %72 = fir.coordinate_of %6, %c0_27 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
+ fir.store %70 to %72 : !fir.ref<i64>
+ %c1_28 = arith.constant 1 : index
+ %73 = fir.coordinate_of %7, %c1_28 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
+ %74 = fir.coordinate_of %6, %c1_28 : (!fir.ref<!fir.array<2xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_26 to %73 : !fir.ref<i64>
+ fir.store %c1_i64_26 to %74 : !fir.ref<i64>
+ %75 = fir.embox %7 : (!fir.ref<!fir.array<2xi64>>) -> !fir.box<!fir.array<2xi64>>
+ %76 = fir.embox %6 : (!fir.ref<!fir.array<2xi64>>) -> !fir.box<!fir.array<2xi64>>
+// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.box<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ mif.alloc_coarray %36#0 lcobounds %75 ucobounds %76 errmsg %69 {uniq_name = "_QFEa2"} : (!fir.ref<!fir.box<!fir.heap<i32>>>, !fir.box<!fir.array<2xi64>>, !fir.box<!fir.array<2xi64>>, !fir.box<none>) -> ()
+ %77 = fir.absent !fir.box<none>
+ %c1_i64_29 = arith.constant 1 : i64
+ %c3_i32 = arith.constant 3 : i32
+ %78 = fir.convert %c3_i32 : (i32) -> i64
+ %c4_i32 = arith.constant 4 : i32
+ %79 = fir.convert %c4_i32 : (i32) -> i64
+ %c0_30 = arith.constant 0 : index
+ %80 = fir.coordinate_of %5, %c0_30 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
+ fir.store %78 to %80 : !fir.ref<i64>
+ %81 = fir.coordinate_of %4, %c0_30 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
+ fir.store %79 to %81 : !fir.ref<i64>
+ %c5_i32 = arith.constant 5 : i32
+ %82 = fir.convert %c5_i32 : (i32) -> i64
+ %c1_31 = arith.constant 1 : index
+ %83 = fir.coordinate_of %5, %c1_31 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_29 to %83 : !fir.ref<i64>
+ %84 = fir.coordinate_of %4, %c1_31 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
+ fir.store %82 to %84 : !fir.ref<i64>
+ %c2_32 = arith.constant 2 : index
+ %85 = fir.coordinate_of %5, %c2_32 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
+ %86 = fir.coordinate_of %4, %c2_32 : (!fir.ref<!fir.array<3xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_29 to %85 : !fir.ref<i64>
+ fir.store %c1_i64_29 to %86 : !fir.ref<i64>
+ %87 = fir.embox %5 : (!fir.ref<!fir.array<3xi64>>) -> !fir.box<!fir.array<3xi64>>
+ %88 = fir.embox %4 : (!fir.ref<!fir.array<3xi64>>) -> !fir.box<!fir.array<3xi64>>
+// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.box<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ mif.alloc_coarray %48#0 lcobounds %87 ucobounds %88 errmsg %77 {uniq_name = "_QFEb2"} : (!fir.ref<!fir.box<!fir.heap<f32>>>, !fir.box<!fir.array<3xi64>>, !fir.box<!fir.array<3xi64>>, !fir.box<none>) -> ()
+ %c100_i32 = arith.constant 100 : i32
+ %89 = fir.absent !fir.box<none>
+ %c1_i32 = arith.constant 1 : i32
+ %c1_i32_33 = arith.constant 1 : i32
+ %c0_i32 = arith.constant 0 : i32
+ %90 = fir.convert %56#0 : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>>>) -> !fir.ref<!fir.box<none>>
+ %91 = fir.convert %c100_i32 : (i32) -> i64
+ fir.call @_FortranAAllocatableInitCharacterForAllocate(%90, %91, %c1_i32, %c1_i32_33, %c0_i32) fastmath<contract> : (!fir.ref<!fir.box<none>>, i64, i32, i32, i32) -> ()
+ %c1_34 = arith.constant 1 : index
+ %c5_i32_35 = arith.constant 5 : i32
+ %c0_i32_36 = arith.constant 0 : i32
+ %92 = fir.convert %56#0 : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>>>) -> !fir.ref<!fir.box<none>>
+ %93 = fir.convert %c1_34 : (index) -> i64
+ %94 = fir.convert %c5_i32_35 : (i32) -> i64
+ fir.call @_FortranAAllocatableSetBounds(%92, %c0_i32_36, %93, %94) fastmath<contract> : (!fir.ref<!fir.box<none>>, i32, i64, i64) -> ()
+ %c1_i64_37 = arith.constant 1 : i64
+ %c0_38 = arith.constant 0 : index
+ %95 = fir.coordinate_of %3, %c0_38 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
+ %96 = fir.coordinate_of %2, %c0_38 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_37 to %95 : !fir.ref<i64>
+ fir.store %c1_i64_37 to %96 : !fir.ref<i64>
+ %97 = fir.embox %3 : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
+ %98 = fir.embox %2 : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
+// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.box<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ mif.alloc_coarray %56#0 lcobounds %97 ucobounds %98 errmsg %89 {uniq_name = "_QFEc2"} : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>>>, !fir.box<!fir.array<1xi64>>, !fir.box<!fir.array<1xi64>>, !fir.box<none>) -> ()
+ %99 = fir.absent !fir.box<none>
+ %100 = hlfir.designate %58#0{"z"} : (!fir.ref<!fir.type<_QFTmy_type{x:i32,y:!fir.box<!fir.heap<!fir.array<?xi32>>>,z:!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>>}>}>>) -> !fir.ref<!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>>}>>
+ %101 = hlfir.designate %100{"co"} {fortran_attrs = #fir.var_attrs<allocatable>} : (!fir.ref<!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>>}>>) -> !fir.ref<!fir.box<!fir.heap<i32>>>
+ %c1_i64_39 = arith.constant 1 : i64
+ %c0_40 = arith.constant 0 : index
+ %102 = fir.coordinate_of %1, %c0_40 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
+ %103 = fir.coordinate_of %0, %c0_40 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
+ fir.store %c1_i64_39 to %102 : !fir.ref<i64>
+ fir.store %c1_i64_39 to %103 : !fir.ref<i64>
+ %104 = fir.embox %1 : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
+ %105 = fir.embox %0 : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
+// CHECK: fir.call @_QMprifPprif_allocate_coarray({{.*}}) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.box<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ mif.alloc_coarray %101 lcobounds %104 ucobounds %105 errmsg %99 {uniq_name = "_QFEd.z.co"} : (!fir.ref<!fir.box<!fir.heap<i32>>>, !fir.box<!fir.array<1xi64>>, !fir.box<!fir.array<1xi64>>, !fir.box<none>) -> ()
+ %106 = fir.absent !fir.box<none>
+ %107 = fir.absent !fir.ref<i32>
+// CHECK: fir.call @_QMprifPprif_deallocate_coarray({{.*}}) : (!fir.box<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ mif.dealloc_coarray %36#0 stat %107 errmsg %106 : (!fir.ref<!fir.box<!fir.heap<i32>>>, !fir.ref<i32>, !fir.box<none>) -> ()
+ %108 = fir.absent !fir.ref<i32>
+// CHECK: fir.call @_QMprifPprif_deallocate_coarray({{.*}}) : (!fir.box<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ mif.dealloc_coarray %48#0 stat %108 errmsg %106 : (!fir.ref<!fir.box<!fir.heap<f32>>>, !fir.ref<i32>, !fir.box<none>) -> ()
+ %109 = fir.absent !fir.ref<i32>
+// CHECK: fir.call @_QMprifPprif_deallocate_coarray({{.*}}) : (!fir.box<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ mif.dealloc_coarray %56#0 stat %109 errmsg %106 : (!fir.ref<!fir.box<!fir.heap<!fir.array<?x!fir.char<1,?>>>>>, !fir.ref<i32>, !fir.box<none>) -> ()
+ %110 = fir.absent !fir.box<none>
+ %111 = hlfir.designate %58#0{"z"} : (!fir.ref<!fir.type<_QFTmy_type{x:i32,y:!fir.box<!fir.heap<!fir.array<?xi32>>>,z:!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>>}>}>>) -> !fir.ref<!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>>}>>
+ %112 = hlfir.designate %111{"co"} {fortran_attrs = #fir.var_attrs<allocatable>} : (!fir.ref<!fir.type<_QFTmy_type2{co:!fir.box<!fir.heap<i32>>}>>) -> !fir.ref<!fir.box<!fir.heap<i32>>>
+ %113 = fir.absent !fir.ref<i32>
+// CHECK: fir.call @_QMprifPprif_deallocate_coarray({{.*}}) : (!fir.box<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ mif.dealloc_coarray %112 stat %113 errmsg %110 : (!fir.ref<!fir.box<!fir.heap<i32>>>, !fir.ref<i32>, !fir.box<none>) -> ()
+// CHECK: fir.call @_QMprifPprif_deallocate_coarray({{.*}}) : (!fir.box<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ mif.dealloc_coarray %54#0 : (!fir.ref<!fir.char<1,10>>) -> ()
+// CHECK: fir.call @_QMprifPprif_deallocate_coarray({{.*}}) : (!fir.box<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ mif.dealloc_coarray %46#0 : (!fir.ref<f32>) -> ()
+// CHECK: fir.call @_QMprifPprif_deallocate_coarray({{.*}}) : (!fir.box<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
+ mif.dealloc_coarray %34#0 : (!fir.ref<i32>) -> ()
+ return
}
- return
-}
-
-// CHECK: fir.global linkonce @_QFEa2_coarray_handle : !fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>
-// CHECK: fir.global linkonce @_QFEb2_coarray_handle : !fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>
-// CHECK: fir.global linkonce @_QFEc2_coarray_handle : !fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>
-// CHECK: fir.global linkonce @_QFtest_alloc2Ea_coarray_handle : !fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>
-// CHECK: fir.global linkonce @_QFtest_alloc2Eb_coarray_handle : !fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>
+// CHECK: fir.global linkonce_odr @_QMprifE.dt.prif_coarray_handle : !fir.type<_QMprifTprif_coarray_handle{info:!fir.box<!fir.ptr<none>>}>
+// CHECK: fir.global linkonce @_QFEa_coarray_handle : !fir.box<!fir.type<_QMprifTprif_coarray_handle{info:!fir.box<!fir.ptr<none>>}>>
+// CHECK: fir.global linkonce @_QFEb_coarray_handle : !fir.box<!fir.type<_QMprifTprif_coarray_handle{info:!fir.box<!fir.ptr<none>>}>>
+// CHECK: fir.global linkonce @_QFEc_coarray_handle : !fir.box<!fir.type<_QMprifTprif_coarray_handle{info:!fir.box<!fir.ptr<none>>}>>
+// CHECK: fir.global linkonce @_QFEa2_coarray_handle : !fir.box<!fir.type<_QMprifTprif_coarray_handle{info:!fir.box<!fir.ptr<none>>}>>
+// CHECK: fir.global linkonce @_QFEb2_coarray_handle : !fir.box<!fir.type<_QMprifTprif_coarray_handle{info:!fir.box<!fir.ptr<none>>}>>
+// CHECK: fir.global linkonce @_QFEc2_coarray_handle : !fir.box<!fir.type<_QMprifTprif_coarray_handle{info:!fir.box<!fir.ptr<none>>}>>
+// CHECK: fir.global linkonce @_QFEd.z.co_coarray_handle : !fir.box<!fir.type<_QMprifTprif_coarray_handle{info:!fir.box<!fir.ptr<none>>}>>
-// CHECK: fir.global linkonce @_QFEa_coarray_handle : !fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>
-// CHECK: fir.global linkonce @_QFEb_coarray_handle : !fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>
-// CHECK: fir.global linkonce @_QFEc_coarray_handle : !fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>
-// CHECK: fir.global linkonce @_QFEd.z.co_coarray_handle : !fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>}>
diff --git a/flang/test/Fir/MIF/coarray_alloc_many_declare.mlir b/flang/test/Fir/MIF/coarray_alloc_many_declare.mlir
deleted file mode 100644
index 05d12b48be8fb..0000000000000
--- a/flang/test/Fir/MIF/coarray_alloc_many_declare.mlir
+++ /dev/null
@@ -1,82 +0,0 @@
-// RUN: fir-opt --mif-convert %s | FileCheck %s
-
-// This test verifies that, during the MIF conversion, when there are multiple `fir.declare`
-// operations for a same coarray_handle, the conversion continues without adding a second block to
-// created fir.global.
-
-func.func @_QQmain() attributes {fir.bindc_name = "P"} {
- %0 = fir.alloca !fir.array<0xi64>
- %1 = fir.alloca !fir.array<1xi64>
- %2 = fir.dummy_scope : !fir.dscope
- %3 = fir.address_of(@_QFEa) : !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>
- %4:2 = hlfir.declare %3 {fortran_attrs = #fir.var_attrs<allocatable, internal_assoc>, uniq_name = "_QFEa"} : (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>) -> (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>, !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>)
- %5 = fir.absent !fir.box<none>
- %c1_i64 = arith.constant 1 : i64
- %c0 = arith.constant 0 : index
- %6 = fir.coordinate_of %1, %c0 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
- fir.store %c1_i64 to %6 : !fir.ref<i64>
- %7 = fir.embox %1 : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
- %8 = fir.embox %0 : (!fir.ref<!fir.array<0xi64>>) -> !fir.box<!fir.array<0xi64>>
- mif.alloc_coarray %4#0 lcobounds %7 ucobounds %8 errmsg %5 {uniq_name = "_QFEa"} : (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>, !fir.box<!fir.array<1xi64>>, !fir.box<!fir.array<0xi64>>, !fir.box<none>) -> ()
- fir.call @_QFPinner() fastmath<contract> : () -> ()
- return
-}
-func.func private @_QFPinner() attributes {fir.host_symbol = @_QQmain, llvm.linkage = #llvm.linkage<internal>} {
- %0 = fir.dummy_scope : !fir.dscope
- %1 = fir.address_of(@_QFEa) : !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>
- %2:2 = hlfir.declare %1 {fortran_attrs = #fir.var_attrs<allocatable>, uniq_name = "_QFEa"} : (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>) -> (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>, !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>)
- %c1_i32 = arith.constant 1 : i32
- hlfir.assign %c1_i32 to %2#0 realloc : i32, !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>
- return
-}
-fir.global internal @_QFEa : !fir.box<!fir.heap<i32>, corank:1> {
- %0 = fir.zero_bits !fir.heap<i32>
- %1 = fir.embox %0 : (!fir.heap<i32>) -> !fir.box<!fir.heap<i32>, corank:1>
- fir.has_value %1 : !fir.box<!fir.heap<i32>, corank:1>
-}
-
-//CHECK-LABEL: @_QQmain
-//CHECK-NEXT: %[[VAL_0:.*]] = fir.alloca i64
-//CHECK-NEXT: %[[VAL_1:.*]] = fir.alloca !fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__c_ptr_c_address:i64}>}>
-//CHECK-NEXT: %[[VAL_2:.*]] = fir.alloca !fir.boxproc<(!fir.ref<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>) -> ()>
-//CHECK-NEXT: %[[VAL_3:.*]] = fir.alloca !fir.array<0xi64>
-//CHECK-NEXT: %[[VAL_4:.*]] = fir.alloca !fir.array<1xi64>
-//CHECK-NEXT: %[[VAL_5:.*]] = fir.dummy_scope : !fir.dscope
-//CHECK-NEXT: %[[VAL_6:.*]] = fir.address_of(@_QFEa) : !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>
-//CHECK-NEXT: %[[VAL_7:.*]]:2 = hlfir.declare %[[VAL_6]] {fortran_attrs = #fir.var_attrs<allocatable, internal_assoc>, uniq_name = "_QFEa"} : (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>) -> (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>, !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>)
-//CHECK-NEXT: %[[VAL_8:.*]] = fir.absent !fir.box<none>
-//CHECK-NEXT: %c1_i64 = arith.constant 1 : i64
-//CHECK-NEXT: %c0 = arith.constant 0 : index
-//CHECK-NEXT: %[[VAL_9:.*]] = fir.coordinate_of %[[VAL_4]], %c0 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
-//CHECK-NEXT: fir.store %c1_i64 to %[[VAL_9]] : !fir.ref<i64>
-//CHECK-NEXT: %[[VAL_10:.*]] = fir.embox %[[VAL_4]] : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
-//CHECK-NEXT: %[[VAL_11:.*]] = fir.embox %[[VAL_3]] : (!fir.ref<!fir.array<0xi64>>) -> !fir.box<!fir.array<0xi64>>
-//CHECK-NEXT: %[[VAL_12:.*]] = fir.zero_bits (!fir.ref<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>) -> ()
-//CHECK-NEXT: %[[VAL_13:.*]] = fir.emboxproc %[[VAL_12]] : ((!fir.ref<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>) -> ()) -> !fir.boxproc<(!fir.ref<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>) -> ()>
-//CHECK-NEXT: fir.store %[[VAL_13]] to %[[VAL_2]] : !fir.ref<!fir.boxproc<(!fir.ref<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>) -> ()>>
-//CHECK-NEXT: %[[VAL_14:.*]] = fir.convert %[[VAL_7]]#0 : (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>) -> !fir.ptr<none>
-//CHECK-NEXT: %[[VAL_15:.*]] = fir.load %[[VAL_7]]#0 : !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>
-//CHECK-NEXT: %[[VAL_16:.*]] = fir.box_elesize %[[VAL_15]] : (!fir.box<!fir.heap<i32>, corank:1>) -> i64
-//CHECK-NEXT: fir.store %[[VAL_16]] to %[[VAL_0]] : !fir.ref<i64>
-//CHECK-NEXT: %[[VAL_17:.*]] = fir.absent !fir.ref<i32>
-//CHECK-NEXT: %[[VAL_18:.*]] = fir.absent !fir.box<!fir.char<1,?>>
-//CHECK-NEXT: %[[VAL_19:.*]] = fir.convert %[[VAL_10]] : (!fir.box<!fir.array<1xi64>>) -> !fir.box<!fir.array<?xi64>>
-//CHECK-NEXT: %[[VAL_20:.*]] = fir.convert %[[VAL_11]] : (!fir.box<!fir.array<0xi64>>) -> !fir.box<!fir.array<?xi64>>
-//CHECK-NEXT: %[[VAL_21:.*]] = fir.convert %[[VAL_2]] : (!fir.ref<!fir.boxproc<(!fir.ref<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>) -> ()>>) -> !fir.ref<none>
-//CHECK-NEXT: %[[VAL_22:.*]] = fir.convert %[[VAL_1]] : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__c_ptr_c_address:i64}>}>>) -> !fir.ref<none>
-//CHECK-NEXT: %[[VAL_23:.*]] = fir.convert %[[VAL_8]] : (!fir.box<none>) -> !fir.box<!fir.char<1,?>>
-//CHECK-NEXT: fir.call @_QMprifPprif_allocate_coarray(%[[VAL_19]], %[[VAL_20]], %[[VAL_0]], %[[VAL_21]], %[[VAL_22]], %[[VAL_14]], %[[VAL_17]], %[[VAL_23]], %[[VAL_18]]) : (!fir.box<!fir.array<?xi64>>, !fir.box<!fir.array<?xi64>>, !fir.ref<i64>, !fir.ref<none>, !fir.ref<none>, !fir.ptr<none>, !fir.ref<i32>, !fir.box<!fir.char<1,?>>, !fir.box<!fir.char<1,?>>) -> ()
-//CHECK-NEXT: %[[VAL_24:.*]] = fir.address_of(@_QFEa_coarray_handle) : !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__c_ptr_c_address:i64}>}>>
-//CHECK-NEXT: fir.copy %[[VAL_1]] to %[[VAL_24]] : !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__c_ptr_c_address:i64}>}>>, !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__c_ptr_c_address:i64}>}>>
-//CHECK-NEXT: fir.call @_QFPinner() fastmath<contract> : () -> ()
-
-//CHECK-LABEL: func.func private @_QFPinner() attributes {fir.host_symbol = @_QQmain, llvm.linkage = #llvm.linkage<internal>}
-//CHECK: %[[VAL_0:.*]] = fir.dummy_scope : !fir.dscope
-//CHECK-NEXT: %[[VAL_1:.*]] = fir.address_of(@_QFEa) : !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>
-//CHECK-NEXT: %[[VAL_2:.*]]:2 = hlfir.declare %[[VAL_1]] {fortran_attrs = #fir.var_attrs<allocatable>, uniq_name = "_QFEa"} : (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>) -> (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>, !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>)
-//CHECK-NEXT: %c1_i32 = arith.constant 1 : i32
-//CHECK-NEXT: hlfir.assign %c1_i32 to %[[VAL_2]]#0 realloc : i32, !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>
-
-//CHECK-LABEL: fir.global linkonce @_QFEa_coarray_handle : !fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__c_ptr_c_address:i64}>}>
-//CHECK: %[[VAL_0:.*]] = fir.zero_bits !fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__c_ptr_c_address:i64}>}>
-//CHECK-NEXT: fir.has_value %[[VAL_0]] : !fir.type<_QM__fortran_builtinsT__builtin_prif_coarray_handle_type{info:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__c_ptr_c_address:i64}>}>
diff --git a/flang/test/Fir/invalid.fir b/flang/test/Fir/invalid.fir
index 26f37a0c1b798..ce31ceb3f069c 100644
--- a/flang/test/Fir/invalid.fir
+++ b/flang/test/Fir/invalid.fir
@@ -1,10 +1,5 @@
// RUN: fir-opt -split-input-file -verify-diagnostics --strict-fir-volatile-verifier %s
-// expected-error at +1{{'fir.alloca' op must not be defined at module scope}}
-%0 = fir.alloca i32 {adapt.valuebyref}
-
-// -----
-
// expected-error at +1{{custom op 'fir.string_lit' must have character type}}
%0 = fir.string_lit "Hello, World!"(13) : !fir.int<32>
diff --git a/flang/test/Lower/MIF/coarray_alloc_many_declare.f90 b/flang/test/Lower/MIF/coarray_alloc_many_declare.f90
deleted file mode 100644
index c85643311ad34..0000000000000
--- a/flang/test/Lower/MIF/coarray_alloc_many_declare.f90
+++ /dev/null
@@ -1,36 +0,0 @@
-! RUN: %flang_fc1 -emit-hlfir -fcoarray %s -o - | FileCheck %s
-
-program p
- integer, allocatable :: a[:]
- allocate(a[*])
- call inner
-contains
- subroutine inner
- a = 1
- end subroutine
-end program p
-
-!CHECK-LABEL: @_QQmain()
-!CHECK: %[[VAL_0:.*]] = fir.alloca !fir.array<0xi64>
-!CHECK-NEXT: %[[VAL_1:.*]] = fir.alloca !fir.array<1xi64>
-!CHECK-NEXT: %[[VAL_2:.*]] = fir.dummy_scope : !fir.dscope
-!CHECK-NEXT: %[[VAL_3:.*]] = fir.address_of(@_QFEa) : !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>
-!CHECK-NEXT: %[[VAL_4:.*]]:2 = hlfir.declare %[[VAL_3]] {fortran_attrs = #fir.var_attrs<allocatable, internal_assoc>, uniq_name = "_QFEa"} : (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>) -> (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>, !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>)
-!CHECK-NEXT: %[[VAL_5:.*]] = fir.absent !fir.box<none>
-!CHECK-NEXT: %c1_i64 = arith.constant 1 : i64
-!CHECK-NEXT: %c0 = arith.constant 0 : index
-!CHECK-NEXT: %[[VAL_6:.*]] = fir.coordinate_of %[[VAL_1]], %c0 : (!fir.ref<!fir.array<1xi64>>, index) -> !fir.ref<i64>
-!CHECK-NEXT: fir.store %c1_i64 to %[[VAL_6]] : !fir.ref<i64>
-!CHECK-NEXT: %[[VAL_7:.*]] = fir.embox %[[VAL_1]] : (!fir.ref<!fir.array<1xi64>>) -> !fir.box<!fir.array<1xi64>>
-!CHECK-NEXT: %[[VAL_8:.*]] = fir.embox %[[VAL_0]] : (!fir.ref<!fir.array<0xi64>>) -> !fir.box<!fir.array<0xi64>>
-!CHECK-NEXT: mif.alloc_coarray %[[VAL_4]]#0 lcobounds %[[VAL_7]] ucobounds %[[VAL_8]] errmsg %[[VAL_5]] {uniq_name = "_QFEa"} : (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>, !fir.box<!fir.array<1xi64>>, !fir.box<!fir.array<0xi64>>, !fir.box<none>) -> ()
-!CHECK-NEXT: fir.call @_QFPinner() fastmath<contract> : () -> ()
-
-!CHECK-LABEL: func.func private @_QFPinner() attributes {fir.host_symbol = @_QQmain, llvm.linkage = #llvm.linkage<internal>}
-!CHECK: %[[VAL_0:.*]] = fir.dummy_scope : !fir.dscope
-!CHECK-NEXT: %[[VAL_1:.*]] = fir.address_of(@_QFEa) : !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>
-!CHECK-NEXT: %[[VAL_2:.*]]:2 = hlfir.declare %[[VAL_1]] {fortran_attrs = #fir.var_attrs<allocatable>, uniq_name = "_QFEa"} : (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>) -> (!fir.ref<!fir.box<!fir.heap<i32>, corank:1>>, !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>)
-!CHECK-NEXT: %c1_i32 = arith.constant 1 : i32
-!CHECK-NEXT: hlfir.assign %c1_i32 to %[[VAL_2:.*]]#0 realloc : i32, !fir.ref<!fir.box<!fir.heap<i32>, corank:1>>
-
-!CHECK: fir.global internal @_QFEa : !fir.box<!fir.heap<i32>, corank:1>
diff --git a/flang/test/Lower/MIF/coarray_dealloc_not_alloc.f90 b/flang/test/Lower/MIF/coarray_dealloc_not_alloc.f90
index 44e31704c0055..d00c46fd89315 100644
--- a/flang/test/Lower/MIF/coarray_dealloc_not_alloc.f90
+++ b/flang/test/Lower/MIF/coarray_dealloc_not_alloc.f90
@@ -1,9 +1,10 @@
! RUN: %flang_fc1 -emit-llvm -fcoarray %s -o - 2>&1 | FileCheck %s --check-prefix=LLVM
-! LLVM: @_QFB1Ekk_coarray_handle = linkonce global %_QM__fortran_builtinsT__builtin_prif_coarray_handle_type zeroinitializer{{.*}}
+! LLVM: @_QFB1Ekk_coarray_handle = linkonce global { ptr, i64, i32, i8, i8, i8, i8, ptr, [1 x i64] } { ptr null, i64 40, i32 20240719, i8 0, i8 42, i8 0, i8 1, ptr @_QMprifEXdtXprif_coarray_handle, [1 x i64] zeroinitializer }, comdat
! LLVM-LABEL: @_QQmain()
-! LLVM: call void @_QMprifPprif_deallocate_coarray(ptr @_QFB1Ekk_coarray_handle, ptr null, ptr null, ptr null)
+! LLVM: call void @llvm.memcpy.p0.p0.i32(ptr align 8 %[[VAL_1:.*]], ptr align 8 @_QFB1Ekk_coarray_handle, i32 40, i1 false)
+! LLVM-NEXT: call void @_QMprifPprif_deallocate_coarray(ptr %[[VAL_1]], ptr null, ptr null, ptr null)
block
@@ -11,3 +12,4 @@
allocatable :: kk(:)[:]
endblock
end
+
diff --git a/flang/test/Semantics/data25.f90 b/flang/test/Semantics/data25.f90
deleted file mode 100644
index 1cdbfd7f9dd81..0000000000000
--- a/flang/test/Semantics/data25.f90
+++ /dev/null
@@ -1,79 +0,0 @@
-! RUN: %python %S/test_errors.py %s %flang_fc1
-! F'2023 19.4 p5: a data-implied-do index without an integer-type-spec
-! takes the type its name has in the scoping unit; the declaration may
-! follow the DATA statement in the same specification part.
-
-! Index declared after the DATA statement: conforming, no error.
-subroutine s1
- implicit none
- logical, dimension(4), save :: util
- data (util(i),i=1,4)/4*.true./
- integer :: i
-end subroutine
-
-! Nested implied-DOs, both indices declared later.
-subroutine s2
- implicit none
- logical, dimension(2,2), save :: m
- data ((m(i,j),i=1,2),j=1,2)/4*.true./
- integer :: i, j
-end subroutine
-
-! Index never declared under IMPLICIT NONE(TYPE): still an error.
-subroutine s3
- implicit none
- logical, dimension(4), save :: util
- !ERROR: No explicit type declared for 'i'
- data (util(i),i=1,4)/4*.true./
-end subroutine
-
-! The index's type, wherever its name is declared, must be integer.
-subroutine s4
- implicit none
- logical, dimension(4), save :: util
- !ERROR: Must have INTEGER type, but is CHARACTER(KIND=1,LEN=1_8)
- data (util(i),i=1,4)/4*.true./
- character :: i
-end subroutine
-
-! Execution-part DATA statement (obsolescent placement): the whole
-! specification part precedes it, so an undeclared index is still an error.
-subroutine s5
- implicit none
- logical, dimension(4), save :: util
- continue
- !ERROR: No explicit type declared for 'i'
- data (util(i),i=1,4)/4*.true./
-end subroutine
-
-! DATA in a BLOCK construct's specification part: the index may be
-! declared later in the same block specification part.
-subroutine s6
- implicit none
- block
- logical, dimension(4), save :: util
- data (util(i),i=1,4)/4*.true./
- integer :: i
- end block
-end subroutine
-
-! The deferral is confined to the DATA statement's object list: a
-! standalone ac-implied-do in a later declaration's initializer does not
-! acquire it.
-subroutine s7
- implicit none
- integer :: i
- logical, dimension(4), save :: util
- data (util(i),i=1,4)/4*.true./
- !ERROR: No explicit type declared for 'j'
- integer :: a(4) = [(j, j=1,4)]
-end subroutine
-
-! DATA in a BLOCK DATA subprogram.
-block data s8
- implicit none
- logical, dimension(4) :: util
- common /cb/ util
- data (util(i),i=1,4)/4*.true./
- integer :: i
-end block data
diff --git a/flang/test/Semantics/data26.f90 b/flang/test/Semantics/data26.f90
deleted file mode 100644
index 7fb40d5da8282..0000000000000
--- a/flang/test/Semantics/data26.f90
+++ /dev/null
@@ -1,34 +0,0 @@
-! RUN: %flang_fc1 -fdebug-dump-symbols %s 2>&1 | FileCheck %s
-! F'2023 19.4 p5: a data-implied-do index variable takes the type of its
-! name in the scoping unit -- including its kind, and even when the
-! declaration follows the DATA statement.
-! CHECK: Subprogram scope: s
-! CHECK: i size=8 offset={{[0-9]+}}: ObjectEntity type: INTEGER(8)
-! CHECK: ImpliedDos scope:
-! CHECK: i size=8 offset=0: ObjectEntity type: INTEGER(8)
-subroutine s
- logical, dimension(4), save :: util
- data (util(i),i=1,4)/4*.true./
- integer(8) :: i
-end subroutine
-
-! A declaration in the innermost scoping unit takes precedence over a
-! host-associated symbol of the same name, even when it follows the DATA
-! statement.
-! CHECK: Subprogram scope: t
-! CHECK: i size=4 offset={{[0-9]+}}: ObjectEntity type: INTEGER(4)
-! CHECK: Subprogram scope: inner
-! CHECK: i size=8 offset={{[0-9]+}}: ObjectEntity type: INTEGER(8)
-! CHECK: ImpliedDos scope:
-! CHECK: i size=8 offset=0: ObjectEntity type: INTEGER(8)
-subroutine t
- integer :: i
- i = 0
-contains
- subroutine inner
- implicit none
- logical, dimension(4), save :: util
- data (util(i),i=1,4)/4*.true./
- integer(8) :: i
- end subroutine
-end subroutine
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 6e3d5a150a930..231e7b444bfda 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -242,7 +242,7 @@ endfunction()
# Rule to add a libc unittest.
# Usage
-# create_libc_unittest(
+# add_libc_unittest(
# <target name>
# SUITE <name of the suite this test belongs to>
# SRCS <list of .cpp files for the test>
@@ -265,11 +265,11 @@ function(create_libc_unittest fq_target_name)
${ARGN}
)
if(NOT LIBC_UNITTEST_SRCS)
- message(FATAL_ERROR "'create_libc_unittest' target requires a SRCS list of .cpp "
+ message(FATAL_ERROR "'add_libc_unittest' target requires a SRCS list of .cpp "
"files.")
endif()
if(NOT LIBC_UNITTEST_DEPENDS)
- message(FATAL_ERROR "'create_libc_unittest' target requires a DEPENDS list of "
+ message(FATAL_ERROR "'add_libc_unittest' target requires a DEPENDS list of "
"'add_entrypoint_object' targets.")
endif()
@@ -406,7 +406,7 @@ function(create_libc_unittest fq_target_name)
endif()
endfunction()
-function(_add_libc_unittest target_name)
+function(add_libc_unittest target_name)
add_target_with_flags(
${target_name}
CREATE_TARGET create_libc_unittest
@@ -1026,7 +1026,7 @@ function(add_libc_test test_name)
${ARGN}
)
if(LIBC_ENABLE_UNITTESTS AND NOT LIBC_TEST_HERMETIC_TEST_ONLY)
- _add_libc_unittest(${test_name}.__unit__ ${LIBC_TEST_UNPARSED_ARGUMENTS})
+ add_libc_unittest(${test_name}.__unit__ ${LIBC_TEST_UNPARSED_ARGUMENTS})
endif()
if(LIBC_ENABLE_HERMETIC_TESTS AND NOT LIBC_TEST_UNIT_TEST_ONLY)
add_libc_hermetic(
diff --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt
index 45baa15bb4532..5686c6e095254 100644
--- a/libc/config/linux/aarch64/entrypoints.txt
+++ b/libc/config/linux/aarch64/entrypoints.txt
@@ -381,7 +381,6 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.unistd.alarm
libc.src.unistd.access
libc.src.unistd.chdir
- libc.src.unistd.chown
libc.src.unistd.close
libc.src.unistd.dup
libc.src.unistd.dup2
@@ -402,7 +401,6 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.unistd.getppid
libc.src.unistd.getsid
libc.src.unistd.gettid
- libc.src.unistd.getgid
libc.src.unistd.getuid
libc.src.unistd.isatty
libc.src.unistd.link
diff --git a/libc/config/linux/arm/entrypoints.txt b/libc/config/linux/arm/entrypoints.txt
index 219364b906857..f80a0acaf7c10 100644
--- a/libc/config/linux/arm/entrypoints.txt
+++ b/libc/config/linux/arm/entrypoints.txt
@@ -216,50 +216,6 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.sys.time.setitimer
libc.src.sys.time.getitimer
- # unistd.h entrypoints
- libc.src.unistd.alarm
- libc.src.unistd.access
- libc.src.unistd.chdir
- libc.src.unistd.chown
- libc.src.unistd.close
- libc.src.unistd.dup
- libc.src.unistd.dup2
- libc.src.unistd.dup3
- libc.src.unistd.execve
- libc.src.unistd.faccessat
- libc.src.unistd.fchdir
- libc.src.unistd.fchown
- libc.src.unistd.fsync
- libc.src.unistd.ftruncate
- libc.src.unistd.getcwd
- libc.src.unistd.getentropy
- libc.src.unistd.geteuid
- libc.src.unistd.gethostname
- libc.src.unistd.getpagesize
- libc.src.unistd.getpid
- libc.src.unistd.getppid
- libc.src.unistd.getsid
- libc.src.unistd.gettid
- libc.src.unistd.getgid
- libc.src.unistd.getuid
- libc.src.unistd.isatty
- libc.src.unistd.link
- libc.src.unistd.linkat
- libc.src.unistd.lseek
- libc.src.unistd.pipe
- libc.src.unistd.pipe2
- libc.src.unistd.readlink
- libc.src.unistd.readlinkat
- libc.src.unistd.rmdir
- libc.src.unistd.setsid
- libc.src.unistd.symlink
- libc.src.unistd.symlinkat
- libc.src.unistd.sysconf
- libc.src.unistd.truncate
- libc.src.unistd.unlink
- libc.src.unistd.unlinkat
- libc.src.unistd.write
-
# wctype.h entrypoints
libc.src.wctype.iswalpha
libc.src.wctype.iswgraph
diff --git a/libc/config/linux/arm/headers.txt b/libc/config/linux/arm/headers.txt
index 193229b266479..42580bfb10b2a 100644
--- a/libc/config/linux/arm/headers.txt
+++ b/libc/config/linux/arm/headers.txt
@@ -22,12 +22,10 @@ set(TARGET_PUBLIC_HEADERS
libc.include.strings
libc.include.pwd
libc.include.uchar
- libc.include.unistd
libc.include.wchar
libc.include.wctype
libc.include.sys_param
libc.include.sys_personality
- libc.include.sys_unistd
# Disabled due to epoll_wait syscalls not being available on this platform.
# libc.include.sys_epoll
)
diff --git a/libc/shared/builtins.h b/libc/shared/builtins.h
index 21c2bed4a0af1..a9df1c84dac2e 100644
--- a/libc/shared/builtins.h
+++ b/libc/shared/builtins.h
@@ -27,30 +27,6 @@
#include "builtins/extendsfdf2.h"
#include "builtins/extendsftf2.h"
#include "builtins/extendxftf2.h"
-#include "builtins/fixdfdi.h"
-#include "builtins/fixdfsi.h"
-#include "builtins/fixdfti.h"
-#include "builtins/fixsfdi.h"
-#include "builtins/fixsfsi.h"
-#include "builtins/fixsfti.h"
-#include "builtins/fixunsdfdi.h"
-#include "builtins/fixunsdfsi.h"
-#include "builtins/fixunsdfti.h"
-#include "builtins/fixunssfdi.h"
-#include "builtins/fixunssfsi.h"
-#include "builtins/fixunssfti.h"
-#include "builtins/floatdidf.h"
-#include "builtins/floatdisf.h"
-#include "builtins/floatsidf.h"
-#include "builtins/floatsisf.h"
-#include "builtins/floattidf.h"
-#include "builtins/floattisf.h"
-#include "builtins/floatundidf.h"
-#include "builtins/floatundisf.h"
-#include "builtins/floatunsidf.h"
-#include "builtins/floatunsisf.h"
-#include "builtins/floatuntidf.h"
-#include "builtins/floatuntisf.h"
#include "builtins/muldf3.h"
#include "builtins/mulsf3.h"
#include "builtins/multf3.h"
diff --git a/libc/shared/builtins/fixdfdi.h b/libc/shared/builtins/fixdfdi.h
deleted file mode 100644
index 2a0eb4da645a1..0000000000000
--- a/libc/shared/builtins/fixdfdi.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixdfdi implementation as shared::fixdfdi
-/// so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXDFDI_H
-#define LLVM_LIBC_SHARED_BUILTINS_FIXDFDI_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/fixdfdi.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::fixdfdi;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FIXDFDI_H
diff --git a/libc/shared/builtins/fixdfsi.h b/libc/shared/builtins/fixdfsi.h
deleted file mode 100644
index ab7dae3688c5c..0000000000000
--- a/libc/shared/builtins/fixdfsi.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixdfsi implementation as shared::fixdfsi
-/// so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXDFSI_H
-#define LLVM_LIBC_SHARED_BUILTINS_FIXDFSI_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/fixdfsi.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::fixdfsi;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FIXDFSI_H
diff --git a/libc/shared/builtins/fixdfti.h b/libc/shared/builtins/fixdfti.h
deleted file mode 100644
index bd83e706fd9a7..0000000000000
--- a/libc/shared/builtins/fixdfti.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixdfti implementation as shared::fixdfti
-/// so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXDFTI_H
-#define LLVM_LIBC_SHARED_BUILTINS_FIXDFTI_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/fixdfti.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::fixdfti;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FIXDFTI_H
diff --git a/libc/shared/builtins/fixsfdi.h b/libc/shared/builtins/fixsfdi.h
deleted file mode 100644
index ff969a6551a44..0000000000000
--- a/libc/shared/builtins/fixsfdi.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixsfdi implementation as shared::fixsfdi
-/// so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXSFDI_H
-#define LLVM_LIBC_SHARED_BUILTINS_FIXSFDI_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/fixsfdi.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::fixsfdi;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FIXSFDI_H
diff --git a/libc/shared/builtins/fixsfsi.h b/libc/shared/builtins/fixsfsi.h
deleted file mode 100644
index debd82aefc8eb..0000000000000
--- a/libc/shared/builtins/fixsfsi.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixsfsi implementation as shared::fixsfsi
-/// so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXSFSI_H
-#define LLVM_LIBC_SHARED_BUILTINS_FIXSFSI_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/fixsfsi.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::fixsfsi;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FIXSFSI_H
diff --git a/libc/shared/builtins/fixsfti.h b/libc/shared/builtins/fixsfti.h
deleted file mode 100644
index 191fb5292b92b..0000000000000
--- a/libc/shared/builtins/fixsfti.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixsfti implementation as shared::fixsfti
-/// so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXSFTI_H
-#define LLVM_LIBC_SHARED_BUILTINS_FIXSFTI_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/fixsfti.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::fixsfti;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FIXSFTI_H
diff --git a/libc/shared/builtins/fixunsdfdi.h b/libc/shared/builtins/fixunsdfdi.h
deleted file mode 100644
index 9c2472e771ac4..0000000000000
--- a/libc/shared/builtins/fixunsdfdi.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixunsdfdi implementation as
-/// shared::fixunsdfdi so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXUNSDFDI_H
-#define LLVM_LIBC_SHARED_BUILTINS_FIXUNSDFDI_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/fixunsdfdi.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::fixunsdfdi;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FIXUNSDFDI_H
diff --git a/libc/shared/builtins/fixunsdfsi.h b/libc/shared/builtins/fixunsdfsi.h
deleted file mode 100644
index c463298e576fd..0000000000000
--- a/libc/shared/builtins/fixunsdfsi.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixunsdfsi implementation as
-/// shared::fixunsdfsi so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXUNSDFSI_H
-#define LLVM_LIBC_SHARED_BUILTINS_FIXUNSDFSI_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/fixunsdfsi.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::fixunsdfsi;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FIXUNSDFSI_H
diff --git a/libc/shared/builtins/fixunsdfti.h b/libc/shared/builtins/fixunsdfti.h
deleted file mode 100644
index 5929f93781446..0000000000000
--- a/libc/shared/builtins/fixunsdfti.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixunsdfti implementation as
-/// shared::fixunsdfti so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXUNSDFTI_H
-#define LLVM_LIBC_SHARED_BUILTINS_FIXUNSDFTI_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/fixunsdfti.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::fixunsdfti;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FIXUNSDFTI_H
diff --git a/libc/shared/builtins/fixunssfdi.h b/libc/shared/builtins/fixunssfdi.h
deleted file mode 100644
index 7a1b16cb6bcf9..0000000000000
--- a/libc/shared/builtins/fixunssfdi.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixunssfdi implementation as
-/// shared::fixunssfdi so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXUNSSFDI_H
-#define LLVM_LIBC_SHARED_BUILTINS_FIXUNSSFDI_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/fixunssfdi.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::fixunssfdi;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FIXUNSSFDI_H
diff --git a/libc/shared/builtins/fixunssfsi.h b/libc/shared/builtins/fixunssfsi.h
deleted file mode 100644
index 8ed7ed6103d51..0000000000000
--- a/libc/shared/builtins/fixunssfsi.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixunssfsi implementation as
-/// shared::fixunssfsi so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXUNSSFSI_H
-#define LLVM_LIBC_SHARED_BUILTINS_FIXUNSSFSI_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/fixunssfsi.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::fixunssfsi;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FIXUNSSFSI_H
diff --git a/libc/shared/builtins/fixunssfti.h b/libc/shared/builtins/fixunssfti.h
deleted file mode 100644
index b47dd08ab04f6..0000000000000
--- a/libc/shared/builtins/fixunssfti.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixunssfti implementation as
-/// shared::fixunssfti so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FIXUNSSFTI_H
-#define LLVM_LIBC_SHARED_BUILTINS_FIXUNSSFTI_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/fixunssfti.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::fixunssfti;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FIXUNSSFTI_H
diff --git a/libc/shared/builtins/floatdidf.h b/libc/shared/builtins/floatdidf.h
deleted file mode 100644
index 6d5d54994cff3..0000000000000
--- a/libc/shared/builtins/floatdidf.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatdidf implementation as
-/// shared::floatdidf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATDIDF_H
-#define LLVM_LIBC_SHARED_BUILTINS_FLOATDIDF_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/floatdidf.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::floatdidf;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATDIDF_H
diff --git a/libc/shared/builtins/floatdisf.h b/libc/shared/builtins/floatdisf.h
deleted file mode 100644
index b0f29485dc985..0000000000000
--- a/libc/shared/builtins/floatdisf.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatdisf implementation as
-/// shared::floatdisf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATDISF_H
-#define LLVM_LIBC_SHARED_BUILTINS_FLOATDISF_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/floatdisf.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::floatdisf;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATDISF_H
diff --git a/libc/shared/builtins/floatsidf.h b/libc/shared/builtins/floatsidf.h
deleted file mode 100644
index f1d4708ac667b..0000000000000
--- a/libc/shared/builtins/floatsidf.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatsidf implementation as
-/// shared::floatsidf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATSIDF_H
-#define LLVM_LIBC_SHARED_BUILTINS_FLOATSIDF_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/floatsidf.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::floatsidf;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATSIDF_H
diff --git a/libc/shared/builtins/floatsisf.h b/libc/shared/builtins/floatsisf.h
deleted file mode 100644
index 0d318b26cd7ab..0000000000000
--- a/libc/shared/builtins/floatsisf.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatsisf implementation as
-/// shared::floatsisf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATSISF_H
-#define LLVM_LIBC_SHARED_BUILTINS_FLOATSISF_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/floatsisf.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::floatsisf;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATSISF_H
diff --git a/libc/shared/builtins/floattidf.h b/libc/shared/builtins/floattidf.h
deleted file mode 100644
index 4aaecb88d479f..0000000000000
--- a/libc/shared/builtins/floattidf.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floattidf implementation as
-/// shared::floattidf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATTIDF_H
-#define LLVM_LIBC_SHARED_BUILTINS_FLOATTIDF_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/floattidf.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::floattidf;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATTIDF_H
diff --git a/libc/shared/builtins/floattisf.h b/libc/shared/builtins/floattisf.h
deleted file mode 100644
index d2667cbb6d1be..0000000000000
--- a/libc/shared/builtins/floattisf.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floattisf implementation as
-/// shared::floattisf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATTISF_H
-#define LLVM_LIBC_SHARED_BUILTINS_FLOATTISF_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/floattisf.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::floattisf;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATTISF_H
diff --git a/libc/shared/builtins/floatundidf.h b/libc/shared/builtins/floatundidf.h
deleted file mode 100644
index 34f78a01f6af7..0000000000000
--- a/libc/shared/builtins/floatundidf.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatundidf implementation as
-/// shared::floatundidf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATUNDIDF_H
-#define LLVM_LIBC_SHARED_BUILTINS_FLOATUNDIDF_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/floatundidf.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::floatundidf;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATUNDIDF_H
diff --git a/libc/shared/builtins/floatundisf.h b/libc/shared/builtins/floatundisf.h
deleted file mode 100644
index 3905e4157f168..0000000000000
--- a/libc/shared/builtins/floatundisf.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatundisf implementation as
-/// shared::floatundisf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATUNDISF_H
-#define LLVM_LIBC_SHARED_BUILTINS_FLOATUNDISF_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/floatundisf.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::floatundisf;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATUNDISF_H
diff --git a/libc/shared/builtins/floatunsidf.h b/libc/shared/builtins/floatunsidf.h
deleted file mode 100644
index a1509fa1a6b7d..0000000000000
--- a/libc/shared/builtins/floatunsidf.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatunsidf implementation as
-/// shared::floatunsidf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATUNSIDF_H
-#define LLVM_LIBC_SHARED_BUILTINS_FLOATUNSIDF_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/floatunsidf.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::floatunsidf;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATUNSIDF_H
diff --git a/libc/shared/builtins/floatunsisf.h b/libc/shared/builtins/floatunsisf.h
deleted file mode 100644
index c2190df469dd1..0000000000000
--- a/libc/shared/builtins/floatunsisf.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatunsisf implementation as
-/// shared::floatunsisf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATUNSISF_H
-#define LLVM_LIBC_SHARED_BUILTINS_FLOATUNSISF_H
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/floatunsisf.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::floatunsisf;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATUNSISF_H
diff --git a/libc/shared/builtins/floatuntidf.h b/libc/shared/builtins/floatuntidf.h
deleted file mode 100644
index 4a3f1ebaa7486..0000000000000
--- a/libc/shared/builtins/floatuntidf.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatuntidf implementation as
-/// shared::floatuntidf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATUNTIDF_H
-#define LLVM_LIBC_SHARED_BUILTINS_FLOATUNTIDF_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/floatuntidf.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::floatuntidf;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATUNTIDF_H
diff --git a/libc/shared/builtins/floatuntisf.h b/libc/shared/builtins/floatuntisf.h
deleted file mode 100644
index 100924f91a9dd..0000000000000
--- a/libc/shared/builtins/floatuntisf.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatuntisf implementation as
-/// shared::floatuntisf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SHARED_BUILTINS_FLOATUNTISF_H
-#define LLVM_LIBC_SHARED_BUILTINS_FLOATUNTISF_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "shared/libc_common.h"
-#include "src/__support/builtins/floatuntisf.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
-
-using builtins::floatuntisf;
-
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SHARED_BUILTINS_FLOATUNTISF_H
diff --git a/libc/src/__support/builtins/CMakeLists.txt b/libc/src/__support/builtins/CMakeLists.txt
index a3e6303f09169..b9ac372e97505 100644
--- a/libc/src/__support/builtins/CMakeLists.txt
+++ b/libc/src/__support/builtins/CMakeLists.txt
@@ -1,15 +1,3 @@
-add_header_library(
- floatint_helper
- HDRS
- floatint_helper.h
- DEPENDS
- libc.src.__support.CPP.type_traits
- libc.src.__support.FPUtil.dyadic_float
- libc.src.__support.macros.attributes
- libc.src.__support.macros.config
- libc.src.__support.sign
-)
-
add_header_library(
fpconvert_helper
HDRS
@@ -135,6 +123,7 @@ add_header_library(
subsf3.h
DEPENDS
libc.src.__support.FPUtil.generic.add_sub
+ libc.src.__support.macros.config
)
add_header_library(
@@ -234,255 +223,3 @@ add_header_library(
libc.src.__support.builtins.fpconvert_helper
libc.src.__support.macros.config
)
-
-add_header_library(
- fixdfdi
- HDRS
- fixdfdi.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.fixint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- fixdfti
- HDRS
- fixdfti.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.fixint_helper
- libc.src.__support.macros.config
- libc.src.__support.macros.properties.types
- libc.src.__support.uint128
-)
-
-add_header_library(
- fixdfsi
- HDRS
- fixdfsi.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.fixint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- fixsfsi
- HDRS
- fixsfsi.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.fixint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- fixsfdi
- HDRS
- fixsfdi.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.fixint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- fixsfti
- HDRS
- fixsfti.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.fixint_helper
- libc.src.__support.macros.config
- libc.src.__support.macros.properties.types
- libc.src.__support.uint128
-)
-
-add_header_library(
- fixunsdfsi
- HDRS
- fixunsdfsi.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.fixint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- fixunsdfdi
- HDRS
- fixunsdfdi.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.fixint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- fixunsdfti
- HDRS
- fixunsdfti.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.fixint_helper
- libc.src.__support.macros.config
- libc.src.__support.macros.properties.types
- libc.src.__support.uint128
-)
-
-add_header_library(
- fixunssfsi
- HDRS
- fixunssfsi.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.fixint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- fixunssfdi
- HDRS
- fixunssfdi.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.fixint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- fixunssfti
- HDRS
- fixunssfti.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.fixint_helper
- libc.src.__support.macros.config
- libc.src.__support.macros.properties.types
- libc.src.__support.uint128
-)
-
-add_header_library(
- floatsidf
- HDRS
- floatsidf.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.floatint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- floatdidf
- HDRS
- floatdidf.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.floatint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- floattidf
- HDRS
- floattidf.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.floatint_helper
- libc.src.__support.macros.config
- libc.src.__support.macros.properties.types
-)
-
-add_header_library(
- floatsisf
- HDRS
- floatsisf.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.floatint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- floatdisf
- HDRS
- floatdisf.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.floatint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- floattisf
- HDRS
- floattisf.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.floatint_helper
- libc.src.__support.macros.config
- libc.src.__support.macros.properties.types
-)
-
-add_header_library(
- floatunsidf
- HDRS
- floatunsidf.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.floatint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- floatundidf
- HDRS
- floatundidf.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.floatint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- floatuntidf
- HDRS
- floatuntidf.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.floatint_helper
- libc.src.__support.macros.config
- libc.src.__support.macros.properties.types
-)
-
-add_header_library(
- floatunsisf
- HDRS
- floatunsisf.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.floatint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- floatundisf
- HDRS
- floatundisf.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.floatint_helper
- libc.src.__support.macros.config
-)
-
-add_header_library(
- floatuntisf
- HDRS
- floatuntisf.h
- DEPENDS
- libc.hdr.stdint_proxy
- libc.src.__support.builtins.floatint_helper
- libc.src.__support.macros.config
- libc.src.__support.macros.properties.types
-)
diff --git a/libc/src/__support/builtins/fixdfdi.h b/libc/src/__support/builtins/fixdfdi.h
deleted file mode 100644
index 9ca5afa20c522..0000000000000
--- a/libc/src/__support/builtins/fixdfdi.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixdfdi implementation as
-/// builtins::fixdfdi so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXDFDI_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXDFDI_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/fixint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// Truncating double -> int64_t conversion, saturating on overflow.
-// Mirrors compiler-rt's __fixdfdi.
-LIBC_INLINE int64_t fixdfdi(double x) { return fixint<int64_t>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXDFDI_H
diff --git a/libc/src/__support/builtins/fixdfsi.h b/libc/src/__support/builtins/fixdfsi.h
deleted file mode 100644
index ef38849251fee..0000000000000
--- a/libc/src/__support/builtins/fixdfsi.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixdfsi implementation as
-/// builtins::fixdfsi so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXDFSI_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXDFSI_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/fixint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// Truncating double -> int32_t conversion, saturating on overflow.
-// Mirrors compiler-rt's __fixdfsi.
-LIBC_INLINE int32_t fixdfsi(double x) { return fixint<int32_t>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXDFSI_H
diff --git a/libc/src/__support/builtins/fixdfti.h b/libc/src/__support/builtins/fixdfti.h
deleted file mode 100644
index bf2d2961ec115..0000000000000
--- a/libc/src/__support/builtins/fixdfti.h
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixdfti implementation as
-/// builtins::fixdfti so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXDFTI_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXDFTI_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/fixint_helper.h"
-#include "src/__support/macros/config.h"
-#include "src/__support/uint128.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// Truncating double -> Int128 conversion, saturating on overflow.
-// Mirrors compiler-rt's __fixdfti.
-LIBC_INLINE Int128 fixdfti(double x) { return fixint<Int128>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXDFTI_H
diff --git a/libc/src/__support/builtins/fixint_helper.h b/libc/src/__support/builtins/fixint_helper.h
deleted file mode 100644
index ab2125ff24326..0000000000000
--- a/libc/src/__support/builtins/fixint_helper.h
+++ /dev/null
@@ -1,84 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// Shared truncating float-to-integer conversions, saturating on overflow.
-/// These mirror compiler-rt's __fix<f><i> / __fixuns<f><i> builtins via an
-/// FPBits unpack + shift, so they can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXINT_HELPER_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXINT_HELPER_H
-
-#include "src/__support/CPP/limits.h"
-#include "src/__support/CPP/type_traits.h"
-#include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/macros/attributes.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// TODO: use fputil::round_to_signed_integer after adding Float128/64/32/16
-// classes currently, we use these helpers to avoid an infinite loop that
-// happens because fputil::round_to_signed_integer calls the builtins if
-// the target doesn't have FPU.
-
-// Truncating conversion of F to the signed integer I (round toward zero).
-// Out-of-range magnitudes saturate to I's min/max; mirrors compiler-rt __fix*.
-template <typename I, typename F> LIBC_INLINE constexpr I fixint(F a) {
- using FPBits = fputil::FPBits<F>;
- using UI = cpp::make_unsigned_t<I>;
- constexpr I FIXINT_MAX = cpp::numeric_limits<I>::max();
- constexpr I FIXINT_MIN = cpp::numeric_limits<I>::min();
-
- const FPBits bits(a);
- const I sign = bits.is_neg() ? -1 : 1;
- const int exponent = bits.get_exponent();
- const typename FPBits::StorageType significand = bits.get_explicit_mantissa();
-
- if (exponent < 0)
- return 0;
-
- if (static_cast<unsigned>(exponent) >= sizeof(I) * 8)
- return sign == 1 ? FIXINT_MAX : FIXINT_MIN;
-
- if (exponent < FPBits::FRACTION_LEN)
- return sign *
- static_cast<I>(significand >> (FPBits::FRACTION_LEN - exponent));
- return sign * static_cast<I>(static_cast<UI>(significand)
- << (exponent - FPBits::FRACTION_LEN));
-}
-
-// Truncating conversion of F to the unsigned integer U (round toward zero).
-// Negative or out-of-range values yield 0 / U's max; mirrors compiler-rt
-// __fixuns*.
-template <typename U, typename F> LIBC_INLINE constexpr U fixuint(F a) {
- using FPBits = fputil::FPBits<F>;
-
- const FPBits bits(a);
- const int exponent = bits.get_exponent();
- const typename FPBits::StorageType significand = bits.get_explicit_mantissa();
-
- if (bits.is_neg() || exponent < 0)
- return 0;
-
- if (static_cast<unsigned>(exponent) >= sizeof(U) * 8)
- return ~U(0);
-
- if (exponent < FPBits::FRACTION_LEN)
- return static_cast<U>(significand >> (FPBits::FRACTION_LEN - exponent));
- return static_cast<U>(static_cast<U>(significand)
- << (exponent - FPBits::FRACTION_LEN));
-}
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXINT_HELPER_H
diff --git a/libc/src/__support/builtins/fixsfdi.h b/libc/src/__support/builtins/fixsfdi.h
deleted file mode 100644
index 87b10f3d8c113..0000000000000
--- a/libc/src/__support/builtins/fixsfdi.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixsfdi implementation as
-/// builtins::fixsfdi so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXSFDI_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXSFDI_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/fixint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// Truncating float -> int64_t conversion, saturating on overflow.
-// Mirrors compiler-rt's __fixsfdi.
-LIBC_INLINE int64_t fixsfdi(float x) { return fixint<int64_t>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXSFDI_H
diff --git a/libc/src/__support/builtins/fixsfsi.h b/libc/src/__support/builtins/fixsfsi.h
deleted file mode 100644
index 1eded97192e4c..0000000000000
--- a/libc/src/__support/builtins/fixsfsi.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixsfsi implementation as
-/// builtins::fixsfsi so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXSFSI_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXSFSI_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/fixint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// Truncating float -> int32_t conversion, saturating on overflow.
-// Mirrors compiler-rt's __fixsfsi.
-LIBC_INLINE int32_t fixsfsi(float x) { return fixint<int32_t>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXSFSI_H
diff --git a/libc/src/__support/builtins/fixsfti.h b/libc/src/__support/builtins/fixsfti.h
deleted file mode 100644
index 1c39301fbdf91..0000000000000
--- a/libc/src/__support/builtins/fixsfti.h
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixsfti implementation as
-/// builtins::fixsfti so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXSFTI_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXSFTI_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/fixint_helper.h"
-#include "src/__support/macros/config.h"
-#include "src/__support/uint128.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// Truncating float -> Int128 conversion, saturating on overflow.
-// Mirrors compiler-rt's __fixsfti.
-LIBC_INLINE Int128 fixsfti(float x) { return fixint<Int128>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXSFTI_H
diff --git a/libc/src/__support/builtins/fixunsdfdi.h b/libc/src/__support/builtins/fixunsdfdi.h
deleted file mode 100644
index c9531ceac4a63..0000000000000
--- a/libc/src/__support/builtins/fixunsdfdi.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixunsdfdi implementation as
-/// builtins::fixunsdfdi so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSDFDI_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSDFDI_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/fixint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// Truncating double -> uint64_t conversion, saturating on overflow.
-// Mirrors compiler-rt's __fixunsdfdi.
-LIBC_INLINE uint64_t fixunsdfdi(double x) { return fixuint<uint64_t>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSDFDI_H
diff --git a/libc/src/__support/builtins/fixunsdfsi.h b/libc/src/__support/builtins/fixunsdfsi.h
deleted file mode 100644
index 4a6117c40226a..0000000000000
--- a/libc/src/__support/builtins/fixunsdfsi.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixunsdfsi implementation as
-/// builtins::fixunsdfsi so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSDFSI_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSDFSI_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/fixint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// Truncating double -> uint32_t conversion, saturating on overflow.
-// Mirrors compiler-rt's __fixunsdfsi.
-LIBC_INLINE uint32_t fixunsdfsi(double x) { return fixuint<uint32_t>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSDFSI_H
diff --git a/libc/src/__support/builtins/fixunsdfti.h b/libc/src/__support/builtins/fixunsdfti.h
deleted file mode 100644
index 596e9c7bc5149..0000000000000
--- a/libc/src/__support/builtins/fixunsdfti.h
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixunsdfti implementation as
-/// builtins::fixunsdfti so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSDFTI_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSDFTI_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/fixint_helper.h"
-#include "src/__support/macros/config.h"
-#include "src/__support/uint128.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// Truncating double -> UInt128 conversion, saturating on overflow.
-// Mirrors compiler-rt's __fixunsdfti.
-LIBC_INLINE UInt128 fixunsdfti(double x) { return fixuint<UInt128>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSDFTI_H
diff --git a/libc/src/__support/builtins/fixunssfdi.h b/libc/src/__support/builtins/fixunssfdi.h
deleted file mode 100644
index 68befe8331d53..0000000000000
--- a/libc/src/__support/builtins/fixunssfdi.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixunssfdi implementation as
-/// builtins::fixunssfdi so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSSFDI_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSSFDI_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/fixint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// Truncating float -> uint64_t conversion, saturating on overflow.
-// Mirrors compiler-rt's __fixunssfdi.
-LIBC_INLINE uint64_t fixunssfdi(float x) { return fixuint<uint64_t>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSSFDI_H
diff --git a/libc/src/__support/builtins/fixunssfsi.h b/libc/src/__support/builtins/fixunssfsi.h
deleted file mode 100644
index fe0dbe62d49d8..0000000000000
--- a/libc/src/__support/builtins/fixunssfsi.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixunssfsi implementation as
-/// builtins::fixunssfsi so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSSFSI_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSSFSI_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/fixint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// Truncating float -> uint32_t conversion, saturating on overflow.
-// Mirrors compiler-rt's __fixunssfsi.
-LIBC_INLINE uint32_t fixunssfsi(float x) { return fixuint<uint32_t>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSSFSI_H
diff --git a/libc/src/__support/builtins/fixunssfti.h b/libc/src/__support/builtins/fixunssfti.h
deleted file mode 100644
index 567d5de8159ed..0000000000000
--- a/libc/src/__support/builtins/fixunssfti.h
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __fixunssfti implementation as
-/// builtins::fixunssfti so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSSFTI_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSSFTI_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/fixint_helper.h"
-#include "src/__support/macros/config.h"
-#include "src/__support/uint128.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// Truncating float -> UInt128 conversion, saturating on overflow.
-// Mirrors compiler-rt's __fixunssfti.
-LIBC_INLINE UInt128 fixunssfti(float x) { return fixuint<UInt128>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FIXUNSSFTI_H
diff --git a/libc/src/__support/builtins/floatdidf.h b/libc/src/__support/builtins/floatdidf.h
deleted file mode 100644
index c9843d53d5598..0000000000000
--- a/libc/src/__support/builtins/floatdidf.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatdidf implementation as
-/// builtins::floatdidf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATDIDF_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATDIDF_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/floatint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// double <- int64_t conversion, round to nearest.
-// Mirrors compiler-rt's __floatdidf.
-LIBC_INLINE double floatdidf(int64_t x) { return floatint<double>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATDIDF_H
diff --git a/libc/src/__support/builtins/floatdisf.h b/libc/src/__support/builtins/floatdisf.h
deleted file mode 100644
index b53595a782c7f..0000000000000
--- a/libc/src/__support/builtins/floatdisf.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatdisf implementation as
-/// builtins::floatdisf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATDISF_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATDISF_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/floatint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// float <- int64_t conversion, round to nearest.
-// Mirrors compiler-rt's __floatdisf.
-LIBC_INLINE float floatdisf(int64_t x) { return floatint<float>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATDISF_H
diff --git a/libc/src/__support/builtins/floatint_helper.h b/libc/src/__support/builtins/floatint_helper.h
deleted file mode 100644
index 8aaf9f78e8d32..0000000000000
--- a/libc/src/__support/builtins/floatint_helper.h
+++ /dev/null
@@ -1,59 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// Shared integer-to-floating-point conversions, rounded to nearest with ties
-/// to even. These mirror compiler-rt's __float<i><f> / __floatun<i><f>
-/// builtins via an LLVM-libc DyadicFloat, so they can be reused by
-/// compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATINT_HELPER_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATINT_HELPER_H
-
-#include "src/__support/CPP/type_traits.h"
-#include "src/__support/FPUtil/dyadic_float.h"
-#include "src/__support/macros/attributes.h"
-#include "src/__support/macros/config.h"
-#include "src/__support/sign.h"
-
-#include <stddef.h>
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// TODO: use constructors after adding Float128/64/32/16 classes.
-
-// Convert the integer I to the floating-point type F, rounding to nearest
-// (ties to even) per the current rounding mode. Handles signed and unsigned
-// I alike; mirrors compiler-rt's __float<i><f> / __floatun<i><f>.
-template <typename F, typename I> LIBC_INLINE constexpr F floatint(I x) {
- using UI = cpp::make_unsigned_t<I>;
-
- Sign sign = Sign::POS;
- UI mag = static_cast<UI>(x);
- if constexpr (cpp::is_signed_v<I>) {
- if (x < 0) {
- sign = Sign::NEG;
- mag = static_cast<UI>(-mag); // modular negation; correct for I's min too
- }
- }
-
- // A mantissa wide enough for I and for F's fraction, rounded up to a whole
- // number of 64-bit words (UInt's width requirement). With exponent 0 the
- // dyadic value is exactly `mag`, which as<F>() then rounds to F.
- constexpr size_t NEED = (sizeof(I) > sizeof(F) ? sizeof(I) : sizeof(F)) * 8;
- constexpr size_t BITS = ((NEED + 63) / 64) * 64;
- return static_cast<F>(fputil::DyadicFloat<BITS>(sign, 0, mag));
-}
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATINT_HELPER_H
diff --git a/libc/src/__support/builtins/floatsidf.h b/libc/src/__support/builtins/floatsidf.h
deleted file mode 100644
index 28b0c27bb5948..0000000000000
--- a/libc/src/__support/builtins/floatsidf.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatsidf implementation as
-/// builtins::floatsidf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATSIDF_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATSIDF_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/floatint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// double <- int32_t conversion, round to nearest.
-// Mirrors compiler-rt's __floatsidf.
-LIBC_INLINE double floatsidf(int32_t x) { return floatint<double>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATSIDF_H
diff --git a/libc/src/__support/builtins/floatsisf.h b/libc/src/__support/builtins/floatsisf.h
deleted file mode 100644
index 75ab24c7680a5..0000000000000
--- a/libc/src/__support/builtins/floatsisf.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatsisf implementation as
-/// builtins::floatsisf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATSISF_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATSISF_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/floatint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// float <- int32_t conversion, round to nearest.
-// Mirrors compiler-rt's __floatsisf.
-LIBC_INLINE float floatsisf(int32_t x) { return floatint<float>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATSISF_H
diff --git a/libc/src/__support/builtins/floattidf.h b/libc/src/__support/builtins/floattidf.h
deleted file mode 100644
index 2e6d85fa3324a..0000000000000
--- a/libc/src/__support/builtins/floattidf.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floattidf implementation as
-/// builtins::floattidf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATTIDF_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATTIDF_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/floatint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// double <- Int128 conversion, round to nearest.
-// Mirrors compiler-rt's __floattidf.
-LIBC_INLINE double floattidf(Int128 x) { return floatint<double>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATTIDF_H
diff --git a/libc/src/__support/builtins/floattisf.h b/libc/src/__support/builtins/floattisf.h
deleted file mode 100644
index 7bb8d8adc1183..0000000000000
--- a/libc/src/__support/builtins/floattisf.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floattisf implementation as
-/// builtins::floattisf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATTISF_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATTISF_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/floatint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// float <- Int128 conversion, round to nearest.
-// Mirrors compiler-rt's __floattisf.
-LIBC_INLINE float floattisf(Int128 x) { return floatint<float>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATTISF_H
diff --git a/libc/src/__support/builtins/floatundidf.h b/libc/src/__support/builtins/floatundidf.h
deleted file mode 100644
index c368602892b38..0000000000000
--- a/libc/src/__support/builtins/floatundidf.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatundidf implementation as
-/// builtins::floatundidf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNDIDF_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNDIDF_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/floatint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// double <- uint64_t conversion, round to nearest.
-// Mirrors compiler-rt's __floatundidf.
-LIBC_INLINE double floatundidf(uint64_t x) { return floatint<double>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNDIDF_H
diff --git a/libc/src/__support/builtins/floatundisf.h b/libc/src/__support/builtins/floatundisf.h
deleted file mode 100644
index ba450937ff73b..0000000000000
--- a/libc/src/__support/builtins/floatundisf.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatundisf implementation as
-/// builtins::floatundisf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNDISF_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNDISF_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/floatint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// float <- uint64_t conversion, round to nearest.
-// Mirrors compiler-rt's __floatundisf.
-LIBC_INLINE float floatundisf(uint64_t x) { return floatint<float>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNDISF_H
diff --git a/libc/src/__support/builtins/floatunsidf.h b/libc/src/__support/builtins/floatunsidf.h
deleted file mode 100644
index 5fa90c640772e..0000000000000
--- a/libc/src/__support/builtins/floatunsidf.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatunsidf implementation as
-/// builtins::floatunsidf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNSIDF_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNSIDF_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/floatint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// double <- uint32_t conversion, round to nearest.
-// Mirrors compiler-rt's __floatunsidf.
-LIBC_INLINE double floatunsidf(uint32_t x) { return floatint<double>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNSIDF_H
diff --git a/libc/src/__support/builtins/floatunsisf.h b/libc/src/__support/builtins/floatunsisf.h
deleted file mode 100644
index cb8bd27a044e6..0000000000000
--- a/libc/src/__support/builtins/floatunsisf.h
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatunsisf implementation as
-/// builtins::floatunsisf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNSISF_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNSISF_H
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/floatint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// float <- uint32_t conversion, round to nearest.
-// Mirrors compiler-rt's __floatunsisf.
-LIBC_INLINE float floatunsisf(uint32_t x) { return floatint<float>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNSISF_H
diff --git a/libc/src/__support/builtins/floatuntidf.h b/libc/src/__support/builtins/floatuntidf.h
deleted file mode 100644
index 105ba292bff0d..0000000000000
--- a/libc/src/__support/builtins/floatuntidf.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatuntidf implementation as
-/// builtins::floatuntidf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNTIDF_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNTIDF_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/floatint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// double <- UInt128 conversion, round to nearest.
-// Mirrors compiler-rt's __floatuntidf.
-LIBC_INLINE double floatuntidf(UInt128 x) { return floatint<double>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNTIDF_H
diff --git a/libc/src/__support/builtins/floatuntisf.h b/libc/src/__support/builtins/floatuntisf.h
deleted file mode 100644
index c244ee1d53440..0000000000000
--- a/libc/src/__support/builtins/floatuntisf.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-///
-/// \file
-/// This header exposes LLVM-libc's __floatuntisf implementation as
-/// builtins::floatuntisf so that it can be reused by compiler-rt's builtins.
-///
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNTISF_H
-#define LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNTISF_H
-
-#include "src/__support/macros/properties/types.h"
-
-#ifdef LIBC_TYPES_HAS_INT128
-
-#include "hdr/stdint_proxy.h"
-#include "src/__support/builtins/floatint_helper.h"
-#include "src/__support/macros/config.h"
-
-namespace LIBC_NAMESPACE_DECL {
-namespace builtins {
-
-// float <- UInt128 conversion, round to nearest.
-// Mirrors compiler-rt's __floatuntisf.
-LIBC_INLINE float floatuntisf(UInt128 x) { return floatint<float>(x); }
-
-} // namespace builtins
-} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_INT128
-
-#endif // LLVM_LIBC_SRC___SUPPORT_BUILTINS_FLOATUNTISF_H
diff --git a/libc/src/__support/math/atan2f128.h b/libc/src/__support/math/atan2f128.h
index 3c0b2620848ca..f99de5be3472c 100644
--- a/libc/src/__support/math/atan2f128.h
+++ b/libc/src/__support/math/atan2f128.h
@@ -97,7 +97,7 @@ LIBC_INLINE float128 atan2f128(float128 y, float128 x) {
constexpr DFloat128 PI_OVER_4 = {Sign::POS, -128,
0xc90fdaa2'2168c234'c4c6628b'80dc1cd1_u128};
constexpr DFloat128 THREE_PI_OVER_4 = {
- Sign::POS, -126, 0x96cbe3f9'990e91a7'9394c9e8'a0a5159d_u128};
+ Sign::POS, -128, 0x96cbe3f9'990e91a7'9394c9e8'a0a5159d_u128};
// Adjustment for constant term:
// CONST_ADJ[x_sign][y_sign][recip]
diff --git a/libc/src/net/linux/if_nameindex_impl.h b/libc/src/net/linux/if_nameindex_impl.h
index adbc6752f0066..ae451a376ae8b 100644
--- a/libc/src/net/linux/if_nameindex_impl.h
+++ b/libc/src/net/linux/if_nameindex_impl.h
@@ -24,7 +24,6 @@
#include "src/__support/CPP/scope.h"
#include "src/__support/CPP/span.h"
#include "src/__support/alloc-checker.h"
-#include "src/__support/blockstore.h"
#include "src/__support/common.h"
#include "src/__support/error_or.h"
#include "src/string/memory_utils/inline_memcpy.h"
@@ -61,21 +60,38 @@ LIBC_INLINE ErrorOr<ssize_t> send_netlink_dump_request(int sockfd) {
/// A reasonable buffer size for netlink messages (see NLMSG_GOODSIZE in the
/// kernel).
constexpr size_t NLMSG_BUFFER_SIZE = 8192;
+} // namespace detail
+
+template <typename Policy>
+LIBC_INLINE ErrorOr<struct if_nameindex *> if_nameindex() {
+ ErrorOr<int> fd_or_err =
+ Policy::socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE);
+ if (!fd_or_err.has_value())
+ return Error(fd_or_err.error());
+ int fd = *fd_or_err;
+ cpp::scope_exit close_fd([fd]() { Policy::close(fd); });
+
+ ErrorOr<ssize_t> send_res = detail::send_netlink_dump_request<Policy>(fd);
+ if (!send_res.has_value())
+ return Error(send_res.error());
+
+ // TODO: Figure out if we need to dynamically allocate a buffer.
+ alignas(struct nlmsghdr) uint8_t buf[detail::NLMSG_BUFFER_SIZE];
+ ErrorOr<ssize_t> recv_res =
+ Policy::recvfrom(fd, buf, sizeof(buf), 0, nullptr, nullptr);
+ if (!recv_res.has_value())
+ return Error(recv_res.error());
-struct InterfaceEntry {
- unsigned int index;
- uint8_t name_length; // Length of next field.
- char name[IF_NAMESIZE - 1]; // No null terminator.
- static_assert(IF_NAMESIZE - 1 < (1u << 8));
-};
-
-// TODO: Use ErrorOr<void> when that's a thing.
-LIBC_INLINE ErrorOr<int>
-parse_netlink_messages(cpp::span<uint8_t> buf,
- BlockStore<InterfaceEntry, 16> &store) {
- size_t len = buf.size();
- for (auto *nh = reinterpret_cast<struct nlmsghdr *>(buf.data());
- NLMSG_OK(nh, len); nh = NLMSG_NEXT(nh, len)) {
+ close_fd.release();
+ if (ErrorOr<int> close_res = Policy::close(fd); !close_res.has_value())
+ return Error(close_res.error());
+
+ // TODO: Read more than one message.
+ // TODO: Read more than one interface per message.
+ // TODO: Deduplicate interfaces to handle restarts.
+ auto len = static_cast<size_t>(*recv_res);
+ for (auto *nh = reinterpret_cast<struct nlmsghdr *>(buf); NLMSG_OK(nh, len);
+ nh = NLMSG_NEXT(nh, len)) {
if (nh->nlmsg_type == NLMSG_DONE)
break;
if (nh->nlmsg_type == NLMSG_ERROR) {
@@ -102,101 +118,44 @@ parse_netlink_messages(cpp::span<uint8_t> buf,
continue;
size_t rta_payload_len = RTA_PAYLOAD(rta);
+ auto index = static_cast<unsigned int>(ifm->ifi_index);
const char *name_data = reinterpret_cast<const char *>(RTA_DATA(rta));
size_t name_len = internal::strnlen(name_data, rta_payload_len);
- // Defensive check: kernel should not be providing us with names that
- // don't fit.
- if (name_len >= IF_NAMESIZE)
- name_len = IF_NAMESIZE - 1;
- InterfaceEntry entry;
- entry.index = static_cast<unsigned int>(ifm->ifi_index);
- entry.name_length = static_cast<uint8_t>(name_len);
- inline_memcpy(entry.name, name_data, name_len);
-
- if (!store.push_back(entry))
+ size_t total_size = 2 * sizeof(struct if_nameindex) + name_len + 1;
+ AllocChecker ac;
+ uint8_t *buffer = new (ac) uint8_t[total_size];
+ if (!ac)
return Error(ENOBUFS);
- break;
- }
- }
- return 0;
-}
-LIBC_INLINE ErrorOr<struct if_nameindex *>
-build_if_nameindex_list(BlockStore<InterfaceEntry, 16> &store) {
- size_t count = 0;
- size_t strings_size = 0;
- for (const InterfaceEntry &entry : store) {
- ++count;
- strings_size += entry.name_length + 1;
+ cpp::span<uint8_t> buffer_span(buffer, total_size);
+ cpp::span<struct if_nameindex> result(
+ reinterpret_cast<struct if_nameindex *>(buffer_span.data()), 2);
+ cpp::span<char> string_span(reinterpret_cast<char *>(result.end()),
+ reinterpret_cast<char *>(buffer_span.end()));
+
+ result[0].if_index = index;
+ result[0].if_name = string_span.data();
+ inline_memcpy(string_span.data(), name_data, name_len);
+ string_span[name_len] = '\0';
+
+ result[1].if_index = 0;
+ result[1].if_name = nullptr;
+
+ return result.data();
+ }
}
- size_t total_size = (count + 1) * sizeof(struct if_nameindex) + strings_size;
AllocChecker ac;
- uint8_t *buffer = new (ac) uint8_t[total_size];
+ uint8_t *buffer = new (ac) uint8_t[sizeof(struct if_nameindex)];
if (!ac)
return Error(ENOBUFS);
-
cpp::span<struct if_nameindex> result(
- reinterpret_cast<struct if_nameindex *>(buffer), count + 1);
- char *str_ptr = reinterpret_cast<char *>(result.end());
-
- size_t idx = 0;
- for (const InterfaceEntry &entry : store) {
- result[idx].if_index = entry.index;
- result[idx].if_name = str_ptr;
- inline_memcpy(str_ptr, entry.name, entry.name_length);
- str_ptr[entry.name_length] = '\0';
- str_ptr += entry.name_length + 1;
- ++idx;
- }
-
- result[count].if_index = 0;
- result[count].if_name = nullptr;
-
+ reinterpret_cast<struct if_nameindex *>(buffer), 1);
+ result[0] = {};
return result.data();
}
-} // namespace detail
-
-template <typename Policy>
-LIBC_INLINE ErrorOr<struct if_nameindex *> if_nameindex() {
- ErrorOr<int> fd_or_err =
- Policy::socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE);
- if (!fd_or_err.has_value())
- return Error(fd_or_err.error());
- int fd = *fd_or_err;
- cpp::scope_exit close_fd([fd]() { Policy::close(fd); });
-
- ErrorOr<ssize_t> send_res = detail::send_netlink_dump_request<Policy>(fd);
- if (!send_res.has_value())
- return Error(send_res.error());
-
- // TODO: Figure out if we need to dynamically allocate a buffer.
- alignas(struct nlmsghdr) uint8_t buf[detail::NLMSG_BUFFER_SIZE];
- ErrorOr<ssize_t> recv_res =
- Policy::recvfrom(fd, buf, sizeof(buf), 0, nullptr, nullptr);
- if (!recv_res.has_value())
- return Error(recv_res.error());
-
- close_fd.release();
- if (ErrorOr<int> close_res = Policy::close(fd); !close_res.has_value())
- return Error(close_res.error());
-
- // TODO: Read more than one message.
- // TODO: Deduplicate interfaces to handle restarts.
- BlockStore<detail::InterfaceEntry, 16> store;
- cpp::scope_exit destroy_store(
- [&store]() { BlockStore<detail::InterfaceEntry, 16>::destroy(&store); });
-
- if (ErrorOr<int> parse_res = detail::parse_netlink_messages(
- {buf, static_cast<size_t>(*recv_res)}, store);
- !parse_res.has_value())
- return Error(parse_res.error());
-
- return detail::build_if_nameindex_list(store);
-}
-
} // namespace net
} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/test/integration/startup/CMakeLists.txt b/libc/test/integration/startup/CMakeLists.txt
index 2964e22e508b1..3eae028aea73d 100644
--- a/libc/test/integration/startup/CMakeLists.txt
+++ b/libc/test/integration/startup/CMakeLists.txt
@@ -1,5 +1,5 @@
# A rule to add startup system tests. When we have a complete startup system,
-# we should be able to use the add_libc_test rule or an extension of it.
+# we should be able to use the add_libc_unittest rule or an extension of it.
# But, while the system is being developed, we need to use a special rule like
# this.
function(add_startup_test target_name)
diff --git a/libc/test/shared/CMakeLists.txt b/libc/test/shared/CMakeLists.txt
index 49232caf377bc..7e67e71862763 100644
--- a/libc/test/shared/CMakeLists.txt
+++ b/libc/test/shared/CMakeLists.txt
@@ -838,30 +838,6 @@ add_fp_unittest(
libc.src.__support.builtins.extendsfdf2
libc.src.__support.builtins.extendsftf2
libc.src.__support.builtins.extendxftf2
- libc.src.__support.builtins.fixdfdi
- libc.src.__support.builtins.fixdfsi
- libc.src.__support.builtins.fixdfti
- libc.src.__support.builtins.fixsfdi
- libc.src.__support.builtins.fixsfsi
- libc.src.__support.builtins.fixsfti
- libc.src.__support.builtins.fixunsdfdi
- libc.src.__support.builtins.fixunsdfsi
- libc.src.__support.builtins.fixunsdfti
- libc.src.__support.builtins.fixunssfdi
- libc.src.__support.builtins.fixunssfsi
- libc.src.__support.builtins.fixunssfti
- libc.src.__support.builtins.floatdidf
- libc.src.__support.builtins.floatdisf
- libc.src.__support.builtins.floatsidf
- libc.src.__support.builtins.floatsisf
- libc.src.__support.builtins.floattidf
- libc.src.__support.builtins.floattisf
- libc.src.__support.builtins.floatundidf
- libc.src.__support.builtins.floatundisf
- libc.src.__support.builtins.floatunsidf
- libc.src.__support.builtins.floatunsisf
- libc.src.__support.builtins.floatuntidf
- libc.src.__support.builtins.floatuntisf
libc.src.__support.builtins.muldf3
libc.src.__support.builtins.mulsf3
libc.src.__support.builtins.multf3
@@ -874,7 +850,6 @@ add_fp_unittest(
libc.src.__support.builtins.trunctfdf2
libc.src.__support.builtins.trunctfsf2
libc.src.__support.builtins.trunctfxf2
- libc.src.__support.uint128
)
add_fp_unittest(
diff --git a/libc/test/shared/shared_builtins_test.cpp b/libc/test/shared/shared_builtins_test.cpp
index eb1c566d6b179..629a34d0af412 100644
--- a/libc/test/shared/shared_builtins_test.cpp
+++ b/libc/test/shared/shared_builtins_test.cpp
@@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include "shared/builtins.h"
-#include "src/__support/uint128.h"
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
diff --git a/libc/test/src/__support/printf_core/CMakeLists.txt b/libc/test/src/__support/printf_core/CMakeLists.txt
index bcc5a21ca4ee8..b4db465666363 100644
--- a/libc/test/src/__support/printf_core/CMakeLists.txt
+++ b/libc/test/src/__support/printf_core/CMakeLists.txt
@@ -1,6 +1,5 @@
-add_libc_test(
+add_libc_unittest(
parser_test
- UNIT_TEST_ONLY # Fails to link on GPUs
SUITE
libc-support-tests
SRCS
@@ -14,7 +13,7 @@ add_libc_test(
libc.src.__support.arg_list
)
-add_libc_test(
+add_libc_unittest(
writer_test
SUITE
libc-support-tests
@@ -26,7 +25,7 @@ add_libc_test(
libc.src.__support.CPP.string_view
)
-add_libc_test(
+add_libc_unittest(
converter_test
SUITE
libc-support-tests
diff --git a/libc/test/src/arpa/inet/CMakeLists.txt b/libc/test/src/arpa/inet/CMakeLists.txt
index c8e1ca5bf7f35..d6d92eacddabb 100644
--- a/libc/test/src/arpa/inet/CMakeLists.txt
+++ b/libc/test/src/arpa/inet/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_arpa_inet_unittests)
-add_libc_test(
+add_libc_unittest(
htonl
SUITE
libc_arpa_inet_unittests
@@ -11,7 +11,7 @@ add_libc_test(
libc.src.arpa.inet.ntohl
)
-add_libc_test(
+add_libc_unittest(
htons
SUITE
libc_arpa_inet_unittests
@@ -22,7 +22,7 @@ add_libc_test(
libc.src.arpa.inet.ntohs
)
-add_libc_test(
+add_libc_unittest(
inet_addr
SUITE
libc_arpa_inet_unittests
@@ -33,7 +33,7 @@ add_libc_test(
libc.src.arpa.inet.inet_addr
)
-add_libc_test(
+add_libc_unittest(
inet_aton
SUITE
libc_arpa_inet_unittests
@@ -44,7 +44,7 @@ add_libc_test(
libc.src.arpa.inet.inet_aton
)
-add_libc_test(
+add_libc_unittest(
inet_ntoa
SUITE
libc_arpa_inet_unittests
@@ -56,7 +56,7 @@ add_libc_test(
libc.src.__support.endian_internal
)
-add_libc_test(
+add_libc_unittest(
inet_ntop
SUITE
libc_arpa_inet_unittests
@@ -72,7 +72,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
ntohl
SUITE
libc_arpa_inet_unittests
@@ -83,7 +83,7 @@ add_libc_test(
libc.src.arpa.inet.ntohl
)
-add_libc_test(
+add_libc_unittest(
ntohs
SUITE
libc_arpa_inet_unittests
diff --git a/libc/test/src/compiler/CMakeLists.txt b/libc/test/src/compiler/CMakeLists.txt
index eaff2906c216c..05aea80c6f801 100644
--- a/libc/test/src/compiler/CMakeLists.txt
+++ b/libc/test/src/compiler/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_stack_chk_guard_unittests)
-add_libc_test(
+add_libc_unittest(
stack_chk_guard_test
SUITE
libc_stack_chk_guard_unittests
diff --git a/libc/test/src/dirent/CMakeLists.txt b/libc/test/src/dirent/CMakeLists.txt
index 1d7a3caf790dd..aaef181d0752c 100644
--- a/libc/test/src/dirent/CMakeLists.txt
+++ b/libc/test/src/dirent/CMakeLists.txt
@@ -1,7 +1,7 @@
add_subdirectory(testdata)
add_custom_target(libc_dirent_unittests)
-add_libc_test(
+add_libc_unittest(
dirent_test
SUITE
libc_dirent_unittests
@@ -17,7 +17,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
fdopendir_test
SUITE
libc_dirent_unittests
diff --git a/libc/test/src/errno/CMakeLists.txt b/libc/test/src/errno/CMakeLists.txt
index 187e955e7b71c..264574204e6cb 100644
--- a/libc/test/src/errno/CMakeLists.txt
+++ b/libc/test/src/errno/CMakeLists.txt
@@ -4,7 +4,7 @@ endif()
add_custom_target(libc_errno_unittests)
-add_libc_test(
+add_libc_unittest(
errno_test
SUITE
libc_errno_unittests
diff --git a/libc/test/src/fcntl/CMakeLists.txt b/libc/test/src/fcntl/CMakeLists.txt
index dd2b473d954c5..b8202e5279c48 100644
--- a/libc/test/src/fcntl/CMakeLists.txt
+++ b/libc/test/src/fcntl/CMakeLists.txt
@@ -2,7 +2,7 @@ add_custom_target(libc_fcntl_unittests)
add_subdirectory(testdata)
-add_libc_test(
+add_libc_unittest(
creat_test
SUITE
libc_fcntl_unittests
@@ -19,7 +19,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
fcntl_test
SUITE
libc_fcntl_unittests
@@ -40,7 +40,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
openat_test
SUITE
libc_fcntl_unittests
diff --git a/libc/test/src/fenv/CMakeLists.txt b/libc/test/src/fenv/CMakeLists.txt
index 73cbe4c2bc88b..cdf4b694cec43 100644
--- a/libc/test/src/fenv/CMakeLists.txt
+++ b/libc/test/src/fenv/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_fenv_unittests)
-add_libc_test(
+add_libc_unittest(
rounding_mode_test
SUITE
libc_fenv_unittests
@@ -13,7 +13,7 @@ add_libc_test(
LibcFPTestHelpers
)
-add_libc_test(
+add_libc_unittest(
exception_status_test
SUITE
libc_fenv_unittests
@@ -29,7 +29,7 @@ add_libc_test(
LibcFPTestHelpers
)
-add_libc_test(
+add_libc_unittest(
getenv_and_setenv_test
SUITE
libc_fenv_unittests
@@ -46,7 +46,7 @@ add_libc_test(
LibcFPTestHelpers
)
-add_libc_test(
+add_libc_unittest(
exception_flags_test
SUITE
libc_fenv_unittests
@@ -61,7 +61,7 @@ add_libc_test(
LibcFPTestHelpers
)
-add_libc_test(
+add_libc_unittest(
feupdateenv_test
SUITE
libc_fenv_unittests
@@ -75,7 +75,7 @@ add_libc_test(
LibcFPTestHelpers
)
-add_libc_test(
+add_libc_unittest(
feclearexcept_test
SUITE
libc_fenv_unittests
@@ -88,7 +88,7 @@ add_libc_test(
LibcFPTestHelpers
)
-add_libc_test(
+add_libc_unittest(
feenableexcept_test
SUITE
libc_fenv_unittests
diff --git a/libc/test/src/link/CMakeLists.txt b/libc/test/src/link/CMakeLists.txt
index 823c96508626e..efae9cf7e3d9b 100644
--- a/libc/test/src/link/CMakeLists.txt
+++ b/libc/test/src/link/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_link_unittests)
-add_libc_test(
+add_libc_unittest(
dl_iterate_phdr_test
SUITE
libc_link_unittests
diff --git a/libc/test/src/math/smoke/atan2_test.cpp b/libc/test/src/math/smoke/atan2_test.cpp
index 8b2bc78a8da60..a79845fa0303d 100644
--- a/libc/test/src/math/smoke/atan2_test.cpp
+++ b/libc/test/src/math/smoke/atan2_test.cpp
@@ -13,24 +13,6 @@
using LlvmLibcAtan2Test = LIBC_NAMESPACE::testing::FPTest<double>;
TEST_F(LlvmLibcAtan2Test, SpecialNumbers) {
- constexpr double PI = 0x1.921fb54442d18p+1;
- constexpr double PI_OVER_2 = 0x1.921fb54442d18p+0;
- constexpr double PI_OVER_4 = 0x1.921fb54442d18p-1;
- constexpr double THREE_PI_OVER_4 = 0x1.2d97c7f3321d2p+1;
-
- EXPECT_FP_EQ(PI, LIBC_NAMESPACE::atan2(zero, neg_zero));
- EXPECT_FP_EQ(-PI, LIBC_NAMESPACE::atan2(neg_zero, neg_zero));
- EXPECT_FP_EQ(PI, LIBC_NAMESPACE::atan2(zero, neg_inf));
- EXPECT_FP_EQ(-PI, LIBC_NAMESPACE::atan2(neg_zero, neg_inf));
- EXPECT_FP_EQ(PI_OVER_2, LIBC_NAMESPACE::atan2(inf, zero));
- EXPECT_FP_EQ(PI_OVER_2, LIBC_NAMESPACE::atan2(inf, neg_zero));
- EXPECT_FP_EQ(-PI_OVER_2, LIBC_NAMESPACE::atan2(neg_inf, zero));
- EXPECT_FP_EQ(-PI_OVER_2, LIBC_NAMESPACE::atan2(neg_inf, neg_zero));
- EXPECT_FP_EQ(PI_OVER_4, LIBC_NAMESPACE::atan2(inf, inf));
- EXPECT_FP_EQ(-PI_OVER_4, LIBC_NAMESPACE::atan2(neg_inf, inf));
- EXPECT_FP_EQ(THREE_PI_OVER_4, LIBC_NAMESPACE::atan2(inf, neg_inf));
- EXPECT_FP_EQ(-THREE_PI_OVER_4, LIBC_NAMESPACE::atan2(neg_inf, neg_inf));
-
EXPECT_FP_EQ_WITH_EXCEPTION(aNaN, LIBC_NAMESPACE::atan2(sNaN, sNaN),
FE_INVALID);
EXPECT_MATH_ERRNO(0);
diff --git a/libc/test/src/math/smoke/atan2f128_test.cpp b/libc/test/src/math/smoke/atan2f128_test.cpp
index 82feb28173ff6..28b15ae71cac8 100644
--- a/libc/test/src/math/smoke/atan2f128_test.cpp
+++ b/libc/test/src/math/smoke/atan2f128_test.cpp
@@ -13,28 +13,11 @@
using LlvmLibcAtan2f128Test = LIBC_NAMESPACE::testing::FPTest<float128>;
TEST_F(LlvmLibcAtan2f128Test, SpecialNumbers) {
- constexpr float128 PI = 0x1.921fb54442d18469898cc51701b8p+1q;
- constexpr float128 PI_OVER_2 = 0x1.921fb54442d18469898cc51701b8p+0q;
- constexpr float128 PI_OVER_4 = 0x1.921fb54442d18469898cc51701b8p-1q;
- constexpr float128 THREE_PI_OVER_4 = 0x1.2d97c7f3321d234f272993d1414ap+1q;
-
- EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::atan2f128(zero, inf));
- EXPECT_FP_EQ_ALL_ROUNDING(neg_zero, LIBC_NAMESPACE::atan2f128(neg_zero, inf));
- EXPECT_FP_EQ(PI, LIBC_NAMESPACE::atan2f128(zero, neg_zero));
- EXPECT_FP_EQ(-PI, LIBC_NAMESPACE::atan2f128(neg_zero, neg_zero));
- EXPECT_FP_EQ(PI, LIBC_NAMESPACE::atan2f128(zero, neg_inf));
- EXPECT_FP_EQ(-PI, LIBC_NAMESPACE::atan2f128(neg_zero, neg_inf));
- EXPECT_FP_EQ(PI_OVER_2, LIBC_NAMESPACE::atan2f128(inf, zero));
- EXPECT_FP_EQ(PI_OVER_2, LIBC_NAMESPACE::atan2f128(inf, neg_zero));
- EXPECT_FP_EQ(-PI_OVER_2, LIBC_NAMESPACE::atan2f128(neg_inf, zero));
- EXPECT_FP_EQ(-PI_OVER_2, LIBC_NAMESPACE::atan2f128(neg_inf, neg_zero));
- EXPECT_FP_EQ(PI_OVER_4, LIBC_NAMESPACE::atan2f128(inf, inf));
- EXPECT_FP_EQ(-PI_OVER_4, LIBC_NAMESPACE::atan2f128(neg_inf, inf));
- EXPECT_FP_EQ(THREE_PI_OVER_4, LIBC_NAMESPACE::atan2f128(inf, neg_inf));
- EXPECT_FP_EQ(-THREE_PI_OVER_4, LIBC_NAMESPACE::atan2f128(neg_inf, neg_inf));
-
EXPECT_FP_EQ_ALL_ROUNDING(aNaN, LIBC_NAMESPACE::atan2f128(aNaN, zero));
EXPECT_FP_EQ_ALL_ROUNDING(aNaN, LIBC_NAMESPACE::atan2f128(1.0, aNaN));
+ EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::atan2f128(zero, zero));
+ EXPECT_FP_EQ_ALL_ROUNDING(neg_zero,
+ LIBC_NAMESPACE::atan2f128(neg_zero, zero));
EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::atan2f128(1.0, inf));
EXPECT_FP_EQ_ALL_ROUNDING(neg_zero, LIBC_NAMESPACE::atan2f128(-1.0, inf));
diff --git a/libc/test/src/math/smoke/atan2f16_test.cpp b/libc/test/src/math/smoke/atan2f16_test.cpp
index cafc6842e6193..dd2dd90240378 100644
--- a/libc/test/src/math/smoke/atan2f16_test.cpp
+++ b/libc/test/src/math/smoke/atan2f16_test.cpp
@@ -20,29 +20,6 @@ static constexpr float16 neg_one =
.get_val();
TEST_F(LlvmLibcAtan2f16Test, SpecialNumbers) {
- constexpr float16 PI = static_cast<float16>(0x1.92p+1);
- constexpr float16 PI_OVER_2 = static_cast<float16>(0x1.92p+0);
- constexpr float16 PI_OVER_4 = static_cast<float16>(0x1.92p-1);
- constexpr float16 THREE_PI_OVER_4 = static_cast<float16>(0x1.2d8p+1);
-
- EXPECT_FP_EQ(PI, LIBC_NAMESPACE::atan2f16(zero, neg_zero));
- EXPECT_FP_EQ(-PI, LIBC_NAMESPACE::atan2f16(neg_zero, neg_zero));
- EXPECT_FP_EQ(PI, LIBC_NAMESPACE::atan2f16(zero, neg_inf));
- EXPECT_FP_EQ(-PI, LIBC_NAMESPACE::atan2f16(neg_zero, neg_inf));
- EXPECT_FP_EQ(PI_OVER_2, LIBC_NAMESPACE::atan2f16(inf, zero));
- EXPECT_FP_EQ(PI_OVER_2, LIBC_NAMESPACE::atan2f16(inf, neg_zero));
- EXPECT_FP_EQ(-PI_OVER_2, LIBC_NAMESPACE::atan2f16(neg_inf, zero));
- EXPECT_FP_EQ(-PI_OVER_2, LIBC_NAMESPACE::atan2f16(neg_inf, neg_zero));
- EXPECT_FP_EQ(PI_OVER_4, LIBC_NAMESPACE::atan2f16(inf, inf));
- EXPECT_FP_EQ(-PI_OVER_4, LIBC_NAMESPACE::atan2f16(neg_inf, inf));
- EXPECT_FP_EQ(THREE_PI_OVER_4, LIBC_NAMESPACE::atan2f16(inf, neg_inf));
- EXPECT_FP_EQ(-THREE_PI_OVER_4, LIBC_NAMESPACE::atan2f16(neg_inf, neg_inf));
-
- EXPECT_FP_EQ_ALL_ROUNDING(aNaN, LIBC_NAMESPACE::atan2f16(aNaN, zero));
- EXPECT_FP_EQ_ALL_ROUNDING(aNaN, LIBC_NAMESPACE::atan2f16(1.0, aNaN));
- EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::atan2f16(1.0, inf));
- EXPECT_FP_EQ_ALL_ROUNDING(neg_zero, LIBC_NAMESPACE::atan2f16(-1.0, inf));
-
EXPECT_FP_EQ_WITH_EXCEPTION(aNaN, LIBC_NAMESPACE::atan2f16(sNaN, sNaN),
FE_INVALID);
EXPECT_MATH_ERRNO(0);
diff --git a/libc/test/src/math/smoke/atan2f_test.cpp b/libc/test/src/math/smoke/atan2f_test.cpp
index 69802fda68689..83173c6744622 100644
--- a/libc/test/src/math/smoke/atan2f_test.cpp
+++ b/libc/test/src/math/smoke/atan2f_test.cpp
@@ -15,24 +15,6 @@
using LlvmLibcAtan2fTest = LIBC_NAMESPACE::testing::FPTest<float>;
TEST_F(LlvmLibcAtan2fTest, SpecialNumbers) {
- constexpr float PI = 0x1.921fb6p+1f;
- constexpr float PI_OVER_2 = 0x1.921fb6p+0f;
- constexpr float PI_OVER_4 = 0x1.921fb6p-1f;
- constexpr float THREE_PI_OVER_4 = 0x1.2d97c8p+1f;
-
- EXPECT_FP_EQ(PI, LIBC_NAMESPACE::atan2f(zero, neg_zero));
- EXPECT_FP_EQ(-PI, LIBC_NAMESPACE::atan2f(neg_zero, neg_zero));
- EXPECT_FP_EQ(PI, LIBC_NAMESPACE::atan2f(zero, neg_inf));
- EXPECT_FP_EQ(-PI, LIBC_NAMESPACE::atan2f(neg_zero, neg_inf));
- EXPECT_FP_EQ(PI_OVER_2, LIBC_NAMESPACE::atan2f(inf, zero));
- EXPECT_FP_EQ(PI_OVER_2, LIBC_NAMESPACE::atan2f(inf, neg_zero));
- EXPECT_FP_EQ(-PI_OVER_2, LIBC_NAMESPACE::atan2f(neg_inf, zero));
- EXPECT_FP_EQ(-PI_OVER_2, LIBC_NAMESPACE::atan2f(neg_inf, neg_zero));
- EXPECT_FP_EQ(PI_OVER_4, LIBC_NAMESPACE::atan2f(inf, inf));
- EXPECT_FP_EQ(-PI_OVER_4, LIBC_NAMESPACE::atan2f(neg_inf, inf));
- EXPECT_FP_EQ(THREE_PI_OVER_4, LIBC_NAMESPACE::atan2f(inf, neg_inf));
- EXPECT_FP_EQ(-THREE_PI_OVER_4, LIBC_NAMESPACE::atan2f(neg_inf, neg_inf));
-
EXPECT_FP_EQ_WITH_EXCEPTION(aNaN, LIBC_NAMESPACE::atan2f(sNaN, sNaN),
FE_INVALID);
EXPECT_MATH_ERRNO(0);
diff --git a/libc/test/src/net/linux/CMakeLists.txt b/libc/test/src/net/linux/CMakeLists.txt
index 0b737d6f82976..22f4c2429805e 100644
--- a/libc/test/src/net/linux/CMakeLists.txt
+++ b/libc/test/src/net/linux/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_net_unittests)
-add_libc_test(
+add_libc_unittest(
if_indextoname_test
SUITE
libc_net_unittests
@@ -14,7 +14,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
if_nametoindex_test
SUITE
libc_net_unittests
@@ -26,7 +26,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
if_nameindex_test
SUITE
libc_net_unittests
diff --git a/libc/test/src/net/linux/if_nameindex_test.cpp b/libc/test/src/net/linux/if_nameindex_test.cpp
index c68e4781641c4..1285f967ad0b1 100644
--- a/libc/test/src/net/linux/if_nameindex_test.cpp
+++ b/libc/test/src/net/linux/if_nameindex_test.cpp
@@ -314,39 +314,6 @@ TEST_F(LlvmLibcIfNameIndexSocketTest, SingleInterface) {
LIBC_NAMESPACE::if_freenameindex(list);
}
-TEST_F(LlvmLibcIfNameIndexSocketTest, MultipleInterfaces) {
- uint8_t pkt_buf[2048];
- size_t len1 = build_ifinfomsg_packet(pkt_buf, 1, AttrName{"lo"});
- size_t len2 = build_ifinfomsg_packet(pkt_buf + len1, 2, AttrName{"eth0"});
- size_t len3 =
- build_ifinfomsg_packet(pkt_buf + len1 + len2, 3, AttrName{"wlan0"});
- size_t len4 = build_nlmsg_done_packet(pkt_buf + len1 + len2 + len3);
-
- policy_data.recv_results.push_back(
- span<const uint8_t>(pkt_buf, len1 + len2 + len3 + len4));
-
- auto res = LIBC_NAMESPACE::net::if_nameindex<Policy>();
- ASSERT_TRUE(res.has_value());
- struct if_nameindex *list = res.value();
- ASSERT_NE(list, static_cast<struct if_nameindex *>(nullptr));
-
- ASSERT_EQ(list[0].if_index, 1u);
- ASSERT_STREQ(list[0].if_name, "lo");
- ASSERT_EQ(list[1].if_index, 2u);
- ASSERT_STREQ(list[1].if_name, "eth0");
- ASSERT_EQ(list[2].if_index, 3u);
- ASSERT_STREQ(list[2].if_name, "wlan0");
- ASSERT_EQ(list[3].if_index, 0u);
- ASSERT_EQ(list[3].if_name, static_cast<char *>(nullptr));
-
- validate_dump_request();
-
- ASSERT_EQ(policy_data.recv_calls.size(), size_t(1));
- ASSERT_EQ(get<0>(policy_data.recv_calls[0]), FAKE_SOCKET);
-
- LIBC_NAMESPACE::if_freenameindex(list);
-}
-
TEST_F(LlvmLibcIfNameIndexSocketTest, RecvFailure) {
policy_data.recv_results.push_back(Error(ETIMEDOUT));
@@ -544,29 +511,6 @@ TEST_F(LlvmLibcIfNameIndexSocketTest, InterfaceNameWithoutNullTerminator) {
LIBC_NAMESPACE::if_freenameindex(list);
}
-TEST_F(LlvmLibcIfNameIndexSocketTest, InterfaceNameExceedingIfNamesize) {
- uint8_t pkt_buf[1024];
- size_t len1 = build_ifinfomsg_packet(
- pkt_buf, 5,
- AttrName{"this_interface_name_is_way_too_long_for_if_namesize"});
- size_t len2 = build_nlmsg_done_packet(pkt_buf + len1);
-
- policy_data.recv_results.push_back(span<const uint8_t>(pkt_buf, len1 + len2));
-
- auto res = LIBC_NAMESPACE::net::if_nameindex<Policy>();
- ASSERT_TRUE(res.has_value());
- struct if_nameindex *list = res.value();
- ASSERT_NE(list, static_cast<struct if_nameindex *>(nullptr));
-
- ASSERT_EQ(list[0].if_index, 5u);
- ASSERT_STREQ(list[0].if_name, "this_interface_");
- ASSERT_EQ(list[1].if_index, 0u);
- ASSERT_EQ(list[1].if_name, static_cast<char *>(nullptr));
-
- validate_dump_request();
- LIBC_NAMESPACE::if_freenameindex(list);
-}
-
using LlvmLibcIfNameIndexLiveTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
TEST_F(LlvmLibcIfNameIndexLiveTest, LiveOSIntegration) {
diff --git a/libc/test/src/netinet/CMakeLists.txt b/libc/test/src/netinet/CMakeLists.txt
index 68499c648cd62..a9ac0c2d3c6fd 100644
--- a/libc/test/src/netinet/CMakeLists.txt
+++ b/libc/test/src/netinet/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_netinet_unittests)
-add_libc_test(
+add_libc_unittest(
in_test
SUITE
libc_netinet_unittests
@@ -25,7 +25,7 @@ add_libc_test(
libc.src.string.memcmp
)
-add_libc_test(
+add_libc_unittest(
udp_test
SUITE
libc_netinet_unittests
diff --git a/libc/test/src/poll/CMakeLists.txt b/libc/test/src/poll/CMakeLists.txt
index b6f18c5dbf4bf..54e00330f2bff 100644
--- a/libc/test/src/poll/CMakeLists.txt
+++ b/libc/test/src/poll/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_poll_unittests)
-add_libc_test(
+add_libc_unittest(
poll_test
SUITE
libc_poll_unittests
diff --git a/libc/test/src/pthread/CMakeLists.txt b/libc/test/src/pthread/CMakeLists.txt
index a4bbf21953653..2cb80e2b6ae2e 100644
--- a/libc/test/src/pthread/CMakeLists.txt
+++ b/libc/test/src/pthread/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_pthread_unittests)
-add_libc_test(
+add_libc_unittest(
pthread_attr_test
SUITE
libc_pthread_unittests
@@ -21,7 +21,7 @@ add_libc_test(
libc.hdr.errno_macros
)
-add_libc_test(
+add_libc_unittest(
pthread_mutexattr_test
SUITE
libc_pthread_unittests
@@ -40,7 +40,7 @@ add_libc_test(
libc.hdr.errno_macros
)
-add_libc_test(
+add_libc_unittest(
pthread_condattr_test
SUITE
libc_pthread_unittests
@@ -58,7 +58,7 @@ add_libc_test(
libc.src.pthread.pthread_condattr_setpshared
)
-add_libc_test(
+add_libc_unittest(
pthread_rwlockattr_test
SUITE
libc_pthread_unittests
diff --git a/libc/test/src/pwd/CMakeLists.txt b/libc/test/src/pwd/CMakeLists.txt
index 3927162bf4864..06b7d59febe11 100644
--- a/libc/test/src/pwd/CMakeLists.txt
+++ b/libc/test/src/pwd/CMakeLists.txt
@@ -4,7 +4,7 @@ if(NOT TARGET libc.src.pwd.pwd_utils)
return()
endif()
-add_libc_test(
+add_libc_unittest(
pwd_utils_test
SUITE
libc_pwd_unittests
@@ -16,7 +16,7 @@ add_libc_test(
libc.src.pwd.pwd_utils
)
-add_libc_test(
+add_libc_unittest(
getpwent_test
SUITE
libc_pwd_unittests
diff --git a/libc/test/src/regex/CMakeLists.txt b/libc/test/src/regex/CMakeLists.txt
index 165dcb3b066a9..915b8a5d42638 100644
--- a/libc/test/src/regex/CMakeLists.txt
+++ b/libc/test/src/regex/CMakeLists.txt
@@ -1,7 +1,7 @@
if(LLVM_LIBC_FULL_BUILD AND LLVM_LIBC_ENABLE_EXPERIMENTAL_ENTRYPOINTS)
add_custom_target(libc_regex_unittests)
- add_libc_test(
+ add_libc_unittest(
regerror_test
SUITE
libc_regex_unittests
@@ -12,7 +12,7 @@ if(LLVM_LIBC_FULL_BUILD AND LLVM_LIBC_ENABLE_EXPERIMENTAL_ENTRYPOINTS)
libc.src.regex.regerror
)
- add_libc_test(
+ add_libc_unittest(
regex_basic_test
SUITE
libc_regex_unittests
diff --git a/libc/test/src/sched/CMakeLists.txt b/libc/test/src/sched/CMakeLists.txt
index c8bf9fea96383..c7c9ceb01879c 100644
--- a/libc/test/src/sched/CMakeLists.txt
+++ b/libc/test/src/sched/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_sched_unittests)
-add_libc_test(
+add_libc_unittest(
affinity_test
SUITE
libc_sched_unittests
@@ -18,7 +18,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
yield_test
SUITE
libc_sched_unittests
@@ -30,7 +30,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
get_priority_test
SUITE
libc_sched_unittests
@@ -44,7 +44,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
getcpu_test
SUITE
libc_sched_unittests
@@ -56,7 +56,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
sched_getcpu_test
SUITE
libc_sched_unittests
@@ -68,7 +68,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
scheduler_test
SUITE
libc_sched_unittests
@@ -88,7 +88,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
sched_rr_get_interval_test
SUITE
libc_sched_unittests
@@ -106,7 +106,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
cpu_alloc_test
SUITE
libc_sched_unittests
@@ -123,7 +123,7 @@ add_libc_test(
libc.src.sched.__sched_setcpuzero
)
-add_libc_test(
+add_libc_unittest(
cpu_count_test
SUITE
libc_sched_unittests
@@ -146,7 +146,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
sched_andcpuset_test
SUITE
libc_sched_unittests
@@ -161,7 +161,7 @@ add_libc_test(
libc.src.sched.__sched_setcpuzero
)
-add_libc_test(
+add_libc_unittest(
sched_cpuequal_test
SUITE
libc_sched_unittests
@@ -174,7 +174,7 @@ add_libc_test(
libc.src.sched.__sched_setcpuzero
)
-add_libc_test(
+add_libc_unittest(
sched_orcpuset_test
SUITE
libc_sched_unittests
@@ -189,7 +189,7 @@ add_libc_test(
libc.src.sched.__sched_setcpuzero
)
-add_libc_test(
+add_libc_unittest(
sched_xorcpuset_test
SUITE
libc_sched_unittests
diff --git a/libc/test/src/setjmp/CMakeLists.txt b/libc/test/src/setjmp/CMakeLists.txt
index 66c485159ea7a..e95476e00e54b 100644
--- a/libc/test/src/setjmp/CMakeLists.txt
+++ b/libc/test/src/setjmp/CMakeLists.txt
@@ -5,7 +5,7 @@ if(LLVM_USE_SANITIZER)
return()
endif()
-add_libc_test(
+add_libc_unittest(
setjmp_test
SUITE
libc_setjmp_unittests
@@ -18,7 +18,7 @@ add_libc_test(
libc.src.setjmp.setjmp
)
-add_libc_test(
+add_libc_unittest(
sigsetjmp_test
SUITE
libc_setjmp_unittests
diff --git a/libc/test/src/signal/CMakeLists.txt b/libc/test/src/signal/CMakeLists.txt
index ac394ea6b7ab7..ba056090ff8f5 100644
--- a/libc/test/src/signal/CMakeLists.txt
+++ b/libc/test/src/signal/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_signal_unittests)
-add_libc_test(
+add_libc_unittest(
raise_test
SUITE
libc_signal_unittests
@@ -11,7 +11,7 @@ add_libc_test(
libc.src.signal.raise
)
-add_libc_test(
+add_libc_unittest(
kill_test
SUITE
libc_signal_unittests
@@ -25,7 +25,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
sigaction_test
SUITE
libc_signal_unittests
@@ -39,7 +39,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
sigprocmask_test
SUITE
libc_signal_unittests
@@ -55,7 +55,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
pthread_sigmask_test
SUITE
libc_signal_unittests
@@ -70,7 +70,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
sigaddset_test
SUITE
libc_signal_unittests
@@ -83,7 +83,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
signal_test
SUITE
libc_signal_unittests
@@ -97,7 +97,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
sigfillset_test
SUITE
libc_signal_unittests
@@ -112,7 +112,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
sigdelset_test
SUITE
libc_signal_unittests
@@ -128,7 +128,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
sigaltstack_test
SUITE
libc_signal_unittests
diff --git a/libc/test/src/spawn/CMakeLists.txt b/libc/test/src/spawn/CMakeLists.txt
index 1b28df216075e..103925cf3a22d 100644
--- a/libc/test/src/spawn/CMakeLists.txt
+++ b/libc/test/src/spawn/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_spawn_unittests)
-add_libc_test(
+add_libc_unittest(
posix_spawn_file_actions_test
SUITE
libc_spawn_unittests
diff --git a/libc/test/src/stdio/scanf_core/CMakeLists.txt b/libc/test/src/stdio/scanf_core/CMakeLists.txt
index d2931c9cc4821..abf982e4ea00e 100644
--- a/libc/test/src/stdio/scanf_core/CMakeLists.txt
+++ b/libc/test/src/stdio/scanf_core/CMakeLists.txt
@@ -3,7 +3,7 @@ if(NOT(LLVM_LIBC_FULL_BUILD))
libc_set_definition(use_system_file "LIBC_COPT_STDIO_USE_SYSTEM_FILE")
endif()
-add_libc_test(
+add_libc_unittest(
parser_test
SUITE
libc_stdio_unittests
@@ -25,7 +25,7 @@ if(NOT(TARGET libc.src.__support.File.file) AND LLVM_LIBC_FULL_BUILD AND
return()
endif()
-add_libc_test(
+add_libc_unittest(
reader_test
SUITE
libc_stdio_unittests
@@ -38,7 +38,7 @@ add_libc_test(
${use_system_file}
)
-add_libc_test(
+add_libc_unittest(
converter_test
SUITE
libc_stdio_unittests
diff --git a/libc/test/src/sys/epoll/linux/CMakeLists.txt b/libc/test/src/sys/epoll/linux/CMakeLists.txt
index 06a6ce23bfa57..eba480c4b6f81 100644
--- a/libc/test/src/sys/epoll/linux/CMakeLists.txt
+++ b/libc/test/src/sys/epoll/linux/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_sys_epoll_unittests)
-add_libc_test(
+add_libc_unittest(
epoll_create_test
SUITE
libc_sys_epoll_unittests
@@ -15,7 +15,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
epoll_create1_test
SUITE
libc_sys_epoll_unittests
@@ -30,7 +30,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
epoll_ctl_test
SUITE
libc_sys_epoll_unittests
@@ -48,7 +48,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
epoll_wait_test
SUITE
libc_sys_epoll_unittests
@@ -67,7 +67,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
epoll_pwait_test
SUITE
libc_sys_epoll_unittests
@@ -86,7 +86,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
epoll_pwait2_test
SUITE
libc_sys_epoll_unittests
diff --git a/libc/test/src/sys/ioctl/linux/CMakeLists.txt b/libc/test/src/sys/ioctl/linux/CMakeLists.txt
index fd1aeaefe99e3..a9058e41f0633 100644
--- a/libc/test/src/sys/ioctl/linux/CMakeLists.txt
+++ b/libc/test/src/sys/ioctl/linux/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_sys_ioctl_unittests)
-add_libc_test(
+add_libc_unittest(
ioctl_test
SUITE
libc_sys_ioctl_unittests
diff --git a/libc/test/src/sys/ipc/linux/CMakeLists.txt b/libc/test/src/sys/ipc/linux/CMakeLists.txt
index c635cbefd041d..21d501a3029ef 100644
--- a/libc/test/src/sys/ipc/linux/CMakeLists.txt
+++ b/libc/test/src/sys/ipc/linux/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_sys_ipc_unittests)
-add_libc_test(
+add_libc_unittest(
ftok_test
SUITE
libc_sys_ipc_unittests
diff --git a/libc/test/src/sys/personality/linux/CMakeLists.txt b/libc/test/src/sys/personality/linux/CMakeLists.txt
index 46382360a5058..18ab52d33dc65 100644
--- a/libc/test/src/sys/personality/linux/CMakeLists.txt
+++ b/libc/test/src/sys/personality/linux/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_sys_personality_unittests)
-add_libc_test(
+add_libc_unittest(
personality_test
SUITE
libc_sys_personality_unittests
diff --git a/libc/test/src/sys/prctl/linux/CMakeLists.txt b/libc/test/src/sys/prctl/linux/CMakeLists.txt
index 4b30d9f5cb20e..9bc5ae2f4b9ed 100644
--- a/libc/test/src/sys/prctl/linux/CMakeLists.txt
+++ b/libc/test/src/sys/prctl/linux/CMakeLists.txt
@@ -5,7 +5,7 @@ add_custom_target(libc_sys_prctl_unittests)
if(NOT (LIBC_TARGET_ARCHITECTURE_IS_ARM OR
LIBC_TARGET_ARCHITECTURE_IS_RISCV32 OR
LIBC_TARGET_ARCHITECTURE_IS_RISCV64))
- add_libc_test(
+ add_libc_unittest(
prctl_test
SUITE
libc_sys_prctl_unittests
diff --git a/libc/test/src/sys/random/linux/CMakeLists.txt b/libc/test/src/sys/random/linux/CMakeLists.txt
index f9983d9d4037d..e913cd2cfcae8 100644
--- a/libc/test/src/sys/random/linux/CMakeLists.txt
+++ b/libc/test/src/sys/random/linux/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_sys_random_unittests)
-add_libc_test(
+add_libc_unittest(
getrandom_test
SUITE
libc_sys_random_unittests
diff --git a/libc/test/src/sys/resource/CMakeLists.txt b/libc/test/src/sys/resource/CMakeLists.txt
index 876d93703e794..accb50270d3c3 100644
--- a/libc/test/src/sys/resource/CMakeLists.txt
+++ b/libc/test/src/sys/resource/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_sys_resource_unittests)
-add_libc_test(
+add_libc_unittest(
getrlimit_setrlimit_test
SUITE
libc_sys_resource_unittests
diff --git a/libc/test/src/sys/select/CMakeLists.txt b/libc/test/src/sys/select/CMakeLists.txt
index 316201cb30835..9eb55681ff851 100644
--- a/libc/test/src/sys/select/CMakeLists.txt
+++ b/libc/test/src/sys/select/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_sys_select_unittests)
-add_libc_test(
+add_libc_unittest(
select_ui_test
NO_RUN_POSTBUILD
SUITE
@@ -16,7 +16,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
select_failure_test
SUITE
libc_sys_select_unittests
diff --git a/libc/test/src/sys/sem/linux/CMakeLists.txt b/libc/test/src/sys/sem/linux/CMakeLists.txt
index 4a72a9c564ae5..7713c3c927b92 100644
--- a/libc/test/src/sys/sem/linux/CMakeLists.txt
+++ b/libc/test/src/sys/sem/linux/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_sys_sem_unittests)
-add_libc_test(
+add_libc_unittest(
sem_test
SUITE
libc_sys_sem_unittests
diff --git a/libc/test/src/sys/sendfile/CMakeLists.txt b/libc/test/src/sys/sendfile/CMakeLists.txt
index 4fbf436596021..dfcac18b7808b 100644
--- a/libc/test/src/sys/sendfile/CMakeLists.txt
+++ b/libc/test/src/sys/sendfile/CMakeLists.txt
@@ -2,7 +2,7 @@ add_custom_target(libc_sys_sendfile_unittests)
add_subdirectory(testdata)
-add_libc_test(
+add_libc_unittest(
sendfile_test
SUITE
libc_sys_sendfile_unittests
diff --git a/libc/test/src/sys/sendfile/sendfile_test.cpp b/libc/test/src/sys/sendfile/sendfile_test.cpp
index 46a2a32eb9e9b..7eea3eeca23ef 100644
--- a/libc/test/src/sys/sendfile/sendfile_test.cpp
+++ b/libc/test/src/sys/sendfile/sendfile_test.cpp
@@ -29,9 +29,8 @@ TEST_F(LlvmLibcSendfileTest, CreateAndTransfer) {
// 2. Use sendfile to copy it to another file.
// 3. Make sure that the data was actually copied.
// 4. Clean up the temporary files.
- constexpr const char *IN_FILE = APPEND_LIBC_TEST("testdata/sendfile_in.test");
- constexpr const char *OUT_FILE =
- APPEND_LIBC_TEST("testdata/sendfile_out.test");
+ constexpr const char *IN_FILE = "testdata/sendfile_in.test";
+ constexpr const char *OUT_FILE = "testdata/sendfile_out.test";
const char IN_DATA[] = "sendfile test";
constexpr ssize_t IN_SIZE = ssize_t(sizeof(IN_DATA));
diff --git a/libc/test/src/sys/socket/linux/CMakeLists.txt b/libc/test/src/sys/socket/linux/CMakeLists.txt
index dce03b8c2d46e..54b4abda21e12 100644
--- a/libc/test/src/sys/socket/linux/CMakeLists.txt
+++ b/libc/test/src/sys/socket/linux/CMakeLists.txt
@@ -20,7 +20,7 @@ add_header_library(
add_custom_target(libc_sys_socket_unittests)
-add_libc_test(
+add_libc_unittest(
socket_test
SUITE
libc_sys_socket_unittests
@@ -35,7 +35,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
bind_test
SUITE
libc_sys_socket_unittests
@@ -62,7 +62,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
connect_accept_test
SUITE
libc_sys_socket_unittests
@@ -92,7 +92,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
listen_test
SUITE
libc_sys_socket_unittests
@@ -114,7 +114,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
socketopt_test
SUITE
libc_sys_socket_unittests
@@ -142,7 +142,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
socketpair_test
SUITE
libc_sys_socket_unittests
@@ -157,7 +157,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
sockatmark_test
SUITE
libc_sys_socket_unittests
@@ -176,7 +176,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
sockname_test
SUITE
libc_sys_socket_unittests
@@ -203,7 +203,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
send_recv_test
SUITE
libc_sys_socket_unittests
@@ -221,7 +221,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
sendto_recvfrom_test
SUITE
libc_sys_socket_unittests
@@ -239,7 +239,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
sendrecvmmsg_test
SUITE
libc_sys_socket_unittests
@@ -261,7 +261,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
sendmsg_recvmsg_test
SUITE
libc_sys_socket_unittests
@@ -285,7 +285,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
shutdown_test
SUITE
libc_sys_socket_unittests
@@ -305,7 +305,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
sockaddr_storage_test
SUITE
libc_sys_socket_unittests
diff --git a/libc/test/src/sys/stat/CMakeLists.txt b/libc/test/src/sys/stat/CMakeLists.txt
index 8b6aba7c99a86..86881bd21ac51 100644
--- a/libc/test/src/sys/stat/CMakeLists.txt
+++ b/libc/test/src/sys/stat/CMakeLists.txt
@@ -2,7 +2,7 @@ add_custom_target(libc_sys_stat_unittests)
add_subdirectory(testdata)
-add_libc_test(
+add_libc_unittest(
chmod_test
SUITE
libc_sys_stat_unittests
@@ -21,7 +21,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
fchmodat_test
SUITE
libc_sys_stat_unittests
@@ -40,7 +40,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
fchmod_test
SUITE
libc_sys_stat_unittests
@@ -59,7 +59,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
mkdirat_test
SUITE
libc_sys_stat_unittests
@@ -75,7 +75,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
stat_test
SUITE
libc_sys_stat_unittests
@@ -94,7 +94,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
lstat_test
SUITE
libc_sys_stat_unittests
@@ -113,7 +113,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
fstat_test
SUITE
libc_sys_stat_unittests
@@ -132,7 +132,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
utimensat_test
SUITE
libc_sys_stat_unittests
diff --git a/libc/test/src/sys/statfs/linux/CMakeLists.txt b/libc/test/src/sys/statfs/linux/CMakeLists.txt
index 1b80b1f6db7b8..6ba3f35148bdb 100644
--- a/libc/test/src/sys/statfs/linux/CMakeLists.txt
+++ b/libc/test/src/sys/statfs/linux/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_sys_statfs_unittests)
-add_libc_test(
+add_libc_unittest(
statfs_test
SUITE
libc_sys_statfs_unittests
@@ -16,7 +16,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
fstatfs_test
SUITE
libc_sys_statfs_unittests
diff --git a/libc/test/src/sys/statvfs/linux/CMakeLists.txt b/libc/test/src/sys/statvfs/linux/CMakeLists.txt
index fde91a6986a41..545baceae58c0 100644
--- a/libc/test/src/sys/statvfs/linux/CMakeLists.txt
+++ b/libc/test/src/sys/statvfs/linux/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_sys_statvfs_unittests)
-add_libc_test(
+add_libc_unittest(
statvfs_test
SUITE
libc_sys_statvfs_unittests
@@ -16,7 +16,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
fstatvfs_test
SUITE
libc_sys_statvfs_unittests
diff --git a/libc/test/src/sys/time/CMakeLists.txt b/libc/test/src/sys/time/CMakeLists.txt
index b09632996d136..48e8c5d8bd132 100644
--- a/libc/test/src/sys/time/CMakeLists.txt
+++ b/libc/test/src/sys/time/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_sys_time_unittests)
-add_libc_test(
+add_libc_unittest(
utimes_test
SUITE
libc_sys_time_unittests
@@ -20,7 +20,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
setitimer_test
SUITE
libc_sys_time_unittests
@@ -38,7 +38,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
getitimer_test
SUITE
libc_sys_time_unittests
@@ -53,7 +53,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
gettimeofday_test
SUITE
libc_sys_time_unittests
diff --git a/libc/test/src/sys/time/utimes_test.cpp b/libc/test/src/sys/time/utimes_test.cpp
index e2b75d10e7e88..eabea7f1f0edc 100644
--- a/libc/test/src/sys/time/utimes_test.cpp
+++ b/libc/test/src/sys/time/utimes_test.cpp
@@ -26,7 +26,7 @@ using LlvmLibcUtimesTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
TEST_F(LlvmLibcUtimesTest, ChangeTimesSpecific) {
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
- constexpr const char *FILE_PATH = APPEND_LIBC_TEST("utimes_pass.test");
+ constexpr const char *FILE_PATH = "utimes_pass.test";
auto TEST_FILE = libc_make_test_file_path(FILE_PATH);
int fd = LIBC_NAMESPACE::open(TEST_FILE, O_WRONLY | O_CREAT, S_IRWXU);
ASSERT_ERRNO_SUCCESS();
diff --git a/libc/test/src/sys/utsname/CMakeLists.txt b/libc/test/src/sys/utsname/CMakeLists.txt
index e32108ec91492..3640fc3bc5e25 100644
--- a/libc/test/src/sys/utsname/CMakeLists.txt
+++ b/libc/test/src/sys/utsname/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_sys_utsname_unittests)
-add_libc_test(
+add_libc_unittest(
uname_test
SUITE
libc_sys_utsname_unittests
diff --git a/libc/test/src/sys/wait/CMakeLists.txt b/libc/test/src/sys/wait/CMakeLists.txt
index 839fc8eac7190..4d517fb8db755 100644
--- a/libc/test/src/sys/wait/CMakeLists.txt
+++ b/libc/test/src/sys/wait/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_sys_wait_unittests)
-add_libc_test(
+add_libc_unittest(
waitpid_test
SUITE
libc_sys_wait_unittests
@@ -14,7 +14,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
wait4_test
SUITE
libc_sys_wait_unittests
diff --git a/libc/test/src/termios/CMakeLists.txt b/libc/test/src/termios/CMakeLists.txt
index a802b3e7aba2a..2ff137e89ebc1 100644
--- a/libc/test/src/termios/CMakeLists.txt
+++ b/libc/test/src/termios/CMakeLists.txt
@@ -1,6 +1,6 @@
add_custom_target(libc_termios_unittests)
-add_libc_test(
+add_libc_unittest(
termios_test
SUITE
libc_termios_unittests
diff --git a/libc/test/src/time/CMakeLists.txt b/libc/test/src/time/CMakeLists.txt
index 6d7494906e76d..e4d7dce066c7b 100644
--- a/libc/test/src/time/CMakeLists.txt
+++ b/libc/test/src/time/CMakeLists.txt
@@ -12,7 +12,7 @@ add_header_library(
LibcTest
)
-add_libc_test(
+add_libc_unittest(
asctime_test
SUITE
libc_time_unittests
@@ -29,7 +29,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
asctime_r_test
SUITE
libc_time_unittests
@@ -46,7 +46,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
ctime_test
SUITE
libc_time_unittests
@@ -64,7 +64,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
ctime_r_test
SUITE
libc_time_unittests
@@ -82,7 +82,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
localtime_test
SUITE
libc_time_unittests
@@ -93,7 +93,7 @@ add_libc_test(
libc.src.time.localtime
)
-add_libc_test(
+add_libc_unittest(
localtime_r_test
SUITE
libc_time_unittests
@@ -143,7 +143,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
difftime_test
SUITE
libc_time_unittests
@@ -155,7 +155,7 @@ add_libc_test(
libc.src.__support.FPUtil.fp_bits
)
-add_libc_test(
+add_libc_unittest(
gmtime_test
SUITE
libc_time_unittests
@@ -172,7 +172,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
gmtime_r_test
SUITE
libc_time_unittests
@@ -238,7 +238,7 @@ add_libc_test(
libc.src.time.strptime
)
-add_libc_test(
+add_libc_unittest(
time_test
SUITE
libc_time_unittests
diff --git a/libc/test/src/ucontext/CMakeLists.txt b/libc/test/src/ucontext/CMakeLists.txt
index e0e82b13d0e0c..4c8444393bd35 100644
--- a/libc/test/src/ucontext/CMakeLists.txt
+++ b/libc/test/src/ucontext/CMakeLists.txt
@@ -1,7 +1,7 @@
add_custom_target(libc_ucontext_unittests)
if(TARGET libc.src.ucontext.getcontext)
- add_libc_test(
+ add_libc_unittest(
ucontext_test
SUITE
libc_ucontext_unittests
diff --git a/libc/test/src/unistd/CMakeLists.txt b/libc/test/src/unistd/CMakeLists.txt
index fb13dc2981a7d..4cdf5d0e4fc60 100644
--- a/libc/test/src/unistd/CMakeLists.txt
+++ b/libc/test/src/unistd/CMakeLists.txt
@@ -2,7 +2,7 @@ add_custom_target(libc_unistd_unittests)
add_subdirectory(testdata)
-add_libc_test(
+add_libc_unittest(
alarm_test
SUITE
libc_unistd_unittests
@@ -17,7 +17,7 @@ add_libc_test(
libc.src.unistd.alarm
)
-add_libc_test(
+add_libc_unittest(
access_test
SUITE
libc_unistd_unittests
@@ -35,7 +35,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
chdir_test
SUITE
libc_unistd_unittests
@@ -73,7 +73,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
dup_test
SUITE
libc_unistd_unittests
@@ -93,7 +93,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
dup2_test
SUITE
libc_unistd_unittests
@@ -113,7 +113,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
dup3_test
SUITE
libc_unistd_unittests
@@ -133,7 +133,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
faccessat_test
SUITE
libc_unistd_unittests
@@ -151,7 +151,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
fchdir_test
SUITE
libc_unistd_unittests
@@ -167,7 +167,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
fchown_test
SUITE
libc_unistd_unittests
@@ -209,7 +209,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
pread_pwrite_test
SUITE
libc_unistd_unittests
@@ -247,7 +247,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
link_test
SUITE
libc_unistd_unittests
@@ -265,7 +265,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
linkat_test
SUITE
libc_unistd_unittests
@@ -283,7 +283,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
lseek_test
SUITE
libc_unistd_unittests
@@ -300,7 +300,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
pipe_test
SUITE
libc_unistd_unittests
@@ -315,7 +315,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
pipe2_test
SUITE
libc_unistd_unittests
@@ -330,7 +330,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
rmdir_test
SUITE
libc_unistd_unittests
@@ -346,7 +346,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
swab_test
SUITE
libc_unistd_unittests
@@ -356,7 +356,7 @@ add_libc_test(
libc.src.unistd.swab
)
-add_libc_test(
+add_libc_unittest(
readlink_test
SUITE
libc_unistd_unittests
@@ -374,7 +374,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
readlinkat_test
SUITE
libc_unistd_unittests
@@ -393,7 +393,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
setsid_test
SUITE
libc_unistd_unittests
@@ -403,7 +403,7 @@ add_libc_test(
libc.src.unistd.setsid
)
-add_libc_test(
+add_libc_unittest(
sleep_test
SUITE
libc_unistd_unittests
@@ -416,7 +416,7 @@ add_libc_test(
libc.src.unistd.sleep
)
-add_libc_test(
+add_libc_unittest(
symlink_test
SUITE
libc_unistd_unittests
@@ -434,7 +434,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
symlinkat_test
SUITE
libc_unistd_unittests
@@ -452,7 +452,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
truncate_test
SUITE
libc_unistd_unittests
@@ -473,7 +473,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
unlink_test
SUITE
libc_unistd_unittests
@@ -490,7 +490,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
unlinkat_test
SUITE
libc_unistd_unittests
@@ -508,7 +508,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
usleep_test
SUITE
libc_unistd_unittests
@@ -522,7 +522,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
gethostname_test
SUITE
libc_unistd_unittests
@@ -534,7 +534,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
getpagesize_test
SUITE
libc_unistd_unittests
@@ -545,7 +545,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
getgid_test
SUITE
libc_unistd_unittests
@@ -555,7 +555,7 @@ add_libc_test(
libc.src.unistd.getgid
)
-add_libc_test(
+add_libc_unittest(
getpid_test
SUITE
libc_unistd_unittests
@@ -565,7 +565,7 @@ add_libc_test(
libc.src.unistd.getpid
)
-add_libc_test(
+add_libc_unittest(
getppid_test
SUITE
libc_unistd_unittests
@@ -575,7 +575,7 @@ add_libc_test(
libc.src.unistd.getppid
)
-add_libc_test(
+add_libc_unittest(
getsid_test
SUITE
libc_unistd_unittests
@@ -587,7 +587,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
getuid_test
SUITE
libc_unistd_unittests
@@ -597,7 +597,7 @@ add_libc_test(
libc.src.unistd.getuid
)
-add_libc_test(
+add_libc_unittest(
isatty_test
SUITE
libc_unistd_unittests
@@ -613,7 +613,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
geteuid_test
SUITE
libc_unistd_unittests
@@ -641,7 +641,7 @@ add_libc_test(
)
-add_libc_test(
+add_libc_unittest(
sysconf_test
SUITE
libc_unistd_unittests
@@ -652,7 +652,7 @@ add_libc_test(
libc.src.unistd.sysconf
)
-add_libc_test(
+add_libc_unittest(
fpathconf_test
SUITE
libc_unistd_unittests
@@ -669,7 +669,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoSetterMatcher
)
-add_libc_test(
+add_libc_unittest(
pathconf_test
SUITE
libc_unistd_unittests
diff --git a/libc/test/src/unistd/access_test.cpp b/libc/test/src/unistd/access_test.cpp
index 04a480c011f59..aebc50a76324d 100644
--- a/libc/test/src/unistd/access_test.cpp
+++ b/libc/test/src/unistd/access_test.cpp
@@ -24,7 +24,7 @@ TEST_F(LlvmLibcAccessTest, CreateAndTest) {
// test that it is accessable in those modes but not in others.
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
- constexpr const char *FILENAME = APPEND_LIBC_TEST("access.test");
+ constexpr const char *FILENAME = "access.test";
auto TEST_FILE = libc_make_test_file_path(FILENAME);
int fd = LIBC_NAMESPACE::open(TEST_FILE, O_WRONLY | O_CREAT, S_IRWXU);
ASSERT_ERRNO_SUCCESS();
diff --git a/libc/test/src/unistd/dup2_test.cpp b/libc/test/src/unistd/dup2_test.cpp
index d102465067e8a..d8b8900f14374 100644
--- a/libc/test/src/unistd/dup2_test.cpp
+++ b/libc/test/src/unistd/dup2_test.cpp
@@ -22,7 +22,7 @@ using LlvmLibcdupTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
TEST_F(LlvmLibcdupTest, ReadAndWriteViaDup) {
constexpr int DUPFD = 0xD0;
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
- constexpr const char *FILENAME = APPEND_LIBC_TEST("dup2.test");
+ constexpr const char *FILENAME = "dup2.test";
auto TEST_FILE = libc_make_test_file_path(FILENAME);
int fd = LIBC_NAMESPACE::open(TEST_FILE, O_WRONLY | O_CREAT, S_IRWXU);
ASSERT_ERRNO_SUCCESS();
diff --git a/libc/test/src/unistd/faccessat_test.cpp b/libc/test/src/unistd/faccessat_test.cpp
index e43d6c0801f91..ca4e19f1aec75 100644
--- a/libc/test/src/unistd/faccessat_test.cpp
+++ b/libc/test/src/unistd/faccessat_test.cpp
@@ -28,7 +28,7 @@ using LlvmLibcFaccessatTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
TEST_F(LlvmLibcFaccessatTest, WithAtFdcwd) {
// Test access checks on a file with AT_FDCWD and no flags, equivalent to
// access().
- constexpr const char *FILENAME = APPEND_LIBC_TEST("faccessat_basic.test");
+ constexpr const char *FILENAME = "faccessat_basic.test";
auto TEST_FILE = libc_make_test_file_path(FILENAME);
// Check permissions on a file with full permissions
@@ -71,7 +71,7 @@ TEST_F(LlvmLibcFaccessatTest, AtEaccess) {
// With AT_EACCESS, faccessat checks permissions using the effective user ID,
// but the effective and real user ID will be the same here and changing that
// is not feasible in a test, so this is just a basic sanity check.
- constexpr const char *FILENAME = APPEND_LIBC_TEST("faccessat_eaccess.test");
+ constexpr const char *FILENAME = "faccessat_eaccess.test";
auto TEST_FILE = libc_make_test_file_path(FILENAME);
int fd = LIBC_NAMESPACE::open(TEST_FILE, O_WRONLY | O_CREAT, S_IRWXU);
@@ -87,8 +87,7 @@ TEST_F(LlvmLibcFaccessatTest, AtEaccess) {
}
TEST_F(LlvmLibcFaccessatTest, AtEmptyPath) {
- constexpr const char *FILENAME =
- APPEND_LIBC_TEST("faccessat_atemptypath.test");
+ constexpr const char *FILENAME = "faccessat_atemptypath.test";
auto TEST_FILE = libc_make_test_file_path(FILENAME);
int fd = LIBC_NAMESPACE::open(TEST_FILE, O_WRONLY | O_CREAT, S_IRWXU);
diff --git a/libc/test/src/unistd/pread_pwrite_test.cpp b/libc/test/src/unistd/pread_pwrite_test.cpp
index c304baed83077..5ac2410d5f986 100644
--- a/libc/test/src/unistd/pread_pwrite_test.cpp
+++ b/libc/test/src/unistd/pread_pwrite_test.cpp
@@ -33,7 +33,7 @@ TEST_F(LlvmLibcUniStd, PWriteAndPReadBackTest) {
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
- constexpr const char *FILENAME = APPEND_LIBC_TEST("pread_pwrite.test");
+ constexpr const char *FILENAME = "pread_pwrite.test";
auto TEST_FILE = libc_make_test_file_path(FILENAME);
int fd = LIBC_NAMESPACE::open(TEST_FILE, O_WRONLY | O_CREAT, S_IRWXU);
ASSERT_ERRNO_SUCCESS();
diff --git a/libc/test/src/wchar/CMakeLists.txt b/libc/test/src/wchar/CMakeLists.txt
index 1f2d394634968..52406fdcfd2d6 100644
--- a/libc/test/src/wchar/CMakeLists.txt
+++ b/libc/test/src/wchar/CMakeLists.txt
@@ -517,7 +517,7 @@ add_libc_test(
libc.test.UnitTest.ErrnoCheckingTest
)
-add_libc_test(
+add_libc_unittest(
wcsxfrm_test
SUITE
libc_wchar_unittests
diff --git a/libc/test/utils/FPUtil/CMakeLists.txt b/libc/test/utils/FPUtil/CMakeLists.txt
index e76f8ff783c86..84ff9d846854c 100644
--- a/libc/test/utils/FPUtil/CMakeLists.txt
+++ b/libc/test/utils/FPUtil/CMakeLists.txt
@@ -1,9 +1,7 @@
if((${LIBC_TARGET_OS} STREQUAL "linux") AND ((${LIBC_TARGET_ARCHITECTURE_IS_X86})
OR (${LIBC_TARGET_ARCHITECTURE_IS_X86_64})))
- add_libc_test(
+ add_libc_unittest(
x86_long_double_test
- SUITE
- libc-fputil-tests
SRCS
x86_long_double_test.cpp
DEPENDS
diff --git a/libc/test/utils/UnitTest/CMakeLists.txt b/libc/test/utils/UnitTest/CMakeLists.txt
index aafb2ed924361..d3af8245515b9 100644
--- a/libc/test/utils/UnitTest/CMakeLists.txt
+++ b/libc/test/utils/UnitTest/CMakeLists.txt
@@ -4,7 +4,7 @@ endif()
add_custom_target(libc_unittest_tests)
-add_libc_test(
+add_libc_unittest(
testfilter_test
SUITE
libc_unittest_tests
diff --git a/libcxx/docs/Status/Cxx26Issues.csv b/libcxx/docs/Status/Cxx26Issues.csv
index 6b3b5f61727c7..db9bf85b72d4c 100644
--- a/libcxx/docs/Status/Cxx26Issues.csv
+++ b/libcxx/docs/Status/Cxx26Issues.csv
@@ -142,7 +142,7 @@
"`LWG4235 <https://wg21.link/LWG4235>`__","``cache_latest_view`` and ``to_input_view`` miss ``reserve_hint``","2025-06 (Sofia)","","","`#148219 <https://github.com/llvm/llvm-project/issues/148219>`__",""
"`LWG4236 <https://wg21.link/LWG4236>`__","``chunk_view::outer-iterator::value_type`` should provide ``reserve_hint``","2025-06 (Sofia)","","","`#148220 <https://github.com/llvm/llvm-project/issues/148220>`__",""
"`LWG4239 <https://wg21.link/LWG4239>`__","``flat_map``'s transparent comparator no longer works for string literals","2025-06 (Sofia)","","","`#148223 <https://github.com/llvm/llvm-project/issues/148223>`__",""
-"`LWG4242 <https://wg21.link/LWG4242>`__","``ranges::distance`` does not work with volatile iterators","2025-06 (Sofia)","|Complete|","14","`#148224 <https://github.com/llvm/llvm-project/issues/148224>`__",""
+"`LWG4242 <https://wg21.link/LWG4242>`__","``ranges::distance`` does not work with volatile iterators","2025-06 (Sofia)","","","`#148224 <https://github.com/llvm/llvm-project/issues/148224>`__",""
"`LWG4245 <https://wg21.link/LWG4245>`__","Operators that interact with ``counted_iterator`` and ``default_sentinel_t`` should be ``noexcept``","2025-06 (Sofia)","","","`#148226 <https://github.com/llvm/llvm-project/issues/148226>`__",""
"`LWG4247 <https://wg21.link/LWG4247>`__","Header ``<stdbit.h>`` is not yet freestanding","2025-06 (Sofia)","","","`#148227 <https://github.com/llvm/llvm-project/issues/148227>`__",""
"","","","","","",""
diff --git a/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp b/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp
index 37ee37a0e5876..30507c59495ea 100644
--- a/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp
@@ -199,41 +199,6 @@ static_assert(!std::sized_sentinel_for<EvilSentinel<int*>, const int*>);
static_assert(std::sized_sentinel_for<EvilSentinel<const int*>, int*>);
static_assert(std::sized_sentinel_for<EvilSentinel<const int*>, const int*>);
-// LWG3664: "LWG3392 broke std::ranges::distance(a, a+3)" tests.
-constexpr void test_lwg3664() {
- {
- int a[] = {1, 2, 3};
- assert(std::ranges::distance(a, a + 3) == 3);
- assert(std::ranges::distance(a, a) == 0);
- assert(std::ranges::distance(a + 3, a) == -3);
- }
- {
- int a[] = {1, 2, 3};
- assert(std::ranges::distance(a, EvilSentinel<int*>{a + 3}) == 3);
- assert(std::ranges::distance(a, EvilSentinel<int*>{a}) == 0);
- assert(std::ranges::distance(a + 3, EvilSentinel<int*>{a}) == -3);
- assert(std::ranges::distance(std::move(a), EvilSentinel<int*>{a + 3}) == 3);
- }
- {
- const int a[] = {1, 2, 3};
- assert(std::ranges::distance(a, EvilSentinel<const int*>{a + 3}) == 3);
- assert(std::ranges::distance(a, EvilSentinel<const int*>{a}) == 0);
- assert(std::ranges::distance(a + 3, EvilSentinel<const int*>{a}) == -3);
- assert(std::ranges::distance(std::move(a), EvilSentinel<const int*>{a + 3}) == 3);
- static_assert(!std::is_invocable_v<decltype(std::ranges::distance), const int (&)[3], EvilSentinel<int*>>);
- static_assert(!std::is_invocable_v<decltype(std::ranges::distance), const int (&&)[3], EvilSentinel<int*>>);
- }
-}
-
-// LWG4242: "ranges::distance does not work with volatile iterators" tests.
-void test_lwg4242() {
- int arr[] = {1, 2, 3};
- int* volatile ptr = arr;
- auto dist = std::distance(ptr, arr + 3);
- auto r_dist = std::ranges::distance(ptr, arr + 3);
- assert(dist == r_dist);
-}
-
constexpr bool test() {
{
int a[] = {1, 2, 3};
@@ -319,12 +284,30 @@ constexpr bool test() {
auto view = c | std::views::join;
assert(std::ranges::distance(view.begin(), view.end()) == 30);
}
+ if (!TEST_IS_CONSTANT_EVALUATED) // TODO: Use TEST_STD_AT_LEAST_26_OR_RUNTIME_EVALUATED when std::deque is made constexpr
+ test_deque();
- test_lwg3664();
-
- if (!TEST_IS_CONSTANT_EVALUATED) {
- test_deque(); // TODO: Use TEST_STD_AT_LEAST_26_OR_RUNTIME_EVALUATED when std::deque is made constexpr
- test_lwg4242();
+ {
+ int a[] = {1, 2, 3};
+ assert(std::ranges::distance(a, a + 3) == 3);
+ assert(std::ranges::distance(a, a) == 0);
+ assert(std::ranges::distance(a + 3, a) == -3);
+ }
+ {
+ int a[] = {1, 2, 3};
+ assert(std::ranges::distance(a, EvilSentinel<int*>{a + 3}) == 3);
+ assert(std::ranges::distance(a, EvilSentinel<int*>{a}) == 0);
+ assert(std::ranges::distance(a + 3, EvilSentinel<int*>{a}) == -3);
+ assert(std::ranges::distance(std::move(a), EvilSentinel<int*>{a + 3}) == 3);
+ }
+ {
+ const int a[] = {1, 2, 3};
+ assert(std::ranges::distance(a, EvilSentinel<const int*>{a + 3}) == 3);
+ assert(std::ranges::distance(a, EvilSentinel<const int*>{a}) == 0);
+ assert(std::ranges::distance(a + 3, EvilSentinel<const int*>{a}) == -3);
+ assert(std::ranges::distance(std::move(a), EvilSentinel<const int*>{a + 3}) == 3);
+ static_assert(!std::is_invocable_v<decltype(std::ranges::distance), const int (&)[3], EvilSentinel<int*>>);
+ static_assert(!std::is_invocable_v<decltype(std::ranges::distance), const int (&&)[3], EvilSentinel<int*>>);
}
return true;
diff --git a/lldb/docs/use/aarch64-linux.md b/lldb/docs/use/aarch64-linux.md
index eda848164a3d6..20f2db44e749d 100644
--- a/lldb/docs/use/aarch64-linux.md
+++ b/lldb/docs/use/aarch64-linux.md
@@ -112,7 +112,7 @@ In LLDB you will see the following new registers:
to the vector length of non-streaming mode and may change independently. This
register is read only.
-:::{note}
+```{note}
While in non-streaming mode, the `vg` register shows the non-streaming
vector length, and the `svg` register shows the streaming vector length.
When in streaming mode, both `vg` and `svg` show the streaming mode vector
@@ -120,7 +120,7 @@ In LLDB you will see the following new registers:
vector length within LLDB, while in streaming mode. This is a limitation of
the LLDB implementation not the architecture, which stores both lengths
independently.
-:::
+```
In the example below, the streaming vector length is 16 bytes and we are in
streaming mode. Note that bits 0 and 1 of `svcr` are set, indicating that we
diff --git a/lldb/include/lldb/Expression/Materializer.h b/lldb/include/lldb/Expression/Materializer.h
index d7e0a9dc85e59..64ed545febf15 100644
--- a/lldb/include/lldb/Expression/Materializer.h
+++ b/lldb/include/lldb/Expression/Materializer.h
@@ -21,18 +21,6 @@
namespace lldb_private {
-/// Materializer packs the variables an expression reads and writes into a
-/// single argument struct, and unpacks them again afterward.
-///
-/// Expressions can't have real addresses for the variables they touch baked
-/// into their IR, since some of those addresses (e.g. frame-relative locals)
-/// aren't known until the moment of execution. IRForTarget rewrites such
-/// accesses into reads from one struct instead, registering an Entity per
-/// variable via AddVariable/AddPersistentVariable/AddResultVariable.
-/// Materialize() lays out and populates that struct against a target
-/// IRMemoryMap, independent of whether the expression is later interpreted or
-/// JIT'd and run; the returned Dematerializer reverses the process afterward,
-/// copying side effects back out and extracting the result.
class Materializer {
public:
Materializer() = default;
diff --git a/llvm/docs/AMDGPUMemoryModel.md b/llvm/docs/AMDGPUMemoryModel.md
index 0a7f023bf19ac..2fadb245d10c4 100644
--- a/llvm/docs/AMDGPUMemoryModel.md
+++ b/llvm/docs/AMDGPUMemoryModel.md
@@ -203,12 +203,12 @@ Any access to `addrspace(0)` (aka flat or generic) always results in a
*store-available* or *load-visible* operation with scope "workgroup", if the
flat address resolves to `addrspace(3)`.
-:::{note}
+```{note}
This is independent of the `syncscope` of an atomic access. For example, even if
a `store atomic` to `addrspace(3)` specifies a smaller `syncscope` such as "wavefront", the
side-effects are made available at "workgroup" scope. In other words, the scope
for atomicity is not always the same as the scope for availability/visibility.
-:::
+```
### volatile Accesses
@@ -228,12 +228,12 @@ A `volatile` atomic access is not widened in this way. Its availability and
visibility remain limited to its `syncscope`, as described for atomic accesses
above.
-:::{note}
+```{note}
The availability and visibility of volatile accesses is specific to AMDGPU, and
orthogonal to the {ref}`base semantics defined in LLVM IR<volatile>`. This fully
specifies the behavior that the {ref}`LLVM memory model<memmodel>` otherwise
leaves target-dependent for `volatile` accesses.
-:::
+```
(amdgpu-av-metadata)=
diff --git a/llvm/docs/AliasAnalysis.md b/llvm/docs/AliasAnalysis.md
index a3a544427937f..62b3572dc3d23 100644
--- a/llvm/docs/AliasAnalysis.md
+++ b/llvm/docs/AliasAnalysis.md
@@ -496,10 +496,10 @@ information for call instructions. This allows the optimizer to know that calls
to a function do not clobber or read the value of the global, allowing loads and
stores to be eliminated.
-:::{note}
+```{note}
This pass is somewhat limited in its scope (only support non-address taken
globals), but is very quick analysis.
-:::
+```
#### The `-steens-aa` pass
@@ -513,10 +513,10 @@ version of Steensgaard's algorithm using the Data Structure Analysis framework.
This gives it substantially more precision than the standard algorithm while
maintaining excellent analysis scalability.
-:::{note}
+```{note}
`-steens-aa` is available in the optional "poolalloc" module. It is not part
of the LLVM core.
-:::
+```
#### The `-ds-aa` pass
@@ -530,10 +530,10 @@ queries, and can provide context-sensitive mod/ref information as well. The
only major facility not implemented so far is support for must-alias
information.
-:::{note}
+```{note}
`-ds-aa` is available in the optional "poolalloc" module. It is not part of
the LLVM core.
-:::
+```
#### The `-scev-aa` pass
@@ -613,11 +613,11 @@ algorithm will have a lower number of may aliases).
## Memory Dependence Analysis
-:::{note}
+```{note}
We are currently in the process of migrating things from
`MemoryDependenceAnalysis` to {doc}`MemorySSA`. Please try to use
that instead.
-:::
+```
If you're just looking to be a client of alias analysis information, consider
using the Memory Dependence Analysis interface instead. MemDep is a lazy,
diff --git a/llvm/docs/BitCodeFormat.md b/llvm/docs/BitCodeFormat.md
index 5ea909fcb74ff..406cd10a0df1f 100644
--- a/llvm/docs/BitCodeFormat.md
+++ b/llvm/docs/BitCodeFormat.md
@@ -862,12 +862,12 @@ in the `PARAMATTR_GROUP_BLOCK` block.
#### PARAMATTR_CODE_ENTRY_OLD Record
-:::{note}
+```{note}
This is a legacy encoding for attributes, produced by LLVM versions 3.2 and
earlier. It is guaranteed to be understood by the current LLVM version, as
specified in the {ref}`IR backwards compatibility` policy.
-:::
+```
`[ENTRY, paramidx0, attr0, paramidx1, attr1...]`
@@ -971,21 +971,21 @@ Correspond to:
The mappings between the enumeration and the attribute name string may be found
in the file [Attributes.td](https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/Attributes.td).
-:::{note}
+```{note}
The `allocsize` attribute has a special encoding for its arguments. Its two
arguments, which are 32-bit integers, are packed into one 64-bit integer value
(i.e., `(EltSizeParam << 32) | NumEltsParam`), with `NumEltsParam` taking on
the sentinel value -1 if it is not specified.
-:::
+```
-:::{note}
+```{note}
The `vscale_range` attribute has a special encoding for its arguments. Its two
arguments, which are 32-bit integers, are packed into one 64-bit integer value
(i.e., `(Min << 32) | Max`), with `Max` taking on the value of `Min` if
it is not specified.
-:::
+```
(TYPE_BLOCK)=
@@ -1080,12 +1080,12 @@ operand fields are:
#### TYPE_CODE_FUNCTION_OLD Record
-:::{note}
+```{note}
This is a legacy encoding for functions, produced by LLVM versions 3.0 and
earlier. It is guaranteed to be understood by the current LLVM version, as
specified in the {ref}`IR backwards compatibility` policy.
-:::
+```
`[FUNCTION_OLD, vararg, ignored, retty, ...paramty... ]`
diff --git a/llvm/docs/BuildingADistribution.md b/llvm/docs/BuildingADistribution.md
index 14274b09e19f4..e3672e7e26afb 100644
--- a/llvm/docs/BuildingADistribution.md
+++ b/llvm/docs/BuildingADistribution.md
@@ -40,14 +40,14 @@ at process launch time, which can be very slow for C++ code.
(shared-libs)=
-:::{warning}
+```{warning}
One very important note: Distributions should never be built using the
*BUILD_SHARED_LIBS* CMake option. That option exists for optimizing developer
workflow only. Due to design and implementation decisions, LLVM relies on
global data which can end up being duplicated across shared libraries
resulting in bugs. As such this is not a safe way to distribute LLVM or
LLVM-based tools.
-:::
+```
The simplest example of building a distribution with reasonable performance is
captured in the DistributionExample CMake cache file located at
@@ -175,10 +175,10 @@ generation using dtrace is also non-deterministic.
## Options for Reducing Size
-:::{warning}
+```{warning}
Any steps taken to reduce binary size will come at the cost of runtime
performance in the generated binaries.
-:::
+```
The simplest and least significant way to reduce binary size is to set the
*CMAKE_BUILD_TYPE* variable to `MinSizeRel`, which will set the compiler
@@ -190,10 +190,10 @@ all the tools. This reduces code size by decreasing duplication of common code
among the LLVM-based tools. This can be done by setting the following two
CMake options to `On`: *LLVM_BUILD_LLVM_DYLIB* and *LLVM_LINK_LLVM_DYLIB*.
-:::{warning}
+```{warning}
Distributions should never be built using the *BUILD_SHARED_LIBS* CMake
option. ({ref}`See the warning above for more explanation <shared-libs>`.).
-:::
+```
## Relevant CMake Options
diff --git a/llvm/docs/CMake.md b/llvm/docs/CMake.md
index c64b419cd06ba..c12c95bbc3dec 100644
--- a/llvm/docs/CMake.md
+++ b/llvm/docs/CMake.md
@@ -134,9 +134,9 @@ for building with NMake. By default, CMake chooses the most specific generator
supported by your development environment. If you want an alternative generator,
you must specify this to CMake with the `-G` option.
-:::{todo}
+```{todo}
Explain variables and cache. Move explanation here from #options section.
-:::
+```
(Options and variables)=
## Options and variables
@@ -314,9 +314,9 @@ sub-projects. Nearly all of these variable names begin with `LLVM_`.
Windows, shared libraries may be used when building with MinGW, including
mingw-w64, but not when building with the Microsoft toolchain.
- :::{note}
+ ```{note}
`BUILD_SHARED_LIBS` is only recommended for use by LLVM developers. If you want to build LLVM as a shared library, you should use the `LLVM_BUILD_LLVM_DYLIB` option.
- :::
+ ```
**LLVM_ABI_BREAKING_CHECKS**:STRING
@@ -643,9 +643,9 @@ sub-projects. Nearly all of these variable names begin with `LLVM_`.
`bolt;clang;clang-tools-extra;compiler-rt;cross-project-tests;libc;libclc;lld;lldb;mlir;openmp;polly`
- :::{note}
+ ```{note}
Some projects listed here can also go in `LLVM_ENABLE_RUNTIMES`. They should only appear in one of the two lists. If a project is a valid possibility for both, prefer putting it in `LLVM_ENABLE_RUNTIMES`.
- :::
+ ```
**LLVM_ENABLE_RTTI**:BOOL
@@ -660,9 +660,9 @@ sub-projects. Nearly all of these variable names begin with `LLVM_`.
using a system compiler, see the [libc++
documentation](https://libcxx.llvm.org/VendorDocumentation.html).
- :::{note}
+ ```{note}
The list should not have duplicates with `LLVM_ENABLE_PROJECTS`.
- :::
+ ```
To list all possible runtimes, include an invalid name. For example
`-DLLVM_ENABLE_RUNTIMES=notaruntime`. The resulting CMake error will list
diff --git a/llvm/docs/CodeGenerator.md b/llvm/docs/CodeGenerator.md
index 32242b413c2a8..cd37407de79e4 100644
--- a/llvm/docs/CodeGenerator.md
+++ b/llvm/docs/CodeGenerator.md
@@ -16,9 +16,9 @@
```
-:::{warning}
+```{warning}
This is a work in progress.
-:::
+```
## Introduction
The LLVM target-independent code generator is a framework that provides a suite
@@ -1196,9 +1196,9 @@ of the basic block. Live intervals for virtual registers are computed for some
ordering of the machine instructions `[1, N]`. A live interval is an interval
`[i, j)`, where `1 >= i >= j > N`, for which a variable is live.
-:::{note}
+```{note}
More to come...
-:::
+```
(Register Allocation)=
(register allocator)=
@@ -1448,9 +1448,9 @@ $ llc -regalloc=pbqp file.bc -o pbqp.s
### Prolog/Epilog Code Insertion
-:::{note}
+```{note}
To Be Written
-:::
+```
### Compact Unwind
Throwing an exception requires *unwinding* out of a function. The information on
@@ -1522,9 +1522,9 @@ the function in bits 9-12 (mask: `0x00001C00`).
### Late Machine Code Optimizations
-:::{note}
+```{note}
To Be Written
-:::
+```
(Code Emission)=
### Code Emission
@@ -1645,9 +1645,9 @@ compiler.
### Instruction Parsing
-:::{note}
+```{note}
To Be Written
-:::
+```
### Instruction Alias Processing
Once the instruction is parsed, it enters the MatchInstructionImpl function.
@@ -1750,9 +1750,9 @@ as the third parameter to the InstAlias definition.
### Instruction Matching
-:::{note}
+```{note}
To Be Written
-:::
+```
(Implementations of the abstract target description interfaces)=
(implement the target description)=
@@ -2091,9 +2091,9 @@ makes it convenient to locate programmatically and during debugging.
#### Dynamic Allocation
-:::{note}
+```{note}
TODO - More to come.
-:::
+```
### The NVPTX backend
The NVPTX code generator under lib/Target/NVPTX is an open-source version of
diff --git a/llvm/docs/CodingStandards.md b/llvm/docs/CodingStandards.md
index 24df36285ba21..716a959d1cfd2 100644
--- a/llvm/docs/CodingStandards.md
+++ b/llvm/docs/CodingStandards.md
@@ -899,10 +899,10 @@ If you really need to do something like this, put a private header file in the
same directory as the source files, and include it locally. This ensures that
your private interface remains private and undisturbed by outsiders.
-:::{note}
+```{note}
It's okay to put extra implementation methods in a public class itself. Just
make them private (or protected) and all is well.
-:::
+```
#### Use Namespace Qualifiers to Define Previously Declared Symbols
@@ -1497,10 +1497,10 @@ problematic in this regard --- just `<iostream>`. However, `raw_ostream`
provides various APIs that are better performing for almost every use than
`std::ostream` style APIs.
-:::{note}
+```{note}
New code should always use {ref}`raw_ostream <raw_ostream>` for writing, or the
`llvm::MemoryBuffer` API for reading files.
-:::
+```
(raw_ostream)=
diff --git a/llvm/docs/CommandLine.md b/llvm/docs/CommandLine.md
index 2cf37ebc52d42..fab5894acc3df 100644
--- a/llvm/docs/CommandLine.md
+++ b/llvm/docs/CommandLine.md
@@ -922,12 +922,12 @@ cl::opt<bool> Quiet("quiet");
defaults to the value created by the default constructor for the
type.
-:::{warning}
+```{warning}
If you specify both **cl::init** and **cl::location** for an option, you
must specify **cl::location** first, so that when the command-line parser
sees **cl::init**, it knows where to put the initial value. (You will get an
error at runtime if you don't put them in the right order.)
-:::
+```
(cl::location)=
@@ -1695,14 +1695,14 @@ library. Examples of this include the `llvm::DebugFlag` exported by the
`lib/Support/Debug.cpp` file and the `llvm::TimePassesIsEnabled` flag
exported by the `lib/IR/PassManager.cpp` file.
-:::{todo}
+```{todo}
TODO: complete this section
-:::
+```
(dynamically loaded options)=
### Dynamically adding command line options
-:::{todo}
+```{todo}
TODO: fill in this section
-:::
+```
diff --git a/llvm/docs/CompilerWriterInfo.md b/llvm/docs/CompilerWriterInfo.md
index f7d94414837bc..a275f604da820 100644
--- a/llvm/docs/CompilerWriterInfo.md
+++ b/llvm/docs/CompilerWriterInfo.md
@@ -1,10 +1,10 @@
# Architecture & Platform Information for Compiler Writers
-:::{note}
+```{note}
This document is a work-in-progress. Additions and clarifications are
welcome.
-:::
+```
## Hardware
diff --git a/llvm/docs/Contributing.md b/llvm/docs/Contributing.md
index 8c75e4ff0da3c..e87cc7896d565 100644
--- a/llvm/docs/Contributing.md
+++ b/llvm/docs/Contributing.md
@@ -63,7 +63,7 @@ recent commit:
% git clang-format HEAD~1
```
-:::{note}
+```{note}
For some patches, formatting them may add changes that obscure the intent of
the patch. For example, adding to an enum that was not previously formatted
may result in the entire enum being reformatted. This happens because not all
@@ -79,7 +79,7 @@ Request that will be merged before your actual changes.
This means that if the formatting changes are the first commit, you will have
an easier time doing this. If they are not, that is ok too, but you will have
to do a bit more work to separate it out.
-:::
+```
Note that `git clang-format` modifies the files, but does not commit them --
you will likely want to run one of the following to add the changes to a commit:
@@ -91,12 +91,12 @@ you will likely want to run one of the following to add the changes to a commit:
% git commit --amend -a
```
-:::{note}
+```{note}
If you don't already have `clang-format` or `git clang-format` installed
on your system, the `clang-format` binary will be built alongside clang, and
the git integration can be run from
`clang/tools/clang-format/git-clang-format`.
-:::
+```
The LLVM project has migrated to GitHub Pull Requests as its review process.
For more information about the workflow of using GitHub Pull Requests see our
@@ -133,10 +133,10 @@ For more information on LLVM's code-review process, please see
### For developers to commit changes from Git
-:::{note}
+```{note}
See also {ref}`GitHub <github-reviews>` for more details on merging your changes
into LLVM project monorepo.
-:::
+```
Once a pull request is approved, you can select the "Squash and merge" button in the
GitHub web interface.
diff --git a/llvm/docs/Coroutines.md b/llvm/docs/Coroutines.md
index fa18a71ad66dd..e7f629bf4ef08 100644
--- a/llvm/docs/Coroutines.md
+++ b/llvm/docs/Coroutines.md
@@ -1,9 +1,9 @@
# Coroutines in LLVM
-:::{warning}
+```{warning}
Compatibility across LLVM releases is not guaranteed.
-:::
+```
## Introduction
@@ -522,7 +522,7 @@ suspend:
If different cleanup code needs to be executed for different suspend points,
a similar switch will be in the `f.destroy` function.
-:::{note}
+```{note}
Using suspend index in a coroutine state and having a switch in `f.resume` and
`f.destroy` is one of the possible implementation strategies. We explored
another option where a distinct `f.resume1`, `f.resume2`, etc. are created for
@@ -530,7 +530,7 @@ every suspend point, and instead of storing an index, the resume and destroy
function pointers are updated at every suspend. Early testing showed that the
current approach is easier on the optimizer than the latter so it is a
lowering strategy implemented at the moment.
-:::
+```
### Distinct Save and Suspend
diff --git a/llvm/docs/CoverageMappingFormat.md b/llvm/docs/CoverageMappingFormat.md
index 02fab85fa1c81..7b4690f4bb1c7 100644
--- a/llvm/docs/CoverageMappingFormat.md
+++ b/llvm/docs/CoverageMappingFormat.md
@@ -586,9 +586,9 @@ The source range record contains the following fields:
## Testing Format
-:::{warning}
+```{warning}
This section is for the LLVM developers who are working on `llvm-cov` only.
-:::
+```
`llvm-cov` uses a special file format (called `.covmapping` below) for
testing purposes. This format is private and should have no use for general
diff --git a/llvm/docs/DeveloperPolicy.md b/llvm/docs/DeveloperPolicy.md
index 069b8fbb02798..173046650d677 100644
--- a/llvm/docs/DeveloperPolicy.md
+++ b/llvm/docs/DeveloperPolicy.md
@@ -1113,10 +1113,10 @@ disabled again, until the issues have been resolved.
(copyright-license-patents)=
## Copyright, License, and Patents
-:::{note}
+```{note}
This section deals with legal matters but does not provide legal advice. We are not lawyers \-\-- please seek legal counsel from a licensed attorney.
-:::
+```
This section addresses the issues of copyright, license and patents for the LLVM
project. The copyright for the code is held by the contributors of the code.
@@ -1318,14 +1318,14 @@ holds though):
(legacy)=
### Legacy License Structure
-:::{note}
+```{note}
The code base was previously licensed under the Terms described here.
We are in the middle of relicensing to a new approach (described above).
More than 99% of all contributions made to LLVM are covered by the Apache-2.0
WITH LLVM-exception license. A small portion of LLVM code remains exclusively
covered by the legacy license. Contributions after 2024-06-01 are covered
exclusively by the new license.
-:::
+```
We intend to keep LLVM perpetually open source and to use a permissive open
source license. The code in
diff --git a/llvm/docs/ExceptionHandling.md b/llvm/docs/ExceptionHandling.md
index 4b6cf835bac7f..978baee70e74d 100644
--- a/llvm/docs/ExceptionHandling.md
+++ b/llvm/docs/ExceptionHandling.md
@@ -236,11 +236,11 @@ Finally, the entry and exit of catch code is bracketed with calls to
1. Destroys the exception if the handler count goes to zero and the exception
was not re-thrown by throw.
- :::{note}
+ ```{note}
a rethrow from within the catch may replace this call with a
`__cxa_rethrow`.
- :::
+ ```
### Cleanups
@@ -252,14 +252,14 @@ block. To indicate the presence of cleanups, a {ref}`i_landingpad` should have
a *cleanup* clause. Otherwise, the unwinder will not stop at the landing pad if
there are no catches or filters that require it to.
-:::{note}
+```{note}
Do not allow a new exception to propagate out of the execution of a
cleanup. This can corrupt the internal state of the unwinder. Different
languages describe different high-level semantics for these situations: for
example, C++ requires that the process be terminated, whereas Ada cancels both
exceptions and throws a third.
-:::
+```
When all cleanups are finished, if the exception is not handled by the current
function, resume unwinding by calling the {ref}`resume instruction <i_resume>`,
diff --git a/llvm/docs/GettingStarted.md b/llvm/docs/GettingStarted.md
index a8fb74dddd1b2..5c1789de9ef39 100644
--- a/llvm/docs/GettingStarted.md
+++ b/llvm/docs/GettingStarted.md
@@ -243,14 +243,14 @@ LLVM is known to work on the following host platforms:
| Windows x64 | x86-64 | Visual Studio, Clang{sup}`4` |
| Windows on Arm | ARM64 | Visual Studio, Clang{sup}`4` |
-:::{note}
+```{note}
1. Code generation supported for Pentium processors and up
1. Code generation supported for 32-bit ABI only
1. To use LLVM modules on a Win32-based system, you may configure LLVM
with `-DBUILD_SHARED_LIBS=On`.
1. Visual Studio alone can compile LLVM. When using Clang, you
must also have Visual Studio installed.
-:::
+```
Note that Debug builds require a lot of time and disk space. An LLVM-only build
will need about 1-3 GB of space. A full build of LLVM and Clang will need around
15-20 GB of disk space. The exact space requirements will vary by system. (It
@@ -282,12 +282,12 @@ uses the package and provides other details.
| [GNU Make](http://savannah.gnu.org/projects/make) | 3.79, 3.79.1 | Makefile/build processor{sup}`2` |
| [PyYAML](https://pypi.org/project/PyYAML/) | >=5.1 | Header generator{sup}`3` |
-:::{note}
+```{note}
1. Optional, adds compression/uncompression capabilities to selected LLVM
tools.
1. Optional, you can use any other build tool supported by CMake.
1. Only needed when building libc with New Headergen. Mainly used by libc.
-:::
+```
Additionally, your compilation host is expected to have the usual plethora of
Unix utilities. Specifically:
@@ -956,10 +956,10 @@ This section gives an example of using LLVM with the Clang front end.
```console
% clang hello.c -o hello
```
- :::{note}
+ ```{note}
Clang works just like GCC by default. The standard `-S` and `-c` arguments
work as usual (producing a native `.s` or `.o` file, respectively).
- :::
+ ```
1. Next, compile the C file into an LLVM bitcode file:
```console
diff --git a/llvm/docs/GettingStartedVS.md b/llvm/docs/GettingStartedVS.md
index f70f1157b109a..66b5d7763adef 100644
--- a/llvm/docs/GettingStartedVS.md
+++ b/llvm/docs/GettingStartedVS.md
@@ -120,7 +120,7 @@ These instructions were tested with Visual Studio 2019 and Python 3.9.6:
exit
```
- :::{note}
+ ```{note}
By default, the Visual Studio project files generated by CMake use the
32-bit toolset. If you are developing on a 64-bit version of Windows and
want to use the 64-bit toolset, pass the `-Thost=x64` flag when
@@ -128,7 +128,7 @@ These instructions were tested with Visual Studio 2019 and Python 3.9.6:
For Windows on Arm the equivalent is `-Thost=ARM64`, but this the default
for those hosts, so you do not have to use this option.
- :::
+ ```
`LLVM_ENABLE_PROJECTS` specifies any additional LLVM projects you want to
build while `LLVM_TARGETS_TO_BUILD` selects the compiler targets. If
diff --git a/llvm/docs/GitHub.md b/llvm/docs/GitHub.md
index 717cce12210fa..c08d05a0adc60 100644
--- a/llvm/docs/GitHub.md
+++ b/llvm/docs/GitHub.md
@@ -26,12 +26,12 @@ describes the typical workflow of creating a Pull Request and getting it reviewe
and accepted. This is meant as an overview of the GitHub workflow, for complete
documentation refer to [GitHub's documentation](https://docs.github.com/pull-requests).
-:::{note}
+```{note}
If you are using a Pull Request for purposes other than review
(eg: precommit CI results, convenient web-based reverts, etc)
add the [skip-precommit-approval](https://github.com/llvm/llvm-project/labels?q=skip-precommit-approval)
label to the PR.
-:::
+```
### GitHub Tools
@@ -68,11 +68,11 @@ gh pr create
When prompted select to create and use your own fork and follow
the instructions to add more information needed.
-:::{note}
+```{note}
When you let the GitHub CLI create a fork of llvm-project to
your user, it will change the git "remotes" so that "origin" points
to your fork and "upstream" points to the main llvm-project repository.
-:::
+```
### Updating Pull Requests
@@ -116,11 +116,11 @@ or in some dependent code.
After your PR is reviewed and accepted, you want to rebase your branch to ensure
you won't encounter merge conflicts when landing the PR.
-:::{note}
+```{note}
This guide assumes that the PR branch only has 1 author. If you are
collaborating with others on a single branch, be careful how and when you push
changes. `--force-with-lease` may be useful in this situation.
-:::
+```
### Approvals
@@ -137,7 +137,7 @@ After your PR is approved, ensure that:
messages of commits in the PR will **not** be used.
* You have set a valid email address in your GitHub account, see {ref}`github-email-address`.
-:::{note}
+```{note}
The LLVM Project monorepo on GitHub is configured to always use "Squash
and Merge" as the pull request merge option when using the web interface.
With this option, GitHub uses the PR summary as the default commit
@@ -146,7 +146,7 @@ message.
Users with write access who can merge PRs have a final opportunity to edit
the commit title and message before merging. However, this option is not
available to contributors without write access.
-:::
+```
At this point, you can merge your changes. If you do not have write permissions
for the repository, the merge button in GitHub's web interface will be
@@ -231,7 +231,7 @@ To separate related changes or to break down a larger PR into smaller, reviewabl
pieces, use "stacked pull requests" — this helps make the review process
smoother.
-:::{note}
+```{note}
The LLVM Project monorepo on GitHub is configured to always use "Squash and
Merge" as the pull request merge option. As a result, each PR results in
exactly one commit being merged into the project.
@@ -240,7 +240,7 @@ This means that stacked pull requests are the only available option for
landing a series of related changes. In contrast, submitting a PR with
multiple commits and merging them as-is (without squashing) is not supported
in LLVM.
-:::
+```
While GitHub does not natively support stacked pull requests, there are several
common alternatives.
@@ -288,7 +288,7 @@ Your options are as follows:
stacked PRs. These tools are also based on using user branches
in `llvm/llvm-project`.
-:::{note}
+```{note}
When not using user branches, GitHub will not display proper diffs for
subsequent PRs in a stack. Instead, it will show a combined diff that
includes all commits from earlier PRs.
@@ -299,7 +299,7 @@ For example: “The first N commits are from the base PR.”
You can avoid this issue by using user branches directly in the
`llvm/llvm-project` repository.
-:::
+```
### Using Graphite for stacked Pull Requests
diff --git a/llvm/docs/HowToBuildWithPGO.md b/llvm/docs/HowToBuildWithPGO.md
index 421102a4f6cb9..c6ca3c7f31b49 100644
--- a/llvm/docs/HowToBuildWithPGO.md
+++ b/llvm/docs/HowToBuildWithPGO.md
@@ -141,12 +141,12 @@ In more detailed steps:
From here, you can build whatever targets you need.
- :::{note}
+ ```{note}
You may see warnings about a mismatched profile in the build output. These
are generally harmless. To silence them, you can add
`-DCMAKE_C_FLAGS='-Wno-backend-plugin'
-DCMAKE_CXX_FLAGS='-Wno-backend-plugin'` to your CMake invocation.
- :::
+ ```
Congrats! You now have a Clang built with profile-guided optimizations, and you
can delete all but the final build directory if you'd like.
diff --git a/llvm/docs/HowToCrossCompileLLVM.md b/llvm/docs/HowToCrossCompileLLVM.md
index 5518b8a2aa5bd..d22c054222c74 100644
--- a/llvm/docs/HowToCrossCompileLLVM.md
+++ b/llvm/docs/HowToCrossCompileLLVM.md
@@ -11,11 +11,11 @@ please check <https://clang.llvm.org/docs/CrossCompilation.html>.
This document describes cross-building a compiler in a single stage, using an
existing `clang` install as the host compiler.
-:::{note}
+```{note}
These instructions have been tested for targeting 32-bit ARM, AArch64, or
64-bit RISC-V from an x86_64 Linux host. But should be equally applicable to
any other target.
-:::
+```
## Setting up a sysroot
@@ -198,11 +198,11 @@ InstalledDir: /home/asb/llvm-project/build/aarch64-linux-gnu/bin
## Installing and using
-:::{note}
+```{note}
Use of the `install` target requires that you have set
`CMAKE_INSTALL_PREFIX` otherwise it will attempt to install in
directories under `/` on your host.
-:::
+```
If you want to transfer a copy of the built compiler to another machine, you
can first install it to a location on the host via:
diff --git a/llvm/docs/InstrProfileFormat.md b/llvm/docs/InstrProfileFormat.md
index 336139fefd73f..e09d9992bf907 100644
--- a/llvm/docs/InstrProfileFormat.md
+++ b/llvm/docs/InstrProfileFormat.md
@@ -10,11 +10,11 @@ store instrumented profiles with a specific emphasis on IRPGO use case, in the
sense that when specific header fields and payload sections have different ways
of interpretation across use cases, the documentation is based on IRPGO.
-:::{note}
+```{note}
Frontend-generated profiles are used together with coverage mapping for
[source-based code coverage](https://clang.llvm.org/docs/SourceBasedCodeCoverage.html). The [coverage mapping format](https://llvm.org/docs/CoverageMappingFormat.html) is different from
profile format.
-:::
+```
## Raw Profile Format
@@ -65,11 +65,11 @@ D | Section N |
+----+-----------------------+
```
-:::{note}
+```{note}
Sections might be padded to meet specific alignment requirements. For
simplicity, header fields and data sections solely for padding purposes are
omitted in the data layout graph above and the rest of this document.
-:::
+```
### Header
@@ -115,13 +115,13 @@ It's used jointly with the [CounterPtr](#CounterPtr) field to compute the counte
relative to `start(__llvm_prf_cnts)`. Check out [calculation-of-counter-offset](#calculation-of-counter-offset)
for a visualized explanation.
-:::{note}
+```{note}
The `__llvm_prf_data` object file section might not be loaded into memory
when instrumented binary runs or might not get generated in the instrumented
binary in the first place. In those cases, `CountersDelta` is not used and
other mechanisms are used to match counters with instrumented code. See
[lightweight instrumentation] and [binary profile correlation] for examples.
-:::
+```
**`BitmapDelta`**
This field records the in-memory address difference between the [profile metadata](#profile-metadata)
@@ -186,11 +186,11 @@ counters. Counter position is stored this way (as a link-time constant) to reduc
instrumented binary size compared with snapshotting the address of symbols directly.
See [commit a1532ed](https://github.com/llvm/llvm-project/commit/a1532ed27582038e2d9588108ba0fe8237f01844) for further information.
-:::{note}
+```{note}
`CounterPtr` might represent a different value for non-IRPGO use cases. For
example, for [binary profile correlation], it represents the absolute address of counter.
When in doubt, check source code.
-:::
+```
(BitmapPtr)=
@@ -198,9 +198,9 @@ When in doubt, check source code.
The in-memory address difference between profile data and the start address of
corresponding bitmap.
-:::{note}
+```{note}
Similar to [CounterPtr](#CounterPtr), this field may represent a different value for non-IRPGO use cases.
-:::
+```
**`FunctionPointer`**
Records the function address when instrumented binary runs. This is used to
@@ -215,10 +215,10 @@ the each element in the second dimension is linked list element, carrying
`<profiled-value, count>` as payload. This is used by compiler runtime when
writing out value profiles.
-:::{note}
+```{note}
Value profiling is supported by frontend and IR PGO instrumentation,
but it's not supported in all cases (e.g., [lightweight instrumentation]).
-:::
+```
**`NumCounters`**
The number of counters for the instrumented function.
@@ -399,10 +399,10 @@ payload sections.
+-----------------------+---+
```
-:::{note}
+```{note}
Profile summary section is at the beginning of payload. It's right after the
header so its position is implicitly known after reading the header.
-:::
+```
### Header
@@ -411,11 +411,11 @@ what's in the header. At a high level, `*Offset` fields record section byte
offsets, which are used by readers to locate interesting sections and skip
uninteresting ones.
-:::{note}
+```{note}
To maintain backward compatibility of the indexed profiles, existing fields
shouldn't be deleted from struct definition; the field order shouldn't be
modified. New fields should be appended.
-:::
+```
### Payload Sections
diff --git a/llvm/docs/LangRef.md b/llvm/docs/LangRef.md
index 3a616e8a29fcf..989417d881699 100644
--- a/llvm/docs/LangRef.md
+++ b/llvm/docs/LangRef.md
@@ -840,7 +840,7 @@ and can also be duplicated. Note that a constant with significant address
*can* be merged with a `unnamed_addr` constant, the result being a
constant whose address is significant.
-:::{warning}
+```{warning}
Constant duplication currently makes it unsound to compare pointers
if either may be `unnamed_addr`, because each reference to the
global in the IR may return a different pointer, and optimization
@@ -850,7 +850,7 @@ will return true if the object is the same, which theoretically can
make any usage of `unnamed_addr` unsound, but in practice it is
unlikely that input IR that does not explicitly compare pointers
will be affected by this issue.
-:::
+```
If the `local_unnamed_addr` attribute is given, the address is known to
not be significant within the module.
@@ -4011,7 +4011,7 @@ Likewise, the backend should never split or merge target-legal volatile
load/store instructions. Similarly, IR-level volatile loads and stores cannot
change from integer to floating-point or vice versa.
-:::{admonition} Rationale
+```{admonition} Rationale
Platforms may rely on volatile loads and stores of natively supported
data width to be executed as single instruction. For example, in C
this holds for an l-value of volatile primitive type with native
@@ -4019,7 +4019,7 @@ hardware support, but not necessarily for aggregate types. The
frontend upholds these expectations, which are intentionally
unspecified in the IR. The rules above ensure that IR transformations
do not violate the frontend's contract with the language.
-:::
+```
(memmodel)=
@@ -5262,12 +5262,12 @@ indicates that the user of the value may receive an unspecified
bit-pattern. Undefined values may be of any type (other than '`label`'
or '`void`') and be used anywhere a constant is permitted.
-:::{note}
+```{note}
A '`poison`' value (described in the next section) should be used instead of
'`undef`' whenever possible. Poison values are stronger than undef, and
enable more optimizations. Just the existence of '`undef`' blocks certain
optimizations (see the examples below).
-:::
+```
Undefined values are useful because they indicate to the compiler that
the program is well defined no matter what value is used. This gives the
@@ -6507,10 +6507,10 @@ There are two metadata primitives: strings and nodes. There are
also specialized nodes which have a distinguished name and a set of named
arguments.
-:::{note}
+```{note}
One example application of metadata is source-level debug information,
which is currently the only user of specialized nodes.
-:::
+```
Metadata does not have a type, and is not a value.
@@ -6526,7 +6526,7 @@ type:
- Arguments to certain intrinsic functions, as described in their specification.
- Arguments to the `catchpad`/`cleanuppad` instructions.
-::::{note}
+````{note}
Metadata can be "wrapped" in a `MetadataAsValue` so it can be referenced
in a value context: `MetadataAsValue` is-a `Value`.
@@ -6564,7 +6564,7 @@ And the first element of this `MDTuple` is a `ValueAsMetadata(Value)`:
```llvm
!{i32 1}
```
-::::
+````
(metadata-string)=
@@ -6576,9 +6576,9 @@ contain any character by escaping non-printable characters with
"`\xx`" where "`xx`" is the two digit hex code. For example:
"`!"test\00"`".
-:::{note}
+```{note}
A metadata string is metadata, but is not a metadata node.
-:::
+```
(metadata-node)=
@@ -7196,10 +7196,10 @@ LLVM variable relates to the source language variable.
See {ref}`diexpression` for details.
-:::{note}
+```{note}
`DIExpression`s are always printed and parsed inline; they can never be
referenced by an ID (e.g., `!1`).
-:::
+```
Some examples of expressions:
@@ -11221,10 +11221,10 @@ result of the division and the remainder.)
The '`frem`' instruction returns the remainder from the division of
its two operands.
-:::{note}
+```{note}
The instruction is implemented as a call to libm's '`fmod`'
for some targets, and using the instruction may thus require linking libm.
-:::
+```
##### Arguments:
@@ -16911,10 +16911,10 @@ This is equivalent to the `llvm.sincos.*` intrinsic where the argument has been
multiplied by pi, however, it computes the result more accurately especially
for large input values.
-:::{note}
+```{note}
Currently, the default lowering of this intrinsic relies on the `sincospi[f|l]`
functions being available in the target's runtime (e.g., libc).
-:::
+```
When specified with the fast-math-flag 'afn', the result may be approximated
using a less accurate calculation.
@@ -17476,11 +17476,11 @@ which follow {ref}`LLVM's usual signaling NaN behavior <floatnan>` instead.
The `llvm.minnum` intrinsic can be refined into `llvm.minimumnum`, as the
latter exhibits a subset of behaviors of the former.
-:::{warning}
+```{warning}
If the intrinsic is used without nsz, not all backends currently respect the
specified signed zero ordering. Do not rely on it until this warning has
been removed. See [issue #174730](https://github.com/llvm/llvm-project/issues/174730).
-:::
+```
(i_maxnum)=
@@ -17536,11 +17536,11 @@ which follow {ref}`LLVM's usual signaling NaN behavior <floatnan>` instead.
The `llvm.maxnum` intrinsic can be refined into `llvm.maximumnum`, as the
latter exhibits a subset of behaviors of the former.
-:::{warning}
+```{warning}
If the intrinsic is used without nsz, not all backends currently respect the
specified signed zero ordering. Do not rely on it until this warning has
been removed. See [issue #174730](https://github.com/llvm/llvm-project/issues/174730).
-:::
+```
(i_minimum)=
diff --git a/llvm/docs/Lexicon.md b/llvm/docs/Lexicon.md
index 022e9b5811f38..c28615330718f 100644
--- a/llvm/docs/Lexicon.md
+++ b/llvm/docs/Lexicon.md
@@ -1,8 +1,8 @@
# The LLVM Lexicon
-:::{note}
+```{note}
This document is a work in progress!
-:::
+```
## Definitions
diff --git a/llvm/docs/MIRLangRef.md b/llvm/docs/MIRLangRef.md
index a767d6e2ee239..a8540859e30ca 100644
--- a/llvm/docs/MIRLangRef.md
+++ b/llvm/docs/MIRLangRef.md
@@ -1,9 +1,9 @@
# Machine IR (MIR) Format Reference Manual
-:::{warning}
+```{warning}
This is a work in progress.
-:::
+```
## Introduction
diff --git a/llvm/docs/MemProf.md b/llvm/docs/MemProf.md
index c5a4b8e6ff131..8ba84c3db1b70 100644
--- a/llvm/docs/MemProf.md
+++ b/llvm/docs/MemProf.md
@@ -30,10 +30,10 @@ To enable MemProf instrumentation, compile your application with the `-fmemory-p
clang++ -fmemory-profile -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fno-optimize-sibling-calls -fdebug-info-for-profiling -gmlt -O2 -fno-pie -no-pie -Wl,-z,noseparate-code -Wl,--build-id source.cpp -o app
```
-:::{note}
+```{note}
Link with `-fmemory-profile` as well to link the necessary runtime libraries. If you use a separate link step, ensure the flag is passed to the linker.
On Linux, the flags `-fno-pie -no-pie -Wl,-z,noseparate-code -Wl,--build-id` are currently required to ensure the binary layout (executable segment at offset 0) and Build ID presence are compatible with the `llvm-profdata` profile reader.
-:::
+```
### Running and Generating Profiles
@@ -83,10 +83,10 @@ opt -passes='memprof-use<profile-filename=memprof.memprofdata>' ...
The compiler uses the profile data to annotate allocation instructions with `!memprof` metadata ([MemProf Metadata Documentation](https://llvm.org/docs/LangRef.html#memprof-metadata)), distinguishing between "hot", "cold", and "notcold" allocations. This metadata guides downstream optimizations. Additionally, callsites which are part of allocation contexts are also annotated with `!callsite` metadata ([Callsite Metadata Documentation](https://llvm.org/docs/LangRef.html#callsite-metadata)).
-:::{note}
+```{note}
Ensure that the same debug info flags (e.g. `-gmlt` and `-fdebug-info-for-profiling`) used during instrumentation are also passed during this compilation step to enable correct matching of the profile data.
For the optimized binary to fully utilize the hot/cold hinting, it must be linked with an allocator that supports this mechanism, such as [tcmalloc](https://github.com/google/tcmalloc). TCMalloc provides an API (`tcmalloc::hot_cold_t`) that accepts a hint (0 for cold, 255 for hot) to guide data placement and improve locality. To indicate that the library supports these interfaces, the `-mllvm -supports-hot-cold-new` flag is used during the LTO link.
-:::
+```
### Context Disambiguation (LTO)
@@ -138,7 +138,7 @@ clang++ -fmemory-profile-use=memprof.memprofdata -fpartition-static-data-section
The optimized layout clusters hot static data, improving dTLB and cache efficiency.
-:::{note}
+```{note}
When both PGO profiles and memory profiles are provided (using
`-fprofile-use` and `-fmemory-profile-use`), global variable hotness are
inferred from a combination of PGO profile and data access profile:
@@ -150,7 +150,7 @@ inferred from a combination of PGO profile and data access profile:
profile. Most notably, symbolizable data with external linkage is only
covered by data access profile, and module-internal unsymbolizable data is
only covered by PGO profile.
-:::
+```
## Developer Manual
diff --git a/llvm/docs/Passes.md b/llvm/docs/Passes.md
index 1615d8890bd85..60366dddbd300 100644
--- a/llvm/docs/Passes.md
+++ b/llvm/docs/Passes.md
@@ -11,11 +11,11 @@ LoopFusion
## Introduction
-:::{warning}
+```{warning}
This document is not updated frequently, and the list of passes
is most likely incomplete. It is possible to list passes known by the opt
tool using `opt -print-passes`.
-:::
+```
This document serves as a high-level summary of the optimization features that
LLVM provides. Optimizations are implemented as Passes that traverse some
diff --git a/llvm/docs/ProgrammersManual.md b/llvm/docs/ProgrammersManual.md
index 04d5bb273f686..e704e852c2031 100644
--- a/llvm/docs/ProgrammersManual.md
+++ b/llvm/docs/ProgrammersManual.md
@@ -1,8 +1,8 @@
# LLVM Programmer's Manual
-::::{warning}
+````{warning}
This is always a work in progress.
-::::
+````
(introduction)=
## Introduction
@@ -425,14 +425,14 @@ the program that can handle them appropriately. Handling the error may be
as simple as reporting the issue to the user, or it may involve attempts at
recovery.
-::::{note}
+````{note}
While it would be ideal to use this error handling scheme throughout
LLVM, there are places where this hasn't been practical to apply. In
situations where you absolutely must emit a non-programmatic error and
the `Error` model isn't workable you can call `reportFatalUsageError`,
which will call installed error handlers, print a message, and exit the
program. The use of `reportFatalUsageError` in this case is discouraged.
-::::
+````
Recoverable errors are modeled using LLVM's `Error` scheme. This scheme
represents errors using function return values, similar to classic C integer
error codes, or C++'s `std::error_code`. However, the `Error` class is
@@ -1556,7 +1556,7 @@ to keep `sizeof(SmallVector<T>)` around 64 bytes).
platforms, since it uses `unsigned` (instead of `void*`) for its size
and capacity.
-::::{note}
+````{note}
Prefer to use `ArrayRef<T>` or `SmallVectorImpl<T>` as a parameter type.
It's rarely appropriate to use `SmallVector<T, N>` as a parameter type.
@@ -1592,7 +1592,7 @@ void someFunc2() {
Even though it has "`Impl`" in the name, SmallVectorImpl is widely used
and is no longer "private to the implementation". A name like
`SmallVectorHeader` might be more appropriate.
-::::
+````
(dss_pagedvector)=
#### llvm/ADT/PagedVector.h
diff --git a/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md
index efd33a907cfa7..f8fce847b62f3 100644
--- a/llvm/docs/ReleaseNotes.md
+++ b/llvm/docs/ReleaseNotes.md
@@ -7,12 +7,12 @@ ReleaseNotes.md and ReleaseNotesTemplate.txt. -->
# LLVM {{env.config.release}} Release Notes
-::::{only} PreRelease
-:::{warning} These are in-progress notes for the upcoming LLVM {{env.config.release}}
+````{only} PreRelease
+```{warning} These are in-progress notes for the upcoming LLVM {{env.config.release}}
release. Release notes for previous releases can be found on
[the Download Page](https://releases.llvm.org/download.html).
-:::
-::::
+```
+````
## Introduction
diff --git a/llvm/docs/ReleaseNotesTemplate.txt b/llvm/docs/ReleaseNotesTemplate.txt
index 0f11bc0c7b4f7..d0c4c1edbf5af 100644
--- a/llvm/docs/ReleaseNotesTemplate.txt
+++ b/llvm/docs/ReleaseNotesTemplate.txt
@@ -9,12 +9,12 @@ ReleaseNotes.md and ReleaseNotesTemplate.txt. -->
```{contents}
```
-::::{only} PreRelease
-:::{warning} These are in-progress notes for the upcoming LLVM {{env.config.release}}
+````{only} PreRelease
+```{warning} These are in-progress notes for the upcoming LLVM {{env.config.release}}
release. Release notes for previous releases can be found on
[the Download Page](https://releases.llvm.org/download.html).
-:::
-::::
+```
+````
## Introduction
diff --git a/llvm/docs/Remarks.md b/llvm/docs/Remarks.md
index 6f57e0a689e8d..ca161094108e6 100644
--- a/llvm/docs/Remarks.md
+++ b/llvm/docs/Remarks.md
@@ -59,20 +59,20 @@ Optimization remarks can be emitted as diagnostics. These diagnostics will be
propagated to front-ends if desired, or emitted by tools like {doc}`llc
<CommandGuide/llc>` or {doc}`opt <CommandGuide/opt>`.
-:::{option} -pass-remarks=<regex>
+```{option} -pass-remarks=<regex>
Enables optimization remarks from passes whose name match the given (POSIX)
regular expression.
-:::
+```
-:::{option} -pass-remarks-missed=<regex>
+```{option} -pass-remarks-missed=<regex>
Enables missed optimization remarks from passes whose name match the given
(POSIX) regular expression.
-:::
+```
-:::{option} -pass-remarks-analysis=<regex>
+```{option} -pass-remarks-analysis=<regex>
Enables optimization analysis remarks from passes whose name match the given
(POSIX) regular expression.
-:::
+```
### Serialized remarks
@@ -92,69 +92,69 @@ following options:
`Basic options`
-:::{option} -pass-remarks-output=<filename>
+```{option} -pass-remarks-output=<filename>
Enables the serialization of remarks to a file specified in `<filename>`.
By default, the output is serialized to {ref}`YAML <yamlremarks>`.
-:::
+```
-:::{option} -pass-remarks-format=<format>
+```{option} -pass-remarks-format=<format>
Specifies the output format of the serialized remarks.
Supported formats:
- {ref}`yaml <yamlremarks>` (default)
- {ref}`bitstream <bitstreamremarks>`
-:::
+```
`Content configuration`
-:::{option} -pass-remarks-filter=<regex>
+```{option} -pass-remarks-filter=<regex>
Only passes whose name match the given (POSIX) regular expression will be
serialized to the final output.
-:::
+```
-:::{option} -pass-remarks-with-hotness
+```{option} -pass-remarks-with-hotness
With PGO, include profile count in optimization remarks.
-:::
+```
-:::{option} -pass-remarks-hotness-threshold
+```{option} -pass-remarks-hotness-threshold
The minimum profile count required for an optimization remark to be
emitted.
-:::
+```
Other tools that support remarks:
{program}`llvm-lto`
-:::{option} -lto-pass-remarks-output=<filename>
-:::
+```{option} -lto-pass-remarks-output=<filename>
+```
-:::{option} -lto-pass-remarks-filter=<regex>
-:::
+```{option} -lto-pass-remarks-filter=<regex>
+```
-:::{option} -lto-pass-remarks-format=<format>
-:::
+```{option} -lto-pass-remarks-format=<format>
+```
-:::{option} -lto-pass-remarks-with-hotness
-:::
+```{option} -lto-pass-remarks-with-hotness
+```
-:::{option} -lto-pass-remarks-hotness-threshold
-:::
+```{option} -lto-pass-remarks-hotness-threshold
+```
{program}`gold-plugin` and {program}`lld`
-:::{option} -opt-remarks-filename=<filename>
-:::
+```{option} -opt-remarks-filename=<filename>
+```
-:::{option} -opt-remarks-filter=<regex>
-:::
+```{option} -opt-remarks-filter=<regex>
+```
-:::{option} -opt-remarks-format=<format>
-:::
+```{option} -opt-remarks-format=<format>
+```
-:::{option} -opt-remarks-with-hotness
-:::
+```{option} -opt-remarks-with-hotness
+```
(yamlremarks)=
diff --git a/llvm/docs/SourceLevelDebugging.md b/llvm/docs/SourceLevelDebugging.md
index 1f8ad9a795cff..92921f37981d1 100644
--- a/llvm/docs/SourceLevelDebugging.md
+++ b/llvm/docs/SourceLevelDebugging.md
@@ -131,10 +131,10 @@ which can have a value, including at least:
- Constants
- Formal parameters
-:::{note}
+```{note}
There is no special provision for "true" constants in LLVM today, and
they are instead treated as local or global variables.
-:::
+```
A variable is represented by a {ref}`local variable <dilocalvariable>` or
{ref}`global variable <diglobalvariable>` metadata node.
@@ -149,10 +149,10 @@ The operands of the `DW_OP_LLVM_fragment` operation encode the bit offset of
the fragment relative to the start of the variable, and the size of the
fragment in bits, respectively.
-:::{note}
+```{note}
The `DW_OP_LLVM_fragment` operation acts only to encode the fragment
information, and does not have an effect on the semantics of the expression.
-:::
+```
(format)=
## Debugging information format
@@ -324,10 +324,10 @@ See {doc}`AssignmentTracking` for more info.
### Debugger intrinsic functions
-:::{warning}
+```{warning}
These intrinsics are deprecated, please use {ref}`debug records
<debug_records>` instead. For more details see {doc}`RemoveDIs <RemoveDIsDebugInfo>`.
-:::
+```
(format_common_intrinsics)=
In intrinsic-mode, LLVM uses several intrinsic functions (name prefixed with "`llvm.dbg`") to
@@ -412,13 +412,13 @@ direct value. For example, if the first operand is an indirect value, it may be
necessary to insert `DW_OP_deref` into the `DIExpression` in order to
produce a valid debug record.
-:::{note}
+```{note}
A `DIExpression` is interpreted in the same way regardless of which kind
of debug record it's attached to.
`DIExpression`s are always printed and parsed inline; they can never be
referenced by an ID (e.g. `!1`).
-:::
+```
(dwarf-opcodes)=
#### DWARF Opcodes
@@ -462,11 +462,11 @@ vocabulary is limited, but includes at least:
Where the DWARF equivalent is not suitable, or no DWARF equivalent exists, LLVM
defines internal-only opcodes which have no direct analog in DWARF.
-:::{note}
+```{note}
Some opcodes do not influence the final DWARF expression directly, instead
encoding information logically belonging to the debug records which use
them.
-:::
+```
- `DW_OP_LLVM_fragment, <offset>, <size>` may appear at most once in an
expression, and must be the last opcode. It specifies the bit offset and bit
size of the variable fragment being described by the record or intrinsic
@@ -731,7 +731,7 @@ variable's new location. Compared with the `#dbg_declare` record:
* A `#dbg_value` terminates the effects that any preceding records have on
any common bits of a common variable.
- :::{note}
+ ```{note}
The current implementation generally terminates the effect of every
record in its entirety if any of its effects would be terminated, rather
than carrying forward the effect of previous records for non-overlapping
@@ -741,7 +741,7 @@ variable's new location. Compared with the `#dbg_declare` record:
One exception to this is {doc}`AssignmentTracking` where certain
memory-based locations are carried forward partially in some situations.
- :::
+ ```
* The `#dbg_value`'s position in the IR defines where in the instruction
stream the variable's value changes.
* Operands can be constants, indicating the variable is assigned a
diff --git a/llvm/docs/SphinxQuickstartTemplate.md b/llvm/docs/SphinxQuickstartTemplate.md
index bc9afc686d7f5..1df31aee800d4 100644
--- a/llvm/docs/SphinxQuickstartTemplate.md
+++ b/llvm/docs/SphinxQuickstartTemplate.md
@@ -160,29 +160,6 @@ without any syntax highlighting like this:
```
-## Sphinx Directives
-
-Sphinx directives that contain rich, formatted Markdown content should use
-[colon fences][colon_fence] instead of backtick fences. This keeps directive
-containers visually distinct from code blocks while still allowing normal
-Markdown markup inside the directive.
-
-:::{note}
-Use colon fences for rich directives such as `{note}`, `{warning}`, `{option}`,
-and similar content blocks.
-:::
-
-Prefer triple backtick fences for code regions and literal examples:
-
-```cpp
-int value = 0;
-```
-
-Keep `{eval-rst}` blocks fenced with backticks, because their contents are
-reStructuredText rather than Markdown.
-
-[colon_fence]: https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#syntax-colon-fence
-
## Generating the documentation
You can generate the HTML documentation from the sources locally if you want to
diff --git a/llvm/docs/TestSuiteGuide.md b/llvm/docs/TestSuiteGuide.md
index f4780a7d6c855..cdd5ae72204ab 100644
--- a/llvm/docs/TestSuiteGuide.md
+++ b/llvm/docs/TestSuiteGuide.md
@@ -87,14 +87,14 @@ MicroBenchmarks/XRay microbenchmarks, you need to add `compiler-rt` to your
...
```
-:::{note}
+```{note}
Even when you only want compile-time results you still need to run the test
with the above `llvm-lit` command. In this case, the `results.json` file will
contain compile time metrics only (code size, llvm stats and so on).
This mode is enabled by setting `-DTEST_SUITE_RUN_BENCHMARKS=OFF`,
more details [here](common_configuration_options).
-:::
+```
6. Show and compare result files (optional):
diff --git a/llvm/docs/TestingGuide.md b/llvm/docs/TestingGuide.md
index f3017993d781d..4b034f4851af4 100644
--- a/llvm/docs/TestingGuide.md
+++ b/llvm/docs/TestingGuide.md
@@ -155,10 +155,10 @@ script which is built as part of LLVM. For example, to run the
% llvm-lit <path to llvm-project>/llvm/test/Integer/BitPacked.ll
```
-:::{note}
+```{note}
The test files are in the `llvm-project` directory, not the directory you
are building LLVM in.
-:::
+```
Or you can run a whole folder of tests. To run all of the ARM CodeGen tests:
@@ -435,11 +435,11 @@ For convenience, these are the contents:
For symmetry, `ident.ll` is just a dummy file that doesn't
actually participate in the test besides holding the `RUN:` lines.
-:::{note}
+```{note}
Some existing tests use `RUN: true` in extra files instead of just
putting the extra files in an `Inputs/` directory. This pattern is
deprecated.
-:::
+```
### Elaborated tests
@@ -492,7 +492,7 @@ clang --target=x86_64-linux -S -g a.cc -o -
# content generated by the script 'gen'
```
-:::{note}
+```{note}
Consider specifying an explicit target triple to avoid differences when
regeneration is needed on another machine.
@@ -501,7 +501,7 @@ don't need `-fdebug-compilation-dir=` since its default value is `PWD`.
Check prefixes should be placed before `.endif` since the part after
`.endif` is replaced.
-:::
+```
If the test body contains multiple files, you can print `---` separators and
utilize `split-file` in `RUN` lines.
diff --git a/llvm/docs/WritingAnLLVMNewPMPass.md b/llvm/docs/WritingAnLLVMNewPMPass.md
index 065c6b5bb0238..471214149f939 100644
--- a/llvm/docs/WritingAnLLVMNewPMPass.md
+++ b/llvm/docs/WritingAnLLVMNewPMPass.md
@@ -6,11 +6,11 @@
## Introduction --- What is a pass?
-:::{warning}
+```{warning}
This document deals with the new pass manager. LLVM uses the legacy pass
manager for the codegen pipeline. For more details, see
{doc}`WritingAnLLVMPass` and {doc}`NewPassManager`.
-:::
+```
The LLVM pass framework is an important part of the LLVM system, because LLVM
passes are where most of the interesting parts of the compiler exist. Passes
diff --git a/llvm/docs/WritingAnLLVMPass.md b/llvm/docs/WritingAnLLVMPass.md
index 7d56a546a4dd7..c1cf43d0198d2 100644
--- a/llvm/docs/WritingAnLLVMPass.md
+++ b/llvm/docs/WritingAnLLVMPass.md
@@ -6,13 +6,13 @@
## Introduction --- What is a pass?
-:::{warning}
+```{warning}
This document deals with the legacy pass manager. LLVM uses the new pass
manager for the optimization pipeline (the codegen pipeline
still uses the legacy pass manager), which has its own way of defining
passes. For more details, see {doc}`WritingAnLLVMNewPMPass` and
{doc}`NewPassManager`.
-:::
+```
The LLVM Pass Framework is an important part of the LLVM system, because LLVM
passes are where most of the interesting parts of the compiler exist. Passes
diff --git a/llvm/docs/index.md b/llvm/docs/index.md
index 14a09935f9e9b..e933810197c42 100644
--- a/llvm/docs/index.md
+++ b/llvm/docs/index.md
@@ -1,9 +1,9 @@
# About
-:::{warning}
+```{warning}
If you are using a released version of LLVM, see [the download page]
to find your documentation.
-:::
+```
[the download page]: https://llvm.org/releases/
diff --git a/llvm/include/llvm/CodeGen/CommandFlags.h b/llvm/include/llvm/CodeGen/CommandFlags.h
index c882a33b84a5b..31c08611648a9 100644
--- a/llvm/include/llvm/CodeGen/CommandFlags.h
+++ b/llvm/include/llvm/CodeGen/CommandFlags.h
@@ -137,6 +137,9 @@ LLVM_ABI bool getEnableStaticDataPartitioning();
LLVM_ABI bool getEnableDebugEntryValues();
+LLVM_ABI bool getValueTrackingVariableLocations();
+LLVM_ABI std::optional<bool> getExplicitValueTrackingVariableLocations();
+
LLVM_ABI bool getForceDwarfFrameSection();
LLVM_ABI bool getXRayFunctionIndex();
@@ -205,6 +208,10 @@ LLVM_ABI void setFunctionAttributes(Function &F, StringRef CPU,
LLVM_ABI void setFunctionAttributes(Module &M, StringRef CPU,
StringRef Features, StringRef TuneCPU = "");
+/// Should value-tracking variable locations / instruction referencing be
+/// enabled by default for this triple?
+LLVM_ABI bool getDefaultValueTrackingVariableLocations(const llvm::Triple &T);
+
/// Creates a TargetMachine instance with the options defined on the command
/// line. This can be used for tools that do not need further customization of
/// the TargetOptions.
diff --git a/llvm/include/llvm/CodeGen/SDPatternMatch.h b/llvm/include/llvm/CodeGen/SDPatternMatch.h
index 1affc9a1f6b49..e2e20b14bb7f7 100644
--- a/llvm/include/llvm/CodeGen/SDPatternMatch.h
+++ b/llvm/include/llvm/CodeGen/SDPatternMatch.h
@@ -827,18 +827,6 @@ inline BinaryOpc_match<LHS, RHS, true> m_Add(const LHS &L, const RHS &R) {
return BinaryOpc_match<LHS, RHS, true>(ISD::ADD, L, R);
}
-template <typename LHS, typename RHS>
-inline auto m_NUWAdd(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS, true>(ISD::ADD, L, R,
- SDNodeFlags::NoUnsignedWrap);
-}
-
-template <typename LHS, typename RHS>
-inline auto m_NSWAdd(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS, true>(ISD::ADD, L, R,
- SDNodeFlags::NoSignedWrap);
-}
-
template <typename LHS, typename RHS>
inline BinaryOpc_match<LHS, RHS> m_Sub(const LHS &L, const RHS &R) {
return BinaryOpc_match<LHS, RHS>(ISD::SUB, L, R);
@@ -870,16 +858,6 @@ inline auto m_AddLike(const LHS &L, const RHS &R) {
return m_AnyOf(m_Add(L, R), m_DisjointOr(L, R));
}
-template <typename LHS, typename RHS>
-inline auto m_NSWAddLike(const LHS &L, const RHS &R) {
- return m_AnyOf(m_NSWAdd(L, R), m_DisjointOr(L, R));
-}
-
-template <typename LHS, typename RHS>
-inline auto m_NUWAddLike(const LHS &L, const RHS &R) {
- return m_AnyOf(m_NUWAdd(L, R), m_DisjointOr(L, R));
-}
-
template <typename LHS, typename RHS>
inline BinaryOpc_match<LHS, RHS, true> m_Xor(const LHS &L, const RHS &R) {
return BinaryOpc_match<LHS, RHS, true>(ISD::XOR, L, R);
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h
index e71cf28d31846..6bb1b5a285b16 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h
@@ -13,36 +13,23 @@
#ifndef LLVM_EXECUTIONENGINE_JITLINK_JITLINKDYLIB_H
#define LLVM_EXECUTIONENGINE_JITLINK_JITLINKDYLIB_H
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Support/Compiler.h"
-
#include <string>
-namespace llvm::jitlink {
-
-class JITLinkMemoryManager;
+namespace llvm {
+namespace jitlink {
-/// Represents a JITDylib as seen by JITLink.
-class LLVM_ABI JITLinkDylib {
+class JITLinkDylib {
public:
JITLinkDylib(std::string Name) : Name(std::move(Name)) {}
- ~JITLinkDylib();
-
/// Get the name for this JITLinkDylib.
const std::string &getName() const { return Name; }
- /// Register a JITLinkMemoryManager to be notified when this JITLinkDylib
- /// is destroyed.
- void notifyOnDestruction(JITLinkMemoryManager &MemMgr) {
- ToNotifyOnDestruction.push_back(&MemMgr);
- }
-
private:
std::string Name;
- SmallVector<JITLinkMemoryManager *> ToNotifyOnDestruction;
};
-} // namespace llvm::jitlink
+} // end namespace jitlink
+} // end namespace llvm
#endif // LLVM_EXECUTIONENGINE_JITLINK_JITLINKDYLIB_H
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
index 25638cdada205..10406fe4ec5f6 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
@@ -202,15 +202,6 @@ class LLVM_ABI JITLinkMemoryManager {
Allocs.push_back(std::move(Alloc));
return deallocate(std::move(Allocs));
}
-
- /// Called when a JITLinkDylib that this manager previously registered
- /// with (via JITLinkDylib::notifyOnDestruction) is being destroyed.
- ///
- /// May be used to free resources held on behalf of the JITLinkDylib (e.g.
- /// reserved address ranges). The JITLinkDylib is guaranteed not to make
- /// any further use of those resources after this call returns, so
- /// clean-up may be deferred and completed asynchronously.
- virtual void notifyDestroying(JITLinkDylib &JD) {}
};
/// BasicLayout simplifies the implementation of JITLinkMemoryManagers.
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/CallSPSViaEPC.h b/llvm/include/llvm/ExecutionEngine/Orc/CallSPSViaEPC.h
new file mode 100644
index 0000000000000..c8e4efb20c4c8
--- /dev/null
+++ b/llvm/include/llvm/ExecutionEngine/Orc/CallSPSViaEPC.h
@@ -0,0 +1,95 @@
+//===---- CallSPSViaEPC.h - EPCCalls using SPS serialization ----*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// EPCCalls using SimplePackedSerialization.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_EXECUTIONENGINE_ORC_CALLSPSVIAEPC_H
+#define LLVM_EXECUTIONENGINE_ORC_CALLSPSVIAEPC_H
+
+#include "llvm/ExecutionEngine/Orc/CallViaEPC.h"
+#include "llvm/ExecutionEngine/Orc/CallableTraitsHelper.h"
+#include "llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h"
+
+namespace llvm::orc {
+
+namespace detail {
+template <typename SPSRetT, typename... SPSArgTs>
+struct SPSCallSerializationImpl {
+ using RetSerialization = shared::SPSArgList<SPSRetT>;
+ using ArgSerialization = shared::SPSArgList<SPSArgTs...>;
+
+ template <typename... ArgTs>
+ Expected<shared::WrapperFunctionBuffer> serialize(ArgTs &&...Args) {
+ auto Buffer = shared::WrapperFunctionBuffer::allocate(
+ ArgSerialization::size(Args...));
+ shared::SPSOutputBuffer OB(Buffer.data(), Buffer.size());
+ if (!ArgSerialization::serialize(OB, Args...))
+ return make_error<StringError>("Could not serialize arguments",
+ inconvertibleErrorCode());
+ return std::move(Buffer);
+ }
+};
+
+template <typename SPSSig>
+struct SPSCallSerialization
+ : public CallableTraitsHelper<detail::SPSCallSerializationImpl, SPSSig> {};
+
+} // namespace detail
+
+/// SPS serialization for non-void calls.
+template <typename SPSSig>
+struct SPSCallSerializer : public detail::SPSCallSerialization<SPSSig> {
+
+ template <typename RetT>
+ Expected<RetT> deserialize(shared::WrapperFunctionBuffer ResultBytes) {
+ using RetDeserialization =
+ typename detail::SPSCallSerialization<SPSSig>::RetSerialization;
+ shared::SPSInputBuffer IB(ResultBytes.data(), ResultBytes.size());
+ RetT ReturnValue;
+ if (!RetDeserialization::deserialize(IB, ReturnValue))
+ return make_error<StringError>("Could not deserialize return value",
+ inconvertibleErrorCode());
+ return ReturnValue;
+ }
+};
+
+/// SPS serialization for void calls.
+template <typename... SPSArgTs>
+struct SPSCallSerializer<void(SPSArgTs...)>
+ : public detail::SPSCallSerialization<void(SPSArgTs...)> {
+ template <typename RetT>
+ std::enable_if_t<std::is_void_v<RetT>, Error>
+ deserialize(shared::WrapperFunctionBuffer ResultBytes) {
+ if (!ResultBytes.empty())
+ return make_error<StringError>("Could not deserialize return value",
+ inconvertibleErrorCode());
+ return Error::success();
+ }
+};
+
+template <typename SPSSig>
+class SPSEPCCaller : public EPCCaller<SPSCallSerializer<SPSSig>> {
+public:
+ SPSEPCCaller(ExecutorProcessControl &EPC)
+ : EPCCaller<SPSCallSerializer<SPSSig>>(EPC, SPSCallSerializer<SPSSig>()) {
+ }
+};
+
+template <typename SPSSig>
+class SPSEPCCall : public EPCCall<SPSCallSerializer<SPSSig>> {
+public:
+ SPSEPCCall(ExecutorProcessControl &EPC, ExecutorSymbolDef Fn)
+ : EPCCall<SPSCallSerializer<SPSSig>>(EPC, SPSCallSerializer<SPSSig>(),
+ std::move(Fn)) {}
+};
+
+} // namespace llvm::orc
+
+#endif // LLVM_EXECUTIONENGINE_ORC_CALLSPSVIAEPC_H
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/CallViaEPC.h b/llvm/include/llvm/ExecutionEngine/Orc/CallViaEPC.h
new file mode 100644
index 0000000000000..296c234f315bc
--- /dev/null
+++ b/llvm/include/llvm/ExecutionEngine/Orc/CallViaEPC.h
@@ -0,0 +1,153 @@
+//===------ CallViaEPC.h - Call wrapper functions via EPC -------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Call executor functions with common signatures via
+// ExecutorProcessControl::callWrapperAsync.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_EXECUTIONENGINE_ORC_CALLVIAEPC_H
+#define LLVM_EXECUTIONENGINE_ORC_CALLVIAEPC_H
+
+#include "llvm/ExecutionEngine/Orc/CallableTraitsHelper.h"
+#include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
+#include "llvm/Support/Error.h"
+#include "llvm/Support/MSVCErrorWorkarounds.h"
+
+#include <type_traits>
+
+namespace llvm::orc {
+
+namespace detail {
+
+template <typename HandlerArgT> struct CallViaEPCRetValueTraits;
+
+template <typename RetT> struct CallViaEPCRetValueTraits<Expected<RetT>> {
+ using value_type = RetT;
+};
+
+template <> struct CallViaEPCRetValueTraits<Error> {
+ using value_type = void;
+};
+
+template <typename RetT> struct CallViaEPCRetValueTraits<MSVCPExpected<RetT>> {
+ using value_type = RetT;
+};
+
+template <> struct CallViaEPCRetValueTraits<MSVCPError> {
+ using value_type = void;
+};
+
+// Helper to extract the argument type from a handler callable.
+template <typename HandlerT> struct CallViaEPCHandlerTraits {
+ using ArgInfo = CallableArgInfo<HandlerT>;
+ using ArgsTuple = typename ArgInfo::ArgsTupleType;
+ static_assert(std::tuple_size_v<ArgsTuple> == 1,
+ "Handler must take exactly one argument");
+ using HandlerArgT = std::tuple_element_t<0, ArgsTuple>;
+ using RetT = typename CallViaEPCRetValueTraits<
+ std::remove_cv_t<std::remove_reference_t<HandlerArgT>>>::value_type;
+};
+
+} // namespace detail
+
+/// Call a wrapper function via EPC asynchronously.
+template <typename HandlerFn, typename Serializer, typename... ArgTs>
+std::enable_if_t<std::is_invocable_v<HandlerFn, Error>>
+callViaEPC(HandlerFn &&H, ExecutorProcessControl &EPC, Serializer S,
+ ExecutorSymbolDef Fn, ArgTs &&...Args) {
+ using RetT = typename detail::CallViaEPCHandlerTraits<HandlerFn>::RetT;
+
+ if (auto ArgBytes = S.serialize(std::forward<ArgTs>(Args)...))
+ EPC.callWrapperAsync(
+ Fn.getAddress(),
+ [S = std::move(S), H = std::forward<HandlerFn>(H)](
+ shared::WrapperFunctionBuffer R) mutable {
+ if (const char *ErrMsg = R.getOutOfBandError())
+ H(make_error<StringError>(ErrMsg, inconvertibleErrorCode()));
+ else
+ H(S.template deserialize<RetT>(std::move(R)));
+ },
+ {ArgBytes->data(), ArgBytes->size()});
+ else
+ H(ArgBytes.takeError());
+}
+
+/// Call a wrapper function via EPC synchronously using the given promise.
+///
+/// This performs a blocking call by making an asynchronous call to set the
+/// promise and waiting on a future.
+///
+/// Blocking calls should only be used for convenience by ORC clients, never
+/// internally.
+template <typename PromiseT, typename Serializer, typename... ArgTs>
+std::enable_if_t<!std::is_invocable_v<PromiseT, Error>,
+ decltype(std::declval<PromiseT>().get_future().get())>
+callViaEPC(PromiseT &&P, ExecutorProcessControl &EPC, Serializer S,
+ ExecutorSymbolDef Fn, ArgTs &&...Args) {
+ auto F = P.get_future();
+ using RetT = decltype(F.get());
+ callViaEPC([P = std::move(P)](RetT R) mutable { P.set_value(std::move(R)); },
+ EPC, std::move(S), std::move(Fn), std::forward<ArgTs>(Args)...);
+ return F.get();
+}
+
+/// Encapsulates calls via EPC to any function that's compatible with the given
+/// serialization scheme.
+template <typename Serializer> class EPCCaller {
+public:
+ EPCCaller(ExecutorProcessControl &EPC, Serializer &&S)
+ : EPC(EPC), S(std::move(S)) {}
+
+ // TODO: Add an ExecutionSession constructor once ExecutionSession has been
+ // moved to its own header.
+
+ // Make a call to the given function using callViaEPC.
+ //
+ // The PromiseOrHandlerT value is forwarded. Its type will determine both the
+ // return value type and the dispatch method (asynchronous vs synchronous).
+ template <typename PromiseOrHandlerT, typename... ArgTs>
+ decltype(auto) operator()(PromiseOrHandlerT &&R, ExecutorSymbolDef Fn,
+ ArgTs &&...Args) {
+ return callViaEPC(std::forward<PromiseOrHandlerT>(R), EPC, S, Fn,
+ std::forward<ArgTs>(Args)...);
+ }
+
+private:
+ ExecutorProcessControl &EPC;
+ Serializer S;
+};
+
+/// Encapsulates calls via EPC to a specific function, using the given
+/// serialization scheme.
+template <typename Serializer> class EPCCall {
+public:
+ EPCCall(ExecutorProcessControl &EPC, Serializer &&S, ExecutorSymbolDef Fn)
+ : Caller(EPC, std::move(S)), Fn(std::move(Fn)) {}
+
+ // TODO: Add an ExecutionSession constructor once ExecutionSession has been
+ // moved to its own header.
+
+ // Make a call using callViaEPC.
+ //
+ // The PromiseOrHandlerT value is forwarded. Its type will determine both the
+ // return value type and the dispatch method (asynchronous vs synchronous).
+ template <typename PromiseOrHandlerT, typename... ArgTs>
+ decltype(auto) operator()(PromiseOrHandlerT &&R, ArgTs &&...Args) {
+ return Caller(std::forward<PromiseOrHandlerT>(R), Fn,
+ std::forward<ArgTs>(Args)...);
+ }
+
+private:
+ EPCCaller<Serializer> Caller;
+ ExecutorSymbolDef Fn;
+};
+
+} // namespace llvm::orc
+
+#endif // LLVM_EXECUTIONENGINE_ORC_CALLVIAEPC_H
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/CallableTraitsHelper.h b/llvm/include/llvm/ExecutionEngine/Orc/CallableTraitsHelper.h
new file mode 100644
index 0000000000000..11bafa9745693
--- /dev/null
+++ b/llvm/include/llvm/ExecutionEngine/Orc/CallableTraitsHelper.h
@@ -0,0 +1,74 @@
+//===- CallableTraitsHelper.h - Callable arg/ret type extractor -*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// CallableTraitsHelper API.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_EXECUTIONENGINE_ORC_CALLABLETRAITSHELPER_H
+#define LLVM_EXECUTIONENGINE_ORC_CALLABLETRAITSHELPER_H
+
+#include <tuple>
+#include <type_traits>
+
+namespace llvm::orc {
+
+/// CallableTraitsHelper takes an implementation class template Impl and some
+/// callable type C and passes the return and argument types of C to the Impl
+/// class template.
+///
+/// This can be used to simplify the implementation of classes that need to
+/// operate on callable types.
+template <template <typename...> typename ImplT, typename C>
+struct CallableTraitsHelper
+ : public CallableTraitsHelper<
+ ImplT,
+ decltype(&std::remove_cv_t<std::remove_reference_t<C>>::operator())> {
+};
+
+template <template <typename...> typename ImplT, typename RetT,
+ typename... ArgTs>
+struct CallableTraitsHelper<ImplT, RetT(ArgTs...)>
+ : public ImplT<RetT, ArgTs...> {};
+
+template <template <typename...> typename ImplT, typename RetT,
+ typename... ArgTs>
+struct CallableTraitsHelper<ImplT, RetT (*)(ArgTs...)>
+ : public CallableTraitsHelper<ImplT, RetT(ArgTs...)> {};
+
+template <template <typename...> typename ImplT, typename RetT,
+ typename... ArgTs>
+struct CallableTraitsHelper<ImplT, RetT (&)(ArgTs...)>
+ : public CallableTraitsHelper<ImplT, RetT(ArgTs...)> {};
+
+template <template <typename...> typename ImplT, typename ClassT, typename RetT,
+ typename... ArgTs>
+struct CallableTraitsHelper<ImplT, RetT (ClassT::*)(ArgTs...)>
+ : public CallableTraitsHelper<ImplT, RetT(ArgTs...)> {};
+
+template <template <typename...> typename ImplT, typename ClassT, typename RetT,
+ typename... ArgTs>
+struct CallableTraitsHelper<ImplT, RetT (ClassT::*)(ArgTs...) const>
+ : public CallableTraitsHelper<ImplT, RetT(ArgTs...)> {};
+
+namespace detail {
+template <typename RetT, typename... ArgTs> struct CallableArgInfoImpl {
+ using ReturnType = RetT;
+ using ArgsTupleType = std::tuple<ArgTs...>;
+};
+} // namespace detail
+
+/// CallableArgInfo provides typedefs for the return type and argument types
+/// (as a tuple) of the given callable type.
+template <typename Callable>
+struct CallableArgInfo
+ : public CallableTraitsHelper<detail::CallableArgInfoImpl, Callable> {};
+
+} // namespace llvm::orc
+
+#endif // LLVM_EXECUTIONENGINE_ORC_CALLABLETRAITSHELPER_H
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/RTBridge/Calls.h b/llvm/include/llvm/ExecutionEngine/Orc/RTBridge/Calls.h
new file mode 100644
index 0000000000000..1a273b0f3c0fb
--- /dev/null
+++ b/llvm/include/llvm/ExecutionEngine/Orc/RTBridge/Calls.h
@@ -0,0 +1,131 @@
+//===------- Calls.h - Runtime-agnostic executor call APIs ------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Runtime-agnostic interfaces for invoking executor-side operations. These
+// abstract over how a call reaches the executor, so clients can be written
+// once and used whether the operation is provided by a full ORC runtime or by
+// LLVM's own ORC-runtime-lite. Concrete implementations live in subdirectories
+// (e.g. RTBridge/SPS).
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_CALLS_H
+#define LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_CALLS_H
+
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/FunctionExtras.h"
+#include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
+#include "llvm/Support/Error.h"
+#include "llvm/Support/MSVCErrorWorkarounds.h"
+
+#include <cstdint>
+#include <future>
+#include <string>
+#include <type_traits>
+
+namespace llvm::orc {
+
+class ExecutionSession;
+
+namespace rt {
+
+template <typename FnT> class Caller;
+
+/// Runtime-agnostic interface for invoking an executor-side operation with the
+/// signature RetT(ArgTs...).
+///
+/// Two call operators are provided: an asynchronous form that delivers the
+/// result to an OnComplete continuation, and a synchronous form that blocks
+/// until the result is available.
+///
+/// A Caller abstracts over how the operation is dispatched to the executor.
+/// Concrete implementations (e.g. rt::sps::Caller) supply the dispatch
+/// mechanism.
+template <typename RetT, typename... ArgTs> class Caller<RetT(ArgTs...)> {
+public:
+ using FnType = RetT(ArgTs...);
+
+ /// The result type produced by the executor-side function itself.
+ using CalleeRetT = RetT;
+
+ /// The result type delivered to callers: Expected<RetT>, or Error when RetT
+ /// is void, so that dispatch failures can be reported alongside the result.
+ using ErrorRetT =
+ std::conditional_t<std::is_void_v<RetT>, Error, Expected<RetT>>;
+
+ Caller(ExecutionSession &ES, ExecutorAddr CalleeAddr)
+ : ES(ES), CalleeAddr(CalleeAddr) {}
+
+ virtual ~Caller() = default;
+
+ /// Returns the ExecutionSession on which this call will be made.
+ ExecutionSession &executionSession() const { return ES; }
+
+ /// Returns the address of the callee in the executor.
+ const ExecutorAddr &calleeAddr() const { return CalleeAddr; }
+
+ /// Evaluates to true if the callee is non-null.
+ explicit operator bool() const { return !!CalleeAddr; }
+
+ /// Asynchronously invoke the operation with the given Args, delivering its
+ /// result (or an error) to OnComplete.
+ virtual void operator()(unique_function<void(ErrorRetT)> OnComplete,
+ ArgTs... Args) = 0;
+
+ /// Invoke the operation with the given Args, blocking until its result (or an
+ /// error) is available.
+ ErrorRetT operator()(ArgTs... Args) {
+ using PromiseValT = std::conditional_t<std::is_void_v<RetT>, MSVCPError,
+ MSVCPExpected<RetT>>;
+ std::promise<PromiseValT> P;
+ auto F = P.get_future();
+ this->operator()(
+ [P = std::move(P)](ErrorRetT R) mutable { P.set_value(std::move(R)); },
+ std::move(Args)...);
+ return F.get();
+ }
+
+private:
+ ExecutionSession &ES;
+ ExecutorAddr CalleeAddr;
+};
+
+/// Runtime-agnostic interface for running a main-like function
+/// (int(int argc, char *argv[])) in the executor.
+///
+/// The function to run is given by its ExecutorAddr, its arguments as an
+/// argument vector, and its int64_t result is returned.
+using MainCaller = Caller<int64_t(ExecutorAddr, ArrayRef<std::string>)>;
+
+/// Runtime-agnostic interface for running a void() function in the executor.
+///
+/// The function to run is given by its ExecutorAddr.
+///
+/// WARNING: This Caller is experimental and may be removed.
+using VoidVoidCaller = Caller<void(ExecutorAddr)>;
+
+/// Runtime-agnostic interface for running an int32_t() function in the
+/// executor.
+///
+/// The function to run is given by its ExecutorAddr.
+///
+/// WARNING: This Caller is experimental and may be removed.
+using Int32VoidCaller = Caller<int32_t(ExecutorAddr)>;
+
+/// Runtime-agnostic interface for running an int32_t(int32_t) function in the
+/// executor.
+///
+/// The function to run is given by its ExecutorAddr.
+///
+/// WARNING: This Caller is experimental and may be removed.
+using Int32Int32Caller = Caller<int32_t(ExecutorAddr, int32_t)>;
+
+} // namespace rt
+} // namespace llvm::orc
+
+#endif // LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_CALLS_H
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/RTBridge/Proxy.h b/llvm/include/llvm/ExecutionEngine/Orc/RTBridge/Proxy.h
deleted file mode 100644
index 0793189cd9cb4..0000000000000
--- a/llvm/include/llvm/ExecutionEngine/Orc/RTBridge/Proxy.h
+++ /dev/null
@@ -1,206 +0,0 @@
-//===------- Proxy.h - Runtime-agnostic executor call APIs ------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// Runtime-agnostic interfaces for invoking executor-side operations. These
-// abstract over how a call reaches the executor, so clients can be written
-// once and used whether the operation is provided by a full ORC runtime or by
-// LLVM's own ORC-runtime-lite. Concrete implementations live in subdirectories
-// (e.g. RTBridge/SPS).
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_PROXY_H
-#define LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_PROXY_H
-
-#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/FunctionExtras.h"
-#include "llvm/ExecutionEngine/Orc/Core.h"
-#include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
-#include "llvm/Support/Error.h"
-#include "llvm/Support/MSVCErrorWorkarounds.h"
-
-#include <cstdint>
-#include <future>
-#include <string>
-#include <type_traits>
-
-namespace llvm::orc::rt {
-
-class ProxyBase {
-public:
- ProxyBase() = default;
- ProxyBase(ExecutorAddr CalleeAddr) : CalleeAddr(CalleeAddr) {}
-
- /// Returns the address of the callee in the executor.
- const ExecutorAddr &calleeAddr() const { return CalleeAddr; }
-
- /// Evaluates to true if the callee is non-null.
- explicit operator bool() const { return !!CalleeAddr; }
-
-private:
- ExecutorAddr CalleeAddr;
-};
-
-template <typename FnT> class Proxy;
-
-/// Runtime-agnostic interface for invoking an executor-side operation with the
-/// signature RetT(ArgTs...).
-///
-/// Two call operators are provided: an asynchronous form that delivers the
-/// result to an OnComplete continuation, and a synchronous form that blocks
-/// until the result is available.
-///
-/// A Proxy abstracts over how the operation is dispatched to the executor. Its
-/// dispatch function is supplied by a spec (e.g. rt::sps::ProxySpec).
-template <typename RetT, typename... ArgTs>
-class Proxy<RetT(ArgTs...)> : public ProxyBase {
-public:
- using FnType = RetT(ArgTs...);
-
- /// The result type produced by the executor-side function itself.
- using CalleeRetT = RetT;
-
- /// The result type delivered to the client: Expected<RetT>, or Error when
- /// RetT is void, so that dispatch failures can be reported alongside the
- /// result.
- using ErrorRetT =
- std::conditional_t<std::is_void_v<RetT>, Error, Expected<RetT>>;
-
- using DispatchFn = void (*)(unique_function<void(ErrorRetT)> OnComplete,
- ExecutionSession &ES, ExecutorAddr Callee,
- const ArgTs &...Args);
-
- Proxy() = default;
- Proxy(DispatchFn Dispatch, ExecutorAddr CalleeAddr)
- : ProxyBase(CalleeAddr), Dispatch(Dispatch) {}
-
- static Expected<Proxy> Create(DispatchFn Dispatch, JITDylib &JD,
- StringRef Name, SymbolLookupFlags LF) {
- auto &ES = JD.getExecutionSession();
- if (auto CalleeSyms = ES.lookup(makeJITDylibSearchOrder(&JD),
- SymbolLookupSet{ES.intern(Name), LF})) {
- if (!CalleeSyms->empty())
- return Proxy(Dispatch, CalleeSyms->begin()->second.getAddress());
- assert(LF == SymbolLookupFlags::WeaklyReferencedSymbol);
- return Proxy();
- } else
- return CalleeSyms.takeError();
- }
-
- static Expected<Proxy> Create(DispatchFn Dispatch, ExecutionSession &ES,
- StringRef Name, SymbolLookupFlags LF) {
- return Create(Dispatch, ES.getBootstrapJITDylib(), Name, LF);
- }
-
- /// Asynchronously invoke the operation with the given Args, delivering its
- /// result (or an error) to OnComplete.
- void operator()(unique_function<void(ErrorRetT)> OnComplete,
- ExecutionSession &ES, const ArgTs &...Args) const {
- assert(Dispatch && "Proxy's Dispatch member is not set");
- Dispatch(std::move(OnComplete), ES, calleeAddr(), Args...);
- }
-
- /// Invoke the operation with the given Args, blocking until its result (or an
- /// error) is available.
- ErrorRetT operator()(ExecutionSession &ES, const ArgTs &...Args) const {
- using PromiseValT = std::conditional_t<std::is_void_v<RetT>, MSVCPError,
- MSVCPExpected<RetT>>;
- std::promise<PromiseValT> P;
- auto F = P.get_future();
- this->operator()(
- [P = std::move(P)](ErrorRetT R) mutable { P.set_value(std::move(R)); },
- ES, Args...);
- return F.get();
- }
-
-private:
- DispatchFn Dispatch = nullptr;
-};
-
-template <typename FnT> struct ProxyInit {
- Proxy<FnT> *P = nullptr;
- typename Proxy<FnT>::DispatchFn Dispatch = nullptr;
- StringRef Name;
- SymbolLookupFlags LookupFlags = SymbolLookupFlags::RequiredSymbol;
-};
-
-template <typename FnT>
-ProxyInit<FnT>
-proxyInit(Proxy<FnT> *P, typename Proxy<FnT>::DispatchFn Dispatch,
- StringRef Name,
- SymbolLookupFlags LookupFlags = SymbolLookupFlags::RequiredSymbol) {
- return {P, Dispatch, Name, LookupFlags};
-}
-
-template <typename ProxySpecT, typename FnT>
-ProxyInit<FnT>
-proxyInit(Proxy<FnT> *P,
- SymbolLookupFlags LookupFlags = SymbolLookupFlags::RequiredSymbol) {
- return {P, ProxySpecT::dispatch, ProxySpecT::Name, LookupFlags};
-}
-
-template <typename ProxySpecT, typename FnT>
-ProxyInit<FnT>
-proxyInit(Proxy<FnT> *P, StringRef Name,
- SymbolLookupFlags LookupFlags = SymbolLookupFlags::RequiredSymbol) {
- return {P, ProxySpecT::dispatch, Name, LookupFlags};
-}
-
-/// buildProxies base case.
-inline Error buildProxies(JITDylib &JD) { return Error::success(); }
-
-/// buildProxies: Given an ExecutionSession, use BootstrapJITDylib.
-template <typename... FnTs>
-Error buildProxies(ExecutionSession &ES, ProxyInit<FnTs>... PIs) {
- return buildProxies(ES.getBootstrapJITDylib(), PIs...);
-}
-
-/// Build a sequence of proxies from their respective specs.
-template <typename FnT, typename... FnTs>
-Error buildProxies(JITDylib &JD, ProxyInit<FnT> PI, ProxyInit<FnTs>... PIs) {
- if (auto POrErr =
- Proxy<FnT>::Create(PI.Dispatch, JD, PI.Name, PI.LookupFlags))
- *PI.P = std::move(*POrErr);
- else
- return POrErr.takeError();
- return buildProxies(JD, PIs...);
-}
-
-/// Runtime-agnostic interface for running a main-like function
-/// (int(int argc, char *argv[])) in the executor.
-///
-/// The function to run is given by its ExecutorAddr, its arguments as an
-/// argument vector, and its int64_t result is returned.
-using CallMainProxy = Proxy<int64_t(ExecutorAddr, ArrayRef<std::string>)>;
-
-/// Runtime-agnostic interface for running a void() function in the executor.
-///
-/// The function to run is given by its ExecutorAddr.
-///
-/// WARNING: This Proxy is experimental and may be removed.
-using CallVoidVoidProxy = Proxy<void(ExecutorAddr)>;
-
-/// Runtime-agnostic interface for running an int32_t() function in the
-/// executor.
-///
-/// The function to run is given by its ExecutorAddr.
-///
-/// WARNING: This Proxy is experimental and may be removed.
-using CallInt32VoidProxy = Proxy<int32_t(ExecutorAddr)>;
-
-/// Runtime-agnostic interface for running an int32_t(int32_t) function in the
-/// executor.
-///
-/// The function to run is given by its ExecutorAddr.
-///
-/// WARNING: This Proxy is experimental and may be removed.
-using CallInt32Int32Proxy = Proxy<int32_t(ExecutorAddr, int32_t)>;
-
-} // namespace llvm::orc::rt
-
-#endif // LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_PROXY_H
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/RTBridge/SPS/Calls.h b/llvm/include/llvm/ExecutionEngine/Orc/RTBridge/SPS/Calls.h
new file mode 100644
index 0000000000000..8269cc34a37e2
--- /dev/null
+++ b/llvm/include/llvm/ExecutionEngine/Orc/RTBridge/SPS/Calls.h
@@ -0,0 +1,143 @@
+//===------------- Calls.h - SPS-based Call Wrappers ------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// SPS-based implementations of the RTBridge caller interfaces.
+//
+// These implement the rt::Caller interfaces by invoking executor-side wrapper
+// functions in the runtime's controller interface, using Simple Packed
+// Serialization to encode arguments and decode results.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_SPS_CALLS_H
+#define LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_SPS_CALLS_H
+
+#include "llvm/ExecutionEngine/Orc/Core.h"
+#include "llvm/ExecutionEngine/Orc/RTBridge/Calls.h"
+#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
+
+namespace llvm::orc::rt::sps {
+
+/// Implements the rt::Caller interface BaseT by calling an executor-side SPS
+/// wrapper function, using SPSSigT to encode the arguments and decode the
+/// result.
+///
+/// The wrapper is a controller-interface (CI) entry point named CIName: a
+/// wrapper function (byte blob in, byte blob out) that the runtime exposes to
+/// the controller. SPSSigT is the Simple Packed Serialization signature used to
+/// encode the argument blob and decode the result blob; it must be compatible
+/// with BaseT's FnType. CIName must have static storage duration (e.g. an
+/// inline constexpr char[]).
+///
+/// The FnType parameter is deduced from BaseT and should not be supplied
+/// explicitly; the primary template is left undefined so that only the
+/// RetT(ArgTs...) specialization can be instantiated.
+template <typename BaseT, typename SPSSigT, const char *CINameV,
+ typename FnType = typename BaseT::FnType>
+class Caller;
+
+template <typename BaseT, typename SPSSigT, const char *CINameV, typename RetT,
+ typename... ArgTs>
+class Caller<BaseT, SPSSigT, CINameV, RetT(ArgTs...)> : public BaseT {
+ using CalleeRetT = typename BaseT::CalleeRetT;
+ using ErrorRetT = typename BaseT::ErrorRetT;
+
+public:
+ /// Name of the controller-interface wrapper this caller targets.
+ static constexpr const char *CIName = CINameV;
+
+ using BaseT::BaseT;
+ using BaseT::operator();
+
+ /// Look the wrapper up in the executor's bootstrap JITDylib and build a
+ /// caller for it.
+ static Expected<Caller>
+ Create(ExecutionSession &ES,
+ SymbolLookupFlags SLF = SymbolLookupFlags::RequiredSymbol,
+ const char *Name = CIName) {
+ if (auto CalleeSyms =
+ ES.lookup(makeJITDylibSearchOrder(&ES.getBootstrapJITDylib()),
+ SymbolLookupSet{ES.intern(Name), SLF})) {
+ if (!CalleeSyms->empty())
+ return Caller(ES, CalleeSyms->begin()->second.getAddress());
+ assert(SLF == SymbolLookupFlags::WeaklyReferencedSymbol);
+ return Caller(ES, ExecutorAddr());
+ } else
+ return CalleeSyms.takeError();
+ }
+
+ /// Asynchronously call the SPS wrapper at CalleeAddr with the given Args,
+ /// delivering the result (or an error) to OnComplete. Serialization failures
+ /// are reported through OnComplete's error channel.
+ static void callAsync(unique_function<void(ErrorRetT)> OnComplete,
+ ExecutionSession &ES, ExecutorAddr CalleeAddr,
+ const ArgTs &...Args) {
+ using namespace llvm::orc::shared;
+ if constexpr (std::is_void_v<CalleeRetT>) {
+ // Void result: the executor-side function produces no value, so the only
+ // thing to report is the dispatch error (success if the call ran).
+ ES.callSPSWrapperAsync<SPSSigT>(
+ CalleeAddr,
+ [OnComplete = std::move(OnComplete)](Error SerErr) mutable {
+ OnComplete(std::move(SerErr));
+ },
+ Args...);
+ } else {
+ ES.callSPSWrapperAsync<SPSSigT>(
+ CalleeAddr,
+ [OnComplete = std::move(OnComplete)](Error SerErr,
+ CalleeRetT Result) mutable {
+ if (SerErr)
+ return OnComplete(std::move(SerErr));
+ else
+ return OnComplete(std::move(Result));
+ },
+ Args...);
+ }
+ }
+
+ void operator()(unique_function<void(ErrorRetT)> OnComplete,
+ ArgTs... Args) override {
+ callAsync(std::move(OnComplete), this->executionSession(),
+ this->calleeAddr(), Args...);
+ }
+};
+
+using CallMainSPSSig = int64_t(shared::SPSExecutorAddr,
+ shared::SPSSequence<shared::SPSString>);
+inline constexpr char CallMainCIName[] = "orc_rt_ci_sps_call_main";
+/// SPS caller for rt::MainCaller: runs a main-like function
+/// (int(int argc, char *argv[])) in the executor.
+using MainCaller = Caller<rt::MainCaller, CallMainSPSSig, CallMainCIName>;
+
+using CallVoidVoidSPSSig = void(shared::SPSExecutorAddr);
+inline constexpr char CallVoidVoidCIName[] = "orc_rt_ci_sps_call_void_void";
+/// SPS caller for rt::VoidVoidCaller: runs a void() function in the executor.
+/// WARNING: This Caller is experimental and may be removed.
+using VoidVoidCaller =
+ Caller<rt::VoidVoidCaller, CallVoidVoidSPSSig, CallVoidVoidCIName>;
+
+using CallInt32VoidSPSSig = int32_t(shared::SPSExecutorAddr);
+inline constexpr char CallInt32VoidCIName[] = "orc_rt_ci_sps_call_int32_void";
+/// SPS caller for rt::Int32VoidCaller: runs an int32_t() function in the
+/// executor.
+/// WARNING: This Caller is experimental and may be removed.
+using Int32VoidCaller =
+ Caller<rt::Int32VoidCaller, CallInt32VoidSPSSig, CallInt32VoidCIName>;
+
+using CallInt32Int32SPSSig = int32_t(shared::SPSExecutorAddr, int32_t);
+inline constexpr char CallInt32Int32CIName[] = "orc_rt_ci_sps_call_int32_int32";
+/// SPS caller for rt::Int32Int32Caller: runs an int32_t(int32_t) function in
+/// the executor.
+/// WARNING: This Caller is experimental and may be removed.
+using Int32Int32Caller =
+ Caller<rt::Int32Int32Caller, CallInt32Int32SPSSig, CallInt32Int32CIName>;
+
+} // namespace llvm::orc::rt::sps
+
+#endif // LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_SPS_CALLS_H
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/RTBridge/SPS/ProxySpecs.h b/llvm/include/llvm/ExecutionEngine/Orc/RTBridge/SPS/ProxySpecs.h
deleted file mode 100644
index 2e7219cf1e7a2..0000000000000
--- a/llvm/include/llvm/ExecutionEngine/Orc/RTBridge/SPS/ProxySpecs.h
+++ /dev/null
@@ -1,94 +0,0 @@
-//===-------- ProxySpecs.h - SPS-based Call Wrappers ------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// SPS-based implementations of the RTBridge proxy interfaces.
-//
-// These implement the rt::Proxy interfaces by invoking executor-side wrapper
-// functions in the runtime's controller interface, using Simple Packed
-// Serialization to encode arguments and decode results.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_SPS_PROXYSPECS_H
-#define LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_SPS_PROXYSPECS_H
-
-#include "llvm/ExecutionEngine/Orc/Core.h"
-#include "llvm/ExecutionEngine/Orc/RTBridge/Proxy.h"
-
-namespace llvm::orc::rt::sps {
-
-template <typename ProxyT, typename SPSSigT, const char *DefaultName,
- typename FnType = typename ProxyT::FnType>
-class ProxySpec;
-
-template <typename ProxyT, typename SPSSigT, const char *DefaultName,
- typename RetT, typename... ArgTs>
-class ProxySpec<ProxyT, SPSSigT, DefaultName, RetT(ArgTs...)> {
- using CalleeRetT = typename ProxyT::CalleeRetT;
- using ErrorRetT = typename ProxyT::ErrorRetT;
-
-public:
- static constexpr const char *Name = DefaultName;
-
- static void dispatch(unique_function<void(ErrorRetT)> OnComplete,
- ExecutionSession &ES, ExecutorAddr CalleeAddr,
- const ArgTs &...Args) {
- if constexpr (std::is_void_v<CalleeRetT>) {
- // Void result: the executor-side function produces no value, so the only
- // thing to report is the dispatch error (success if the call ran).
- ES.callSPSWrapperAsync<SPSSigT>(CalleeAddr, std::move(OnComplete),
- Args...);
- } else {
- ES.callSPSWrapperAsync<SPSSigT>(
- CalleeAddr,
- [OnComplete = std::move(OnComplete)](Error SerErr,
- CalleeRetT Result) mutable {
- if (SerErr)
- return OnComplete(std::move(SerErr));
- return OnComplete(std::move(Result));
- },
- Args...);
- }
- }
-};
-
-using CallMainSPSSig = int64_t(shared::SPSExecutorAddr,
- shared::SPSSequence<shared::SPSString>);
-inline constexpr char CallMainCIName[] = "orc_rt_ci_sps_call_main";
-/// SPS proxy for rt::CallMainProxy: runs a main-like function
-/// (int(int argc, char *argv[])) in the executor.
-using CallMainProxySpec =
- ProxySpec<rt::CallMainProxy, CallMainSPSSig, CallMainCIName>;
-
-using CallVoidVoidSPSSig = void(shared::SPSExecutorAddr);
-inline constexpr char CallVoidVoidCIName[] = "orc_rt_ci_sps_call_void_void";
-/// SPS proxy for rt::CallVoidVoidProxy: runs a void() function in the executor.
-/// WARNING: This Proxy is experimental and may be removed.
-using CallVoidVoidProxySpec =
- ProxySpec<rt::CallVoidVoidProxy, CallVoidVoidSPSSig, CallVoidVoidCIName>;
-
-using CallInt32VoidSPSSig = int32_t(shared::SPSExecutorAddr);
-inline constexpr char CallInt32VoidCIName[] = "orc_rt_ci_sps_call_int32_void";
-/// SPS proxy for rt::CallInt32VoidProxy: runs an int32_t() function in the
-/// executor.
-/// WARNING: This Proxy is experimental and may be removed.
-using CallInt32VoidProxySpec =
- ProxySpec<rt::CallInt32VoidProxy, CallInt32VoidSPSSig, CallInt32VoidCIName>;
-
-using CallInt32Int32SPSSig = int32_t(shared::SPSExecutorAddr, int32_t);
-inline constexpr char CallInt32Int32CIName[] = "orc_rt_ci_sps_call_int32_int32";
-/// SPS proxy for rt::CallInt32Int32Proxy: runs an int32_t(int32_t) function in
-/// the executor.
-/// WARNING: This Proxy is experimental and may be removed.
-using CallInt32Int32ProxySpec =
- ProxySpec<rt::CallInt32Int32Proxy, CallInt32Int32SPSSig,
- CallInt32Int32CIName>;
-
-} // namespace llvm::orc::rt::sps
-
-#endif // LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_SPS_PROXYSPECS_H
diff --git a/llvm/include/llvm/Support/GenericDomTree.h b/llvm/include/llvm/Support/GenericDomTree.h
index 413dd80a85f14..782c17aa91efb 100644
--- a/llvm/include/llvm/Support/GenericDomTree.h
+++ b/llvm/include/llvm/Support/GenericDomTree.h
@@ -462,9 +462,11 @@ template <typename NodeT, bool IsPostDom> class DominatorTreeBase {
bool isReachableFromEntry(const NodeT *A) const {
assert(!this->isPostDominator() &&
"This is not implemented for post dominators");
- return getNode(A) != nullptr;
+ return isReachableFromEntry(getNode(A));
}
+ bool isReachableFromEntry(const DomTreeNodeBase<NodeT> *A) const { return A; }
+
/// dominates - Returns true iff A dominates B. Note that this is not a
/// constant time operation!
///
@@ -475,11 +477,11 @@ template <typename NodeT, bool IsPostDom> class DominatorTreeBase {
return true;
// An unreachable node is dominated by anything.
- if (!B)
+ if (!isReachableFromEntry(B))
return true;
// And dominates nothing.
- if (!A)
+ if (!isReachableFromEntry(A))
return false;
if (B->getIDom() == A) return true;
@@ -937,7 +939,8 @@ template <typename NodeT, bool IsPostDom> class DominatorTreeBase {
bool dominatedBySlowTreeWalk(const DomTreeNodeBase<NodeT> *A,
const DomTreeNodeBase<NodeT> *B) const {
assert(A != B);
- assert(A && B);
+ assert(isReachableFromEntry(B));
+ assert(isReachableFromEntry(A));
const unsigned ALevel = A->getLevel();
const DomTreeNodeBase<NodeT> *IDom;
diff --git a/llvm/include/llvm/Support/GenericDomTreeConstruction.h b/llvm/include/llvm/Support/GenericDomTreeConstruction.h
index b2eb8c63dcfe7..8190237e9e6ac 100644
--- a/llvm/include/llvm/Support/GenericDomTreeConstruction.h
+++ b/llvm/include/llvm/Support/GenericDomTreeConstruction.h
@@ -69,7 +69,7 @@ template <typename DomTreeT> struct SemiNCAInfo {
unsigned Parent = 0;
unsigned Semi = 0;
unsigned Label = 0;
- unsigned IDom = 0;
+ NodePtr IDom = nullptr;
// Head index + 1 into ReverseChildren; 0: empty list.
unsigned ReverseChildrenStart = 0;
};
@@ -140,6 +140,24 @@ template <typename DomTreeT> struct SemiNCAInfo {
return NodeInfos[GraphTraits<NodePtr>::getNumber(BB)];
}
+ NodePtr getIDom(NodePtr BB) { return getNodeInfo(BB).IDom; }
+
+ TreeNodePtr getNodeForBlock(NodePtr BB, DomTreeT &DT) {
+ if (TreeNodePtr Node = DT.getNode(BB))
+ return Node;
+
+ // Haven't calculated this node yet? Get or calculate the node for the
+ // immediate dominator.
+ NodePtr IDom = getIDom(BB);
+
+ assert(IDom || DT.getNode(nullptr));
+ TreeNodePtr IDomNode = getNodeForBlock(IDom, DT);
+
+ // Add a new tree node for this NodeT, and link it as a child of
+ // IDomNode
+ return DT.createNode(BB, IDomNode);
+ }
+
static bool AlwaysDescend(NodePtr, NodePtr) { return true; }
struct BlockNamePrinter {
@@ -269,14 +287,16 @@ template <typename DomTreeT> struct SemiNCAInfo {
// This function requires DFS to be run before calling it.
void runSemiNCA() {
const unsigned NextDFSNum(NumToNode.size());
- // NumToInfo is indexed by DFS number; 0 is the root. IDoms holds
+ // NumToInfo and IDoms are indexed by DFS number; 0 is the root. IDoms holds
// immediate dominators in DFS-number space, initialized below to spanning
// tree parents.
SmallVector<InfoRec *, 32> NumToInfo;
NumToInfo.resize_for_overwrite(NextDFSNum);
+ SmallVector<unsigned, 32> IDoms;
+ IDoms.resize_for_overwrite(NextDFSNum);
for (unsigned i = 0; i < NextDFSNum; ++i) {
auto &VInfo = getNodeInfo(NumToNode[i]);
- VInfo.IDom = VInfo.Parent;
+ IDoms[i] = VInfo.Parent;
NumToInfo[i] = &VInfo;
}
@@ -303,10 +323,11 @@ template <typename DomTreeT> struct SemiNCAInfo {
// SDom[i]'s DFS number is just Semi.
for (unsigned i = 1; i < NextDFSNum; ++i) {
auto &WInfo = *NumToInfo[i];
- unsigned WIDom = WInfo.IDom;
+ unsigned WIDom = IDoms[i];
while (WIDom > WInfo.Semi)
- WIDom = NumToInfo[WIDom]->IDom;
- WInfo.IDom = WIDom;
+ WIDom = IDoms[WIDom];
+ IDoms[i] = WIDom;
+ WInfo.IDom = NumToNode[WIDom];
}
}
@@ -588,28 +609,35 @@ template <typename DomTreeT> struct SemiNCAInfo {
NodePtr Root = IsPostDom ? nullptr : DT.Roots[0];
DT.RootNode = DT.createNode(Root);
- SNCA.attachNewSubtree(DT);
+ SNCA.attachNewSubtree(DT, DT.RootNode);
}
- // For each non-root node in a subtree, attach it to the immediate dominator.
- void attachNewSubtree(DomTreeT &DT) {
- for (unsigned Num = 1, E = NumToNode.size(); Num != E; ++Num) {
- NodePtr W = NumToNode[Num];
- assert(!DT.getNode(W) && "node was already attached");
+ void attachNewSubtree(DomTreeT &DT, const TreeNodePtr AttachTo) {
+ // Attach the first unreachable block to AttachTo.
+ getNodeInfo(NumToNode[0]).IDom = AttachTo->getBlock();
+ // Loop over all of the discovered blocks in the function...
+ for (NodePtr W : NumToNode) {
+ if (DT.getNode(W))
+ continue; // Already calculated the node before
+
+ NodePtr ImmDom = getIDom(W);
+
+ // Get or calculate the node for the immediate dominator.
+ TreeNodePtr IDomNode = getNodeForBlock(ImmDom, DT);
// Add a new tree node for this BasicBlock, and link it as a child of
// IDomNode.
- auto IDomNode = DT.getNode(NumToNode[getNodeInfo(W).IDom]);
DT.createNode(W, IDomNode);
}
}
void reattachExistingSubtree(DomTreeT &DT, const TreeNodePtr AttachTo) {
- DT.getNode(NumToNode[0])->setIDom(AttachTo);
- for (unsigned Num = 1, E = NumToNode.size(); Num != E; ++Num) {
- NodePtr N = NumToNode[Num];
- auto IDomNode = DT.getNode(NumToNode[getNodeInfo(N).IDom]);
- DT.getNode(N)->setIDom(IDomNode);
+ getNodeInfo(NumToNode[0]).IDom = AttachTo->getBlock();
+ for (const NodePtr N : NumToNode) {
+ const TreeNodePtr TN = DT.getNode(N);
+ assert(TN);
+ const TreeNodePtr NewIDom = DT.getNode(getNodeInfo(N).IDom);
+ TN->setIDom(NewIDom);
}
}
@@ -897,8 +925,7 @@ template <typename DomTreeT> struct SemiNCAInfo {
SemiNCAInfo SNCA(DT, BUI);
SNCA.runDFS(Root, 0, UnreachableDescender, 0);
SNCA.runSemiNCA();
- DT.createNode(SNCA.NumToNode[0], Incoming);
- SNCA.attachNewSubtree(DT);
+ SNCA.attachNewSubtree(DT, Incoming);
LLVM_DEBUG(dbgs() << "After adding unreachable nodes\n");
}
diff --git a/llvm/include/llvm/Support/KnownBits.h b/llvm/include/llvm/Support/KnownBits.h
index 1353955c8e325..f88e5bdd1a92d 100644
--- a/llvm/include/llvm/Support/KnownBits.h
+++ b/llvm/include/llvm/Support/KnownBits.h
@@ -590,14 +590,6 @@ struct KnownBits {
static KnownBits remGetLowBits(const KnownBits &LHS, const KnownBits &RHS);
};
-namespace SignBitsOps {
-
-/// Compute the number of sign bits after rotating a value.
-LLVM_ABI unsigned rot(unsigned SrcSignBits, unsigned BitWidth,
- std::optional<APInt> RotAmt, bool IsRotateRight);
-
-} // end namespace SignBitsOps
-
inline KnownBits operator&(KnownBits LHS, const KnownBits &RHS) {
LHS &= RHS;
return LHS;
diff --git a/llvm/include/llvm/Transforms/Utils/Local.h b/llvm/include/llvm/Transforms/Utils/Local.h
index 493a256c2ef58..62fa8ada3905f 100644
--- a/llvm/include/llvm/Transforms/Utils/Local.h
+++ b/llvm/include/llvm/Transforms/Utils/Local.h
@@ -411,14 +411,11 @@ LLVM_ABI Instruction *removeUnwindEdge(BasicBlock *BB,
DomTreeUpdater *DTU = nullptr);
/// Remove all blocks that can not be reached from the function's entry.
-/// When \p FoldInstsToUnreachable is true, it will also convert obviously
-/// unreachable instructions into unreachable (e.g, store to null).
///
-/// Returns true if any basic block was removed or any instruction was folded.
+/// Returns true if any basic block was removed.
LLVM_ABI bool removeUnreachableBlocks(Function &F,
DomTreeUpdater *DTU = nullptr,
- MemorySSAUpdater *MSSAU = nullptr,
- bool FoldInstsToUnreachable = true);
+ MemorySSAUpdater *MSSAU = nullptr);
/// Combine the metadata of two instructions so that K can replace J. This
/// specifically handles the case of CSE-like transformations. Some
diff --git a/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp b/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
index 0ffc368178cfc..139d70f28a4d9 100644
--- a/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
@@ -2416,16 +2416,6 @@ unsigned GISelValueTracking::computeNumSignBits(Register R,
}
break;
}
- case TargetOpcode::G_ROTL:
- case TargetOpcode::G_ROTR: {
- Register SrcReg = MI.getOperand(1).getReg();
- unsigned Tmp = computeNumSignBits(SrcReg, DemandedElts, Depth + 1);
- auto MaybeAmt =
- isConstantOrConstantSplatVector(MI.getOperand(2).getReg(), MRI);
- FirstAnswer =
- SignBitsOps::rot(Tmp, TyBits, MaybeAmt, Opcode == TargetOpcode::G_ROTR);
- break;
- }
case TargetOpcode::G_SREM: {
// The sign bit is the LHS's sign bit, except when the result of the
// remainder is zero. The magnitude of the result should be less than or
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 1b3e006a96c15..5f5ad7275bfc4 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -5245,14 +5245,26 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
return VTBits;
break;
case ISD::ROTL:
- case ISD::ROTR: {
+ case ISD::ROTR:
Tmp = ComputeNumSignBits(Op.getOperand(0), DemandedElts, Depth + 1);
- ConstantSDNode *C = isConstOrConstSplat(Op.getOperand(1), DemandedElts);
- FirstAnswer = SignBitsOps::rot(
- Tmp, VTBits, C ? std::optional(C->getAPIntValue()) : std::nullopt,
- Opcode == ISD::ROTR);
+
+ // If we're rotating an 0/-1 value, then it stays an 0/-1 value.
+ if (Tmp == VTBits)
+ return VTBits;
+
+ if (ConstantSDNode *C =
+ isConstOrConstSplat(Op.getOperand(1), DemandedElts)) {
+ unsigned RotAmt = C->getAPIntValue().urem(VTBits);
+
+ // Handle rotate right by N like a rotate left by 32-N.
+ if (Opcode == ISD::ROTR)
+ RotAmt = (VTBits - RotAmt) % VTBits;
+
+ // If we aren't rotating out all of the known-in sign bits, return the
+ // number that are left. This handles rotl(sext(x), 1) for example.
+ if (Tmp > (RotAmt + 1)) return (Tmp - RotAmt);
+ }
break;
- }
case ISD::ADD:
case ISD::ADDC:
// TODO: Move Operand 1 check before Operand 0 check
diff --git a/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt b/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
index c1456321327ef..0109002e9bc18 100644
--- a/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
@@ -7,7 +7,6 @@ add_llvm_component_library(LLVMJITLink
DWARFRecordSectionSplitter.cpp
EHFrameSupport.cpp
JITLink.cpp
- JITLinkDylib.cpp
JITLinkGeneric.cpp
JITLinkMemoryManager.cpp
diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLinkDylib.cpp b/llvm/lib/ExecutionEngine/JITLink/JITLinkDylib.cpp
deleted file mode 100644
index 1fa4bd7088f11..0000000000000
--- a/llvm/lib/ExecutionEngine/JITLink/JITLinkDylib.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-//===-------------------------- JITLinkDylib.cpp --------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ExecutionEngine/JITLink/JITLinkDylib.h"
-#include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"
-
-namespace llvm::jitlink {
-
-JITLinkDylib::~JITLinkDylib() {
- for (JITLinkMemoryManager *MemMgr : ToNotifyOnDestruction)
- MemMgr->notifyDestroying(*this);
-}
-
-} // namespace llvm::jitlink
diff --git a/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp b/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
index bb1e5d48804ef..d80a6f542858f 100644
--- a/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
@@ -13,7 +13,7 @@
#include "llvm/ExecutionEngine/Orc/DebugUtils.h"
#include "llvm/ExecutionEngine/Orc/LookupAndRecordAddrs.h"
#include "llvm/ExecutionEngine/Orc/ObjectFileInterface.h"
-#include "llvm/ExecutionEngine/Orc/RTBridge/SPS/ProxySpecs.h"
+#include "llvm/ExecutionEngine/Orc/RTBridge/SPS/Calls.h"
#include "llvm/ExecutionEngine/Orc/Shared/ObjectFormats.h"
#include "llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h"
#include "llvm/Object/COFF.h"
@@ -663,14 +663,13 @@ Error COFFPlatform::runBootstrapInitializers(JDBootstrapState &BState) {
Error COFFPlatform::runBootstrapSubsectionInitializers(JDBootstrapState &BState,
StringRef Start,
StringRef End) {
- rt::CallInt32VoidProxy CallInitializer;
- if (auto Err = rt::buildProxies(
- ES, rt::proxyInit<rt::sps::CallInt32VoidProxySpec>(&CallInitializer)))
- return Err;
+ auto CallInitializer = rt::sps::Int32VoidCaller::Create(ES);
+ if (!CallInitializer)
+ return CallInitializer.takeError();
for (auto &Initializer : BState.Initializers)
if (Initializer.first >= Start && Initializer.first <= End &&
Initializer.second) {
- auto Res = CallInitializer(ES, Initializer.second);
+ auto Res = (*CallInitializer)(Initializer.second);
if (!Res)
return Res.takeError();
}
@@ -736,11 +735,10 @@ Error COFFPlatform::runSymbolIfExists(JITDylib &PlatformJD,
ES, LookupKind::Static, makeJITDylibSearchOrder(&PlatformJD),
{{ES.intern(SymbolName), &jit_function}});
if (!AfterCLookupErr) {
- rt::CallInt32VoidProxy CallFn;
- if (auto Err = rt::buildProxies(
- ES, rt::proxyInit<rt::sps::CallInt32VoidProxySpec>(&CallFn)))
- return Err;
- auto Res = CallFn(ES, jit_function);
+ auto CallFn = rt::sps::Int32VoidCaller::Create(ES);
+ if (!CallFn)
+ return CallFn.takeError();
+ auto Res = (*CallFn)(jit_function);
if (!Res)
return Res.takeError();
return Error::success();
diff --git a/llvm/lib/ExecutionEngine/Orc/COFFVCRuntimeSupport.cpp b/llvm/lib/ExecutionEngine/Orc/COFFVCRuntimeSupport.cpp
index 0ed0b2598cb0f..8e33734af1575 100644
--- a/llvm/lib/ExecutionEngine/Orc/COFFVCRuntimeSupport.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/COFFVCRuntimeSupport.cpp
@@ -11,7 +11,7 @@
#include "llvm/ExecutionEngine/Orc/COFF.h"
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
#include "llvm/ExecutionEngine/Orc/LookupAndRecordAddrs.h"
-#include "llvm/ExecutionEngine/Orc/RTBridge/SPS/ProxySpecs.h"
+#include "llvm/ExecutionEngine/Orc/RTBridge/SPS/Calls.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/WindowsDriver/MSVCPaths.h"
@@ -124,26 +124,27 @@ Error COFFVCRuntimeBootstrapper::initializeStaticVCRuntime(JITDylib &JD) {
&jit_scrt_initialize_default_local_stdio_options}}))
return Err;
- rt::CallInt32VoidProxy CallInt32Void;
- rt::CallInt32Int32Proxy CallInt32Int32;
- if (auto Err = buildProxies(
- ES, rt::proxyInit<rt::sps::CallInt32VoidProxySpec>(&CallInt32Void),
- rt::proxyInit<rt::sps::CallInt32Int32ProxySpec>(&CallInt32Int32)))
- return Err;
+ auto CallInt32Void = rt::sps::Int32VoidCaller::Create(ES);
+ if (!CallInt32Void)
+ return CallInt32Void.takeError();
+
+ auto CallInt32Int32 = rt::sps::Int32Int32Caller::Create(ES);
+ if (!CallInt32Int32)
+ return CallInt32Int32.takeError();
- auto R = CallInt32Int32(ES, jit_scrt_initialize, 0);
+ auto R = (*CallInt32Int32)(jit_scrt_initialize, 0);
if (!R)
return R.takeError();
if (auto Err =
- CallInt32Void(ES, jit_scrt_dllmain_before_initialize_c).takeError())
+ (*CallInt32Void)(jit_scrt_dllmain_before_initialize_c).takeError())
return Err;
- if (auto Err = CallInt32Void(ES, jit_scrt_initialize_type_info).takeError())
+ if (auto Err = (*CallInt32Void)(jit_scrt_initialize_type_info).takeError())
return Err;
if (auto Err =
- CallInt32Void(ES, jit_scrt_initialize_default_local_stdio_options)
+ (*CallInt32Void)(jit_scrt_initialize_default_local_stdio_options)
.takeError())
return Err;
diff --git a/llvm/lib/ExecutionEngine/Orc/Shared/OrcRTBridge.cpp b/llvm/lib/ExecutionEngine/Orc/Shared/OrcRTBridge.cpp
index 5ccf59956670a..7f3354fa49b32 100644
--- a/llvm/lib/ExecutionEngine/Orc/Shared/OrcRTBridge.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Shared/OrcRTBridge.cpp
@@ -8,7 +8,7 @@
#include "llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h"
-#include "llvm/ExecutionEngine/Orc/RTBridge/Proxy.h"
+#include "llvm/ExecutionEngine/Orc/RTBridge/Calls.h"
namespace llvm {
namespace orc {
diff --git a/llvm/lib/ExecutionEngine/Orc/SimpleRemoteEPC.cpp b/llvm/lib/ExecutionEngine/Orc/SimpleRemoteEPC.cpp
index fbc2dcf879cfb..897b318d83cb4 100644
--- a/llvm/lib/ExecutionEngine/Orc/SimpleRemoteEPC.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/SimpleRemoteEPC.cpp
@@ -10,7 +10,7 @@
#include "llvm/ExecutionEngine/Orc/EPCGenericDylibManager.h"
#include "llvm/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.h"
#include "llvm/ExecutionEngine/Orc/EPCGenericMemoryAccess.h"
-#include "llvm/ExecutionEngine/Orc/RTBridge/SPS/ProxySpecs.h"
+#include "llvm/ExecutionEngine/Orc/RTBridge/SPS/Calls.h"
#include "llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h"
#include "llvm/Support/FormatVariadic.h"
diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/OrcRTBootstrap.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/OrcRTBootstrap.cpp
index 21c6831225c46..c0327713e6046 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/OrcRTBootstrap.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/OrcRTBootstrap.cpp
@@ -8,7 +8,7 @@
#include "OrcRTBootstrap.h"
-#include "llvm/ExecutionEngine/Orc/RTBridge/SPS/ProxySpecs.h"
+#include "llvm/ExecutionEngine/Orc/RTBridge/SPS/Calls.h"
#include "llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h"
#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
#include "llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h"
diff --git a/llvm/lib/IR/Dominators.cpp b/llvm/lib/IR/Dominators.cpp
index dbd6e71207f75..2603420129f30 100644
--- a/llvm/lib/IR/Dominators.cpp
+++ b/llvm/lib/IR/Dominators.cpp
@@ -102,13 +102,11 @@ bool DominatorTree::dominates(const Value *DefV,
const BasicBlock *DefBB = Def->getParent();
// Any unreachable use is dominated, even if Def == User.
- const DomTreeNode *UseNode = getNode(UseBB);
- if (!UseNode)
+ if (!isReachableFromEntry(UseBB))
return true;
// Unreachable definitions don't dominate anything.
- const DomTreeNode *DefNode = getNode(DefBB);
- if (!DefNode)
+ if (!isReachableFromEntry(DefBB))
return false;
// An instruction doesn't dominate a use in itself.
@@ -123,7 +121,7 @@ bool DominatorTree::dominates(const Value *DefV,
return dominates(Def, UseBB);
if (DefBB != UseBB)
- return dominates(DefNode, UseNode);
+ return dominates(DefBB, UseBB);
return Def->comesBefore(User);
}
@@ -135,13 +133,11 @@ bool DominatorTree::dominates(const Instruction *Def,
const BasicBlock *DefBB = Def->getParent();
// Any unreachable use is dominated, even if DefBB == UseBB.
- const DomTreeNode *UseNode = getNode(UseBB);
- if (!UseNode)
+ if (!isReachableFromEntry(UseBB))
return true;
// Unreachable definitions don't dominate anything.
- const DomTreeNode *DefNode = getNode(DefBB);
- if (!DefNode)
+ if (!isReachableFromEntry(DefBB))
return false;
if (DefBB == UseBB)
@@ -155,7 +151,7 @@ bool DominatorTree::dominates(const Instruction *Def,
return dominates(E, UseBB);
}
- return dominates(DefNode, UseNode);
+ return dominates(DefBB, UseBB);
}
bool DominatorTree::dominates(const BasicBlockEdge &BBE,
@@ -164,8 +160,7 @@ bool DominatorTree::dominates(const BasicBlockEdge &BBE,
// edge also doesn't.
const BasicBlock *Start = BBE.getStart();
const BasicBlock *End = BBE.getEnd();
- const DomTreeNode *EndNode = getNode(End);
- if (!dominates(EndNode, getNode(UseBB)))
+ if (!dominates(End, UseBB))
return false;
// Simple case: if the end BB has a single predecessor, the fact that it
@@ -203,7 +198,7 @@ bool DominatorTree::dominates(const BasicBlockEdge &BBE,
continue;
}
- if (!dominates(EndNode, getNode(BB)))
+ if (!dominates(End, BB))
return false;
}
return true;
@@ -248,13 +243,11 @@ bool DominatorTree::dominates(const Value *DefV, const Use &U) const {
UseBB = UserInst->getParent();
// Any unreachable use is dominated, even if Def == User.
- const DomTreeNode *UseNode = getNode(UseBB);
- if (!UseNode)
+ if (!isReachableFromEntry(UseBB))
return true;
// Unreachable definitions don't dominate anything.
- const DomTreeNode *DefNode = getNode(DefBB);
- if (!DefNode)
+ if (!isReachableFromEntry(DefBB))
return false;
// Invoke instructions define their return values on the edges to their normal
@@ -271,7 +264,7 @@ bool DominatorTree::dominates(const Value *DefV, const Use &U) const {
// If the def and use are in different blocks, do a simple CFG dominator
// tree query.
if (DefBB != UseBB)
- return dominates(DefNode, UseNode);
+ return dominates(DefBB, UseBB);
// Ok, def and use are in the same block. If the def is an invoke, it
// doesn't dominate anything in the block. If it's a PHI, it dominates
diff --git a/llvm/lib/Support/KnownBits.cpp b/llvm/lib/Support/KnownBits.cpp
index 70f7a2f4fc887..c3acd2936e2ee 100644
--- a/llvm/lib/Support/KnownBits.cpp
+++ b/llvm/lib/Support/KnownBits.cpp
@@ -1446,26 +1446,3 @@ LLVM_DUMP_METHOD void KnownBits::dump() const {
dbgs() << "\n";
}
#endif
-
-unsigned llvm::SignBitsOps::rot(unsigned SrcSignBits, unsigned BitWidth,
- std::optional<APInt> RotAmt,
- bool IsRotateRight) {
- // If we're rotating an 0/-1 value, then it stays an 0/-1 value.
- if (SrcSignBits == BitWidth)
- return BitWidth;
-
- if (!RotAmt)
- return 1;
-
- unsigned Amt = RotAmt->urem(BitWidth);
-
- // Handle rotate right by N like a rotate left by BitWidth-N.
- if (IsRotateRight)
- Amt = (BitWidth - Amt) % BitWidth;
-
- // If we aren't rotating out all of the known-in sign bits, return the
- // number that are left. This handles rotl(sext(x), 1) for example.
- if (SrcSignBits > Amt + 1)
- return SrcSignBits - Amt;
- return 1;
-}
diff --git a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
index b84b6c833a75e..4c3038db2c747 100644
--- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+++ b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
@@ -7072,12 +7072,11 @@ bool AMDGPUAsmParser::subtargetHasRegister(const MCRegisterInfo &MRI,
case SRC_SHARED_BASE:
case SRC_SHARED_LIMIT_LO:
case SRC_SHARED_LIMIT:
- return isGFX9Plus();
case SRC_PRIVATE_BASE_LO:
case SRC_PRIVATE_BASE:
case SRC_PRIVATE_LIMIT_LO:
case SRC_PRIVATE_LIMIT:
- return AMDGPU::hasPrivateApertureRegs(getSTI());
+ return isGFX9Plus();
case SRC_FLAT_SCRATCH_BASE_LO:
case SRC_FLAT_SCRATCH_BASE_HI:
return hasGloballyAddressableScratch();
diff --git a/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp b/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
index d05997cacba0a..526d9f1bf8eb4 100644
--- a/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
+++ b/llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
@@ -218,8 +218,7 @@ static DecodeStatus decodeDpp8FI(MCInst &Inst, unsigned Val, uint64_t Addr,
#define DECODE_SrcOp(Name, EncSize, OpWidth, EncImm) \
static DecodeStatus Name(MCInst &Inst, unsigned Imm, uint64_t /*Addr*/, \
const MCDisassembler *Decoder) { \
- if (!isUInt<EncSize>(Imm)) \
- return MCDisassembler::Fail; \
+ assert(Imm < (1 << EncSize) && #EncSize "-bit encoding"); \
auto DAsm = static_cast<const AMDGPUDisassembler *>(Decoder); \
return addOperand(Inst, DAsm->decodeSrcOp(Inst, OpWidth, EncImm)); \
}
@@ -2119,26 +2118,11 @@ MCOperand AMDGPUDisassembler::decodeSpecialReg32(unsigned Val) const {
case 231: return createRegOperand(SRC_FLAT_SCRATCH_BASE_HI);
case 235: return createRegOperand(SRC_SHARED_BASE_LO);
case 236: return createRegOperand(SRC_SHARED_LIMIT_LO);
- case 237:
- if (AMDGPU::hasPrivateApertureRegs(STI))
- return createRegOperand(SRC_PRIVATE_BASE_LO);
- break;
- case 238:
- if (AMDGPU::hasPrivateApertureRegs(STI))
- return createRegOperand(SRC_PRIVATE_LIMIT_LO);
- break;
- case 239:
- if (AMDGPU::hasPopsExitingWaveID(STI))
- return createRegOperand(SRC_POPS_EXITING_WAVE_ID);
- break;
- case 251:
- if (!isGFX11Plus())
- return createRegOperand(SRC_VCCZ);
- break;
- case 252:
- if (!isGFX11Plus())
- return createRegOperand(SRC_EXECZ);
- break;
+ case 237: return createRegOperand(SRC_PRIVATE_BASE_LO);
+ case 238: return createRegOperand(SRC_PRIVATE_LIMIT_LO);
+ case 239: return createRegOperand(SRC_POPS_EXITING_WAVE_ID);
+ case 251: return createRegOperand(SRC_VCCZ);
+ case 252: return createRegOperand(SRC_EXECZ);
case 253: return createRegOperand(SRC_SCC);
case 254: return createRegOperand(LDS_DIRECT);
default: break;
@@ -2168,26 +2152,11 @@ MCOperand AMDGPUDisassembler::decodeSpecialReg64(unsigned Val) const {
case 230: return createRegOperand(SRC_FLAT_SCRATCH_BASE_LO);
case 235: return createRegOperand(SRC_SHARED_BASE);
case 236: return createRegOperand(SRC_SHARED_LIMIT);
- case 237:
- if (AMDGPU::hasPrivateApertureRegs(STI))
- return createRegOperand(SRC_PRIVATE_BASE);
- break;
- case 238:
- if (AMDGPU::hasPrivateApertureRegs(STI))
- return createRegOperand(SRC_PRIVATE_LIMIT);
- break;
- case 239:
- if (AMDGPU::hasPopsExitingWaveID(STI))
- return createRegOperand(SRC_POPS_EXITING_WAVE_ID);
- break;
- case 251:
- if (!isGFX11Plus())
- return createRegOperand(SRC_VCCZ);
- break;
- case 252:
- if (!isGFX11Plus())
- return createRegOperand(SRC_EXECZ);
- break;
+ case 237: return createRegOperand(SRC_PRIVATE_BASE);
+ case 238: return createRegOperand(SRC_PRIVATE_LIMIT);
+ case 239: return createRegOperand(SRC_POPS_EXITING_WAVE_ID);
+ case 251: return createRegOperand(SRC_VCCZ);
+ case 252: return createRegOperand(SRC_EXECZ);
case 253: return createRegOperand(SRC_SCC);
default: break;
}
@@ -2403,6 +2372,7 @@ bool AMDGPUDisassembler::hasArchitectedFlatScratch() const {
bool AMDGPUDisassembler::hasKernargPreload() const {
return AMDGPU::hasKernargPreload(STI);
}
+
//===----------------------------------------------------------------------===//
// AMDGPU specific symbol handling
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
index b2b1e4237367d..38329d6295538 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
@@ -2562,11 +2562,6 @@ bool hasPopsExitingWaveID(const MCSubtargetInfo &STI) {
return STI.hasFeature(AMDGPU::FeaturePopsExitingWaveID);
}
-bool hasPrivateApertureRegs(const MCSubtargetInfo &STI) {
- return STI.hasFeature(AMDGPU::FeatureApertureRegs) &&
- !STI.hasFeature(AMDGPU::FeatureGloballyAddressableScratch);
-}
-
bool isGFX10(const MCSubtargetInfo &STI) {
return STI.hasFeature(AMDGPU::FeatureGFX10);
}
diff --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
index 7d0bdbc661bc1..44476d4d555c0 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
@@ -1525,12 +1525,6 @@ bool isGFX940(const MCSubtargetInfo &STI);
bool hasArchitectedFlatScratch(const MCSubtargetInfo &STI);
bool hasMAIInsts(const MCSubtargetInfo &STI);
bool hasPopsExitingWaveID(const MCSubtargetInfo &STI);
-
-/// \returns true if the src_private_base and src_private_limit aperture
-/// registers are available on \p STI. Targets with globally addressable
-/// scratch have no private aperture and expose src_flat_scratch_base instead.
-bool hasPrivateApertureRegs(const MCSubtargetInfo &STI);
-
bool hasVOPD(const MCSubtargetInfo &STI);
bool hasDPPSrc1SGPR(const MCSubtargetInfo &STI);
diff --git a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
index 9f8051ebc2ed8..b550e985aa243 100644
--- a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
@@ -11,7 +11,6 @@
//
//===----------------------------------------------------------------------===//
-#include "NVPTXAsmPrinter.h"
#include "MCTargetDesc/NVPTXBaseInfo.h"
#include "MCTargetDesc/NVPTXInstPrinter.h"
#include "MCTargetDesc/NVPTXTargetStreamer.h"
@@ -44,7 +43,6 @@
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/CodeGen/Analysis.h"
#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/CodeGen/AsmPrinterAnalysis.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
@@ -841,17 +839,16 @@ void NVPTXAsmPrinter::emitJumpTable(const MachineJumpTableEntry &MJT,
// llvm.loop.unroll.disable or llvm.loop.unroll.count=1.
bool NVPTXAsmPrinter::isLoopHeaderOfNoUnroll(
const MachineBasicBlock &MBB) const {
- const MachineLoopInfo *LI = GetMLI(*MF);
- assert(LI && "NVPTXAsmPrinter requires MachineLoopInfo");
+ MachineLoopInfo &LI = getAnalysis<MachineLoopInfoWrapperPass>().getLI();
// We insert .pragma "nounroll" only to the loop header.
- if (!LI->isLoopHeader(&MBB))
+ if (!LI.isLoopHeader(&MBB))
return false;
// llvm.loop.unroll.disable is marked on the back edges of a loop. Therefore,
// we iterate through each back edge of the loop with header MBB, and check
// whether its metadata contains llvm.loop.unroll.disable.
for (const MachineBasicBlock *PMBB : MBB.predecessors()) {
- if (LI->getLoopFor(PMBB) != LI->getLoopFor(&MBB)) {
+ if (LI.getLoopFor(PMBB) != LI.getLoopFor(&MBB)) {
// Edges from other loops to MBB are not back edges.
continue;
}
@@ -2763,31 +2760,3 @@ LLVMInitializeNVPTXAsmPrinter() {
RegisterAsmPrinter<NVPTXAsmPrinter> X(getTheNVPTXTarget32());
RegisterAsmPrinter<NVPTXAsmPrinter> Y(getTheNVPTXTarget64());
}
-
-PreservedAnalyses NVPTXAsmPrinterBeginPass::run(Module &M,
- ModuleAnalysisManager &MAM) {
- AsmPrinter &Printer = MAM.getResult<AsmPrinterAnalysis>(M).getPrinter();
- setupModuleAsmPrinter(M, MAM, Printer);
- Printer.doInitialization(M);
- return PreservedAnalyses::all();
-}
-
-PreservedAnalyses
-NVPTXAsmPrinterPass::run(MachineFunction &MF,
- MachineFunctionAnalysisManager &MFAM) {
- AsmPrinter &Printer =
- MFAM.getResult<ModuleAnalysisManagerMachineFunctionProxy>(MF)
- .getCachedResult<AsmPrinterAnalysis>(*MF.getFunction().getParent())
- ->getPrinter();
- setupMachineFunctionAsmPrinter(MFAM, MF, Printer);
- Printer.runOnMachineFunction(MF);
- return PreservedAnalyses::all();
-}
-
-PreservedAnalyses NVPTXAsmPrinterEndPass::run(Module &M,
- ModuleAnalysisManager &MAM) {
- AsmPrinter &Printer = MAM.getResult<AsmPrinterAnalysis>(M).getPrinter();
- setupModuleAsmPrinter(M, MAM, Printer);
- Printer.doFinalization(M);
- return PreservedAnalyses::all();
-}
diff --git a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h
deleted file mode 100644
index bab59ced279bd..0000000000000
--- a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//===-- NVPTXAsmPrinter.h - NVPTX LLVM assembly writer ----------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXASMPRINTER_H
-#define LLVM_LIB_TARGET_NVPTX_NVPTXASMPRINTER_H
-
-#include "llvm/CodeGen/MachineFunctionAnalysisManager.h"
-#include "llvm/IR/PassManager.h"
-
-namespace llvm {
-
-class NVPTXAsmPrinterBeginPass
- : public RequiredPassInfoMixin<NVPTXAsmPrinterBeginPass> {
-public:
- PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
-};
-
-class NVPTXAsmPrinterPass : public RequiredPassInfoMixin<NVPTXAsmPrinterPass> {
-public:
- PreservedAnalyses run(MachineFunction &MF,
- MachineFunctionAnalysisManager &MFAM);
-};
-
-class NVPTXAsmPrinterEndPass
- : public RequiredPassInfoMixin<NVPTXAsmPrinterEndPass> {
-public:
- PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
-};
-
-} // end namespace llvm
-
-#endif // LLVM_LIB_TARGET_NVPTX_NVPTXASMPRINTER_H
diff --git a/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp b/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
index ea2c7aa8b27ed..3c548bc581686 100644
--- a/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
@@ -14,7 +14,6 @@
#include "NVPTX.h"
#include "NVPTXAliasAnalysis.h"
#include "NVPTXAllocaHoisting.h"
-#include "NVPTXAsmPrinter.h"
#include "NVPTXAtomicLower.h"
#include "NVPTXCtorDtorLowering.h"
#include "NVPTXLowerAggrCopies.h"
@@ -213,16 +212,6 @@ void NVPTXTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
#define GET_PASS_REGISTRY "NVPTXPassRegistry.def"
#include "llvm/Passes/TargetPassRegistry.inc"
- // TODO: Move this into the base CodeGenPassBuilder once all targets that
- // currently implement it have a ported asm-printer pass.
- if (PIC) {
- PIC->addClassToPassName(NVPTXAsmPrinterBeginPass::name(),
- "nvptx-asm-printer-begin");
- PIC->addClassToPassName(NVPTXAsmPrinterPass::name(), "nvptx-asm-printer");
- PIC->addClassToPassName(NVPTXAsmPrinterEndPass::name(),
- "nvptx-asm-printer-end");
- }
-
PB.registerPipelineStartEPCallback(
[this](ModulePassManager &PM, OptimizationLevel Level) {
// We do not want to fold out calls to nvvm.reflect early if the user
diff --git a/llvm/lib/Target/SPIRV/SPIRVCombinerHelper.cpp b/llvm/lib/Target/SPIRV/SPIRVCombinerHelper.cpp
index 0882970895452..660bee0f7a2cd 100644
--- a/llvm/lib/Target/SPIRV/SPIRVCombinerHelper.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVCombinerHelper.cpp
@@ -182,6 +182,7 @@ void SPIRVCombinerHelper::applySPIRVFaceForward(MachineInstr &MI) const {
if (TrueInstr->getOpcode() == TargetOpcode::G_FNEG ||
TrueInstr->getOpcode() == TargetOpcode::G_FMUL)
std::swap(TrueReg, FalseReg);
+ MachineInstr *FalseInstr = MRI.getVRegDef(FalseReg);
Register ResultReg = MI.getOperand(0).getReg();
Builder.setInstrAndDebugLoc(MI);
@@ -190,7 +191,27 @@ void SPIRVCombinerHelper::applySPIRVFaceForward(MachineInstr &MI) const {
.addUse(DotOperand1) // I
.addUse(DotOperand2); // Ng
- MI.eraseFromParent();
+ SPIRVGlobalRegistry *GR =
+ MI.getMF()->getSubtarget<SPIRVSubtarget>().getSPIRVGlobalRegistry();
+ auto RemoveAllUses = [&](Register Reg) {
+ SmallVector<MachineInstr *, 4> UsesToErase;
+ for (auto &UseMI : MRI.use_instructions(Reg))
+ UsesToErase.push_back(&UseMI);
+
+ // calling eraseFromParent to early invalidates the iterator.
+ for (auto *MIToErase : UsesToErase)
+ MIToErase->eraseFromParent();
+ };
+
+ RemoveAllUses(CondReg); // remove all uses of FCMP Result
+ GR->invalidateMachineInstr(CondInstr);
+ CondInstr->eraseFromParent(); // remove FCMP instruction
+ RemoveAllUses(DotReg); // remove all uses of spv_fdot/G_FMUL Result
+ GR->invalidateMachineInstr(DotInstr);
+ DotInstr->eraseFromParent(); // remove spv_fdot/G_FMUL instruction
+ RemoveAllUses(FalseReg);
+ GR->invalidateMachineInstr(FalseInstr);
+ FalseInstr->eraseFromParent();
}
bool SPIRVCombinerHelper::matchMatrixTranspose(MachineInstr &MI) const {
diff --git a/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp b/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp
index 3be4ecbae843d..bc60842c3fd76 100644
--- a/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp
+++ b/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp
@@ -64,11 +64,8 @@ static unsigned adjustFixupValue(unsigned Kind, uint64_t Value) {
case ELF::R_SPARC_HIX22:
return (~Value >> 10) & 0x3fffff;
- // In PIC mode the parser may map %hi to PC22/GOT22. An operand that folds to
- // an absolute value emits no relocation and needs the %hi encoding.
case ELF::R_SPARC_PC22:
case ELF::R_SPARC_HI22:
- case ELF::R_SPARC_GOT22:
case ELF::R_SPARC_LM22:
return (Value >> 10) & 0x3fffff;
@@ -83,7 +80,6 @@ static unsigned adjustFixupValue(unsigned Kind, uint64_t Value) {
case ELF::R_SPARC_PC10:
case ELF::R_SPARC_LO10:
- case ELF::R_SPARC_GOT10:
return Value & 0x3ff;
case ELF::R_SPARC_H44:
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index c74d342fed1cb..3b39e1bddb8ba 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -570,9 +570,9 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
if (Subtarget.canUseCMPXCHG16B())
setOperationAction(ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS, MVT::i128, Custom);
- // 32-bit Windows non-GNU EH (MSVC/Itanium SEH) does not use per-invoke EH
- // labels, so expand them away. SjLj EH does use them.
- if (Subtarget.isTargetWin32() && !Subtarget.isTargetCygMing() &&
+ // FIXME - use subtarget debug flags
+ if (!Subtarget.isTargetDarwin() && !Subtarget.isTargetELF() &&
+ !Subtarget.isTargetCygMing() && !Subtarget.isTargetWin64() &&
TM.Options.ExceptionModel != ExceptionHandling::SjLj) {
setOperationAction(ISD::EH_LABEL, MVT::Other, Expand);
}
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 7fee08ad21d28..5ee5009bd0262 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -522,11 +522,6 @@ static Instruction *foldCttzCtlz(IntrinsicInst &II, InstCombinerImpl &IC) {
if (match(Op0, m_c_And(m_Neg(m_Value(X)), m_Deferred(X))))
return CallInst::Create(II.getCalledFunction(), {X, Op1});
- // cttz(mul(X, OddC)) -> cttz(X)
- if (match(Op0, m_Mul(m_Value(X),
- m_CheckedInt([](const APInt &C) { return C[0]; }))))
- return CallInst::Create(II.getCalledFunction(), {X, Op1});
-
// cttz(sext(x)) -> cttz(zext(x))
if (match(Op0, m_OneUse(m_SExt(m_Value(X))))) {
auto *Zext = IC.Builder.CreateZExt(X, II.getType());
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index cc79f67e9f32f..70d584740f5b9 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -1989,31 +1989,6 @@ Instruction *InstCombinerImpl::foldICmpAndConstant(ICmpInst &Cmp,
if (!Cmp.isEquality())
return nullptr;
- // (X & -X) == 0 --> X == 0
- // (X & -X) != 0 --> X != 0
- // (X & -X) == 1 --> trunc X to i1
- // (X & -X) != 1 --> !(trunc X to i1)
- // Cmp is == or != by the check above.
- Value *MatchedX;
- // Match X & -X in either operand order.
- if (C.getBitWidth() > 1 && (C.isZero() || C.isOne()) &&
- match(And, m_c_And(m_Neg(m_Value(MatchedX)), m_Deferred(MatchedX)))) {
- // Preserve the predicate: (X & -X) ==/!= 0 --> X ==/!= 0.
- if (C.isZero())
- return new ICmpInst(Pred, MatchedX, Cmp.getOperand(1));
-
- // (X & -X) == 1 iff the low bit of X is set.
- if (Pred == CmpInst::ICMP_EQ)
- return new TruncInst(MatchedX, Cmp.getType());
-
- // The remaining case needs a trunc and not. Require the original and
- // to become dead to avoid increasing the instruction count.
- if (And->hasOneUse()) {
- Value *Trunc = Builder.CreateTrunc(MatchedX, Cmp.getType());
- return BinaryOperator::CreateNot(Trunc);
- }
- }
-
// X & -C == -C -> X > u ~C
// X & -C != -C -> X <= u ~C
// iff C is a power of 2
@@ -3652,51 +3627,6 @@ Instruction *InstCombinerImpl::foldICmpInstWithConstant(ICmpInst &Cmp) {
if (Instruction *I = foldICmpIntrinsicWithConstant(Cmp, II, *C))
return I;
- {
- // icmp slt/sgt (extractvalue (frexp X), 1), C -->
- // fcmp olt/oge (fabs X), 2^ExpVal
- // slt -> olt, ExpVal = C-1; sgt -> oge, ExpVal = C.
- Value *X;
- if (match(Cmp.getOperand(0),
- m_OneUse(m_ExtractValue<1>(
- m_OneUse(m_Intrinsic<Intrinsic::frexp>(m_Value(X))))))) {
- ICmpInst::Predicate Pred = Cmp.getPredicate();
- APInt Exp;
- FCmpInst::Predicate NewPred;
- bool ValidPred = true;
-
- switch (Pred) {
- case ICmpInst::ICMP_SLT:
- NewPred = FCmpInst::FCMP_OLT;
- Exp = *C - 1;
- break;
- case ICmpInst::ICMP_SGT:
- NewPred = FCmpInst::FCMP_OGE;
- Exp = *C;
- break;
- default:
- ValidPred = false;
- break;
- }
-
- if (ValidPred) {
- const fltSemantics &Sem =
- X->getType()->getScalarType()->getFltSemantics();
- int MaxExp = APFloat::semanticsMaxExponent(Sem);
-
- if (!Exp.isNegative() && Exp.sle(MaxExp + 1) &&
- isKnownNeverInfOrNaN(X, SQ.getWithInstruction(&Cmp))) {
- int ExpVal = static_cast<int>(Exp.getSExtValue());
- APFloat CmpConst = scalbn(APFloat::getOne(Sem), ExpVal,
- APFloat::rmNearestTiesToEven);
- Value *Fabs = Builder.CreateFAbs(X);
- return new FCmpInst(NewPred, Fabs,
- ConstantFP::get(X->getType(), CmpConst));
- }
- }
- }
- }
-
// (extractval ([s/u]subo X, Y), 0) == 0 --> X == Y
// (extractval ([s/u]subo X, Y), 0) != 0 --> X != Y
// TODO: This checks one-use, but that is not strictly necessary.
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index edf046b32c32c..14ccd6b2dfa24 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -260,7 +260,7 @@ class PointerReplacer {
}
SmallSetVector<Instruction *, 32> UsersToReplace;
- DenseMap<Value *, Value *> WorkMap;
+ MapVector<Value *, Value *> WorkMap;
InstCombinerImpl &IC;
Instruction &Root;
unsigned FromAS;
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index 4e1aa36230550..f63bff2f16e7a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -1402,29 +1402,6 @@ Instruction *InstCombinerImpl::commonIDivTransforms(BinaryOperator &I) {
Mul->setHasNoSignedWrap(OBO->hasNoSignedWrap());
return Mul;
}
-
- // (X * C1) / C2 -> (X * (C1/D)) / (C2/D) if D = gcd(C1, C2) > 1.
- if (Op0->hasOneUse()) {
- APInt GCD = IsSigned
- ? APIntOps::GreatestCommonDivisor(C1->abs(), C2->abs())
- : APIntOps::GreatestCommonDivisor(*C1, *C2);
- if (GCD.ugt(1)) {
- APInt NewC1 = IsSigned ? C1->sdiv(GCD) : C1->udiv(GCD);
- APInt NewC2 = IsSigned ? C2->sdiv(GCD) : C2->udiv(GCD);
-
- auto *OldMul = cast<OverflowingBinaryOperator>(Op0);
- Value *NewMul = Builder.CreateMul(X, ConstantInt::get(Ty, NewC1), "",
- OldMul->hasNoUnsignedWrap(),
- OldMul->hasNoSignedWrap());
- NewMul->takeName(OldMul);
-
- Constant *NewDivisor = ConstantInt::get(Ty, NewC2);
- auto *NewDiv =
- BinaryOperator::Create(I.getOpcode(), NewMul, NewDivisor);
- NewDiv->setIsExact(I.isExact());
- return NewDiv;
- }
- }
}
if ((IsSigned && match(Op0, m_NSWShl(m_Value(X), m_APInt(C1))) &&
@@ -1451,29 +1428,6 @@ Instruction *InstCombinerImpl::commonIDivTransforms(BinaryOperator &I) {
Mul->setHasNoSignedWrap(OBO->hasNoSignedWrap());
return Mul;
}
-
- // (X << C1) / C2 -> (X << (C1 - K)) / (C2 / (1 << K))
- // Where K = min(C1, countr_zero(C2)), the shared power of 2.
- if (Op0->hasOneUse()) {
- unsigned ShiftAmt = static_cast<unsigned>(C1->getZExtValue());
- unsigned K = std::min(C2->countr_zero(), ShiftAmt);
- if (K > 0) {
- unsigned NewShiftAmt = ShiftAmt - K;
- APInt NewC2 = IsSigned ? C2->ashr(K) : C2->lshr(K);
-
- auto *OldShift = cast<OverflowingBinaryOperator>(Op0);
- Value *NewShift = Builder.CreateShl(
- X, ConstantInt::get(Ty, NewShiftAmt), "",
- OldShift->hasNoUnsignedWrap(), OldShift->hasNoSignedWrap());
- NewShift->takeName(OldShift);
-
- Constant *NewDivisor = ConstantInt::get(Ty, NewC2);
- auto *NewDiv =
- BinaryOperator::Create(I.getOpcode(), NewShift, NewDivisor);
- NewDiv->setIsExact(I.isExact());
- return NewDiv;
- }
- }
}
// Distribute div over add to eliminate a matching div/mul pair:
@@ -1827,20 +1781,6 @@ Instruction *InstCombinerImpl::visitUDiv(BinaryOperator &I) {
}
}
- // (X udiv Y) udiv Z --> X udiv (Y * Z), if Y * Z does not overflow.
- // This is the variable-operand version of the (X / C1) / C2 fold in
- // commonIDivTransforms().
- Value *Y;
- if (match(Op0, m_OneUse(m_UDiv(m_Value(X), m_Value(Y)))) &&
- willNotOverflowUnsignedMul(Y, Op1, I)) {
- Value *YZ = Builder.CreateNUWMul(Y, Op1);
- auto *NewDiv = BinaryOperator::CreateUDiv(X, YZ);
- // The result is exact only if both of the original divides are exact.
- if (I.isExact() && cast<PossiblyExactOperator>(Op0)->isExact())
- NewDiv->setIsExact();
- return NewDiv;
- }
-
// Op0 / C where C is large (negative) --> zext (Op0 >= C)
// This also handles non-constant values where the sign bit is known to be
// set.
diff --git a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
index b31ae075e8f4a..44516103fd4e1 100644
--- a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
@@ -664,9 +664,7 @@ static Decomposition decompose(Value *V, const ConstraintInfo &Info,
}
if (match(V, m_NUWShl(m_Value(Op1), m_ConstantInt(CI))) && canUseSExt(CI)) {
- // The scale 1 << shift must fit in the signed coefficient, so reject a
- // shift of 63, for which int64_t{1} << 63 is INT64_MIN.
- if (CI->getSExtValue() < 0 || CI->getSExtValue() >= 63)
+ if (CI->getSExtValue() < 0 || CI->getSExtValue() >= 64)
return V;
auto Result = decompose(Op1, Info, IsSigned, DL);
if (!Result.mul(int64_t{1} << CI->getSExtValue()))
diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
index 2ef04eb6a337f..debf033c70c41 100644
--- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
+++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
@@ -287,16 +287,12 @@ static bool simplifyFunctionCFGImpl(Function &F, const TargetTransformInfo &TTI,
// iterate between the two optimizations. We structure the code like this to
// avoid rerunning iterativelySimplifyCFG if the second pass of
// removeUnreachableBlocks doesn't do anything.
- // Avoid scanning instructions to reduce compile-time.
- if (!removeUnreachableBlocks(F, DT ? &DTU : nullptr, /*MSSAU=*/nullptr,
- /*FoldInstsToUnreachable=*/false))
+ if (!removeUnreachableBlocks(F, DT ? &DTU : nullptr))
return true;
do {
EverChanged = iterativelySimplifyCFG(F, TTI, DT ? &DTU : nullptr, Options);
- EverChanged |=
- removeUnreachableBlocks(F, DT ? &DTU : nullptr, /*MSSAU=*/nullptr,
- /*FoldInstsToUnreachable=*/false);
+ EverChanged |= removeUnreachableBlocks(F, DT ? &DTU : nullptr);
} while (EverChanged);
return true;
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 6427b2a4fdd37..5c8d1a64ddf10 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -2683,7 +2683,7 @@ BasicBlock *llvm::changeToInvokeAndSplitBasicBlock(CallInst *CI,
}
static bool markAliveBlocks(Function &F, SmallVectorImpl<bool> &Reachable,
- DomTreeUpdater *DTU, bool FoldInstsToUnreachable) {
+ DomTreeUpdater *DTU = nullptr) {
SmallVector<BasicBlock*, 128> Worklist;
BasicBlock *BB = &F.front();
Worklist.push_back(BB);
@@ -2692,185 +2692,177 @@ static bool markAliveBlocks(Function &F, SmallVectorImpl<bool> &Reachable,
do {
BB = Worklist.pop_back_val();
- // Do a scan of the basic block, turning any obviously unreachable
+ // Do a quick scan of the basic block, turning any obviously unreachable
// instructions into LLVM unreachable insts. The instruction combining pass
// canonicalizes unreachable insts into stores to null or undef.
- // Note that it traverses the whole instruction list, so it may incur
- // significant performance overhead.
- if (FoldInstsToUnreachable) {
- for (Instruction &I : *BB) {
- if (auto *CI = dyn_cast<CallInst>(&I)) {
- Value *Callee = CI->getCalledOperand();
- // Handle intrinsic calls.
- if (Function *F = dyn_cast<Function>(Callee)) {
- auto IntrinsicID = F->getIntrinsicID();
- // Assumptions that are known to be false are equivalent to
- // unreachable. Also, if the condition is undefined, then we make
- // the choice most beneficial to the optimizer, and choose that to
- // also be unreachable.
- if (IntrinsicID == Intrinsic::assume) {
- if (match(CI->getArgOperand(0),
- m_CombineOr(m_Zero(), m_Undef()))) {
- // Don't insert a call to llvm.trap right before the
- // unreachable.
- changeToUnreachable(CI, false, DTU);
- Changed = true;
- break;
- }
- } else if (IntrinsicID == Intrinsic::experimental_guard) {
- // A call to the guard intrinsic bails out of the current
- // compilation unit if the predicate passed to it is false. If the
- // predicate is a constant false, then we know the guard will bail
- // out of the current compile unconditionally, so all code
- // following it is dead.
- //
- // Note: unlike in llvm.assume, it is not "obviously profitable"
- // for guards to treat `undef` as `false` since a guard on `undef`
- // can still be useful for widening.
- if (match(CI->getArgOperand(0), m_Zero()))
- if (!isa<UnreachableInst>(CI->getNextNode())) {
- changeToUnreachable(CI->getNextNode(), false, DTU);
- Changed = true;
- break;
- }
- }
- } else if ((isa<ConstantPointerNull>(Callee) &&
- !NullPointerIsDefined(CI->getFunction(),
- cast<PointerType>(Callee->getType())
- ->getAddressSpace())) ||
- isa<UndefValue>(Callee)) {
- changeToUnreachable(CI, false, DTU);
- Changed = true;
- break;
- }
- if (CI->doesNotReturn() && !CI->isMustTailCall()) {
- // If we found a call to a no-return function, insert an unreachable
- // instruction after it. Make sure there isn't *already* one there
- // though.
- if (!isa<UnreachableInst>(CI->getNextNode())) {
+ for (Instruction &I : *BB) {
+ if (auto *CI = dyn_cast<CallInst>(&I)) {
+ Value *Callee = CI->getCalledOperand();
+ // Handle intrinsic calls.
+ if (Function *F = dyn_cast<Function>(Callee)) {
+ auto IntrinsicID = F->getIntrinsicID();
+ // Assumptions that are known to be false are equivalent to
+ // unreachable. Also, if the condition is undefined, then we make the
+ // choice most beneficial to the optimizer, and choose that to also be
+ // unreachable.
+ if (IntrinsicID == Intrinsic::assume) {
+ if (match(CI->getArgOperand(0), m_CombineOr(m_Zero(), m_Undef()))) {
// Don't insert a call to llvm.trap right before the unreachable.
- changeToUnreachable(CI->getNextNode(), false, DTU);
+ changeToUnreachable(CI, false, DTU);
Changed = true;
+ break;
}
- break;
+ } else if (IntrinsicID == Intrinsic::experimental_guard) {
+ // A call to the guard intrinsic bails out of the current
+ // compilation unit if the predicate passed to it is false. If the
+ // predicate is a constant false, then we know the guard will bail
+ // out of the current compile unconditionally, so all code following
+ // it is dead.
+ //
+ // Note: unlike in llvm.assume, it is not "obviously profitable" for
+ // guards to treat `undef` as `false` since a guard on `undef` can
+ // still be useful for widening.
+ if (match(CI->getArgOperand(0), m_Zero()))
+ if (!isa<UnreachableInst>(CI->getNextNode())) {
+ changeToUnreachable(CI->getNextNode(), false, DTU);
+ Changed = true;
+ break;
+ }
}
- } else if (auto *SI = dyn_cast<StoreInst>(&I)) {
- // Store to undef and store to null are undefined and used to signal
- // that they should be changed to unreachable by passes that can't
- // modify the CFG.
-
- // Don't touch volatile stores.
- if (SI->isVolatile())
- continue;
-
- Value *Ptr = SI->getOperand(1);
-
- if (isa<UndefValue>(Ptr) ||
- (isa<ConstantPointerNull>(Ptr) &&
- !NullPointerIsDefined(SI->getFunction(),
- SI->getPointerAddressSpace()))) {
- changeToUnreachable(SI, false, DTU);
+ } else if ((isa<ConstantPointerNull>(Callee) &&
+ !NullPointerIsDefined(CI->getFunction(),
+ cast<PointerType>(Callee->getType())
+ ->getAddressSpace())) ||
+ isa<UndefValue>(Callee)) {
+ changeToUnreachable(CI, false, DTU);
+ Changed = true;
+ break;
+ }
+ if (CI->doesNotReturn() && !CI->isMustTailCall()) {
+ // If we found a call to a no-return function, insert an unreachable
+ // instruction after it. Make sure there isn't *already* one there
+ // though.
+ if (!isa<UnreachableInst>(CI->getNextNode())) {
+ // Don't insert a call to llvm.trap right before the unreachable.
+ changeToUnreachable(CI->getNextNode(), false, DTU);
Changed = true;
- break;
}
+ break;
}
- }
+ } else if (auto *SI = dyn_cast<StoreInst>(&I)) {
+ // Store to undef and store to null are undefined and used to signal
+ // that they should be changed to unreachable by passes that can't
+ // modify the CFG.
+
+ // Don't touch volatile stores.
+ if (SI->isVolatile()) continue;
+
+ Value *Ptr = SI->getOperand(1);
- Instruction *Terminator = BB->getTerminator();
- if (auto *II = dyn_cast<InvokeInst>(Terminator)) {
- // Turn invokes that call 'nounwind' functions into ordinary calls.
- Value *Callee = II->getCalledOperand();
- if ((isa<ConstantPointerNull>(Callee) &&
- !NullPointerIsDefined(BB->getParent())) ||
- isa<UndefValue>(Callee)) {
- changeToUnreachable(II, false, DTU);
+ if (isa<UndefValue>(Ptr) ||
+ (isa<ConstantPointerNull>(Ptr) &&
+ !NullPointerIsDefined(SI->getFunction(),
+ SI->getPointerAddressSpace()))) {
+ changeToUnreachable(SI, false, DTU);
Changed = true;
- } else {
- if (II->doesNotReturn() &&
- !isa<UnreachableInst>(II->getNormalDest()->front())) {
- // If we found an invoke of a no-return function,
- // create a new empty basic block with an `unreachable` terminator,
- // and set it as the normal destination for the invoke,
- // unless that is already the case.
- // Note that the original normal destination could have other uses.
- BasicBlock *OrigNormalDest = II->getNormalDest();
- OrigNormalDest->removePredecessor(II->getParent());
- LLVMContext &Ctx = II->getContext();
- BasicBlock *UnreachableNormalDest = BasicBlock::Create(
- Ctx, OrigNormalDest->getName() + ".unreachable",
- II->getFunction(), OrigNormalDest);
- Reachable.resize(II->getFunction()->getMaxBlockNumber());
- auto *UI = new UnreachableInst(Ctx, UnreachableNormalDest);
- UI->setDebugLoc(DebugLoc::getTemporary());
- II->setNormalDest(UnreachableNormalDest);
- if (DTU)
- DTU->applyUpdates(
- {{DominatorTree::Delete, BB, OrigNormalDest},
- {DominatorTree::Insert, BB, UnreachableNormalDest}});
- Changed = true;
- }
- if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(&F)) {
- if (II->use_empty() && !II->mayHaveSideEffects()) {
- // jump to the normal destination branch.
- BasicBlock *NormalDestBB = II->getNormalDest();
- BasicBlock *UnwindDestBB = II->getUnwindDest();
- UncondBrInst::Create(NormalDestBB, II->getIterator());
- UnwindDestBB->removePredecessor(II->getParent());
- II->eraseFromParent();
- if (DTU)
- DTU->applyUpdates({{DominatorTree::Delete, BB, UnwindDestBB}});
- } else
- changeToCall(II, DTU);
- Changed = true;
- }
+ break;
}
- } else if (auto *CatchSwitch = dyn_cast<CatchSwitchInst>(Terminator)) {
- // Remove catchpads which cannot be reached.
- struct CatchPadDenseMapInfo {
- static unsigned getHashValue(CatchPadInst *CatchPad) {
- return static_cast<unsigned>(hash_combine_range(
- CatchPad->value_op_begin(), CatchPad->value_op_end()));
- }
+ }
+ }
- static bool isEqual(CatchPadInst *LHS, CatchPadInst *RHS) {
- return LHS->isIdenticalTo(RHS);
- }
- };
-
- SmallDenseMap<BasicBlock *, int, 8> NumPerSuccessorCases;
- // Set of unique CatchPads.
- SmallDenseMap<CatchPadInst *, detail::DenseSetEmpty, 4,
- CatchPadDenseMapInfo,
- detail::DenseSetPair<CatchPadInst *>>
- HandlerSet;
- detail::DenseSetEmpty Empty;
- for (CatchSwitchInst::handler_iterator I = CatchSwitch->handler_begin(),
- E = CatchSwitch->handler_end();
- I != E; ++I) {
- BasicBlock *HandlerBB = *I;
+ Instruction *Terminator = BB->getTerminator();
+ if (auto *II = dyn_cast<InvokeInst>(Terminator)) {
+ // Turn invokes that call 'nounwind' functions into ordinary calls.
+ Value *Callee = II->getCalledOperand();
+ if ((isa<ConstantPointerNull>(Callee) &&
+ !NullPointerIsDefined(BB->getParent())) ||
+ isa<UndefValue>(Callee)) {
+ changeToUnreachable(II, false, DTU);
+ Changed = true;
+ } else {
+ if (II->doesNotReturn() &&
+ !isa<UnreachableInst>(II->getNormalDest()->front())) {
+ // If we found an invoke of a no-return function,
+ // create a new empty basic block with an `unreachable` terminator,
+ // and set it as the normal destination for the invoke,
+ // unless that is already the case.
+ // Note that the original normal destination could have other uses.
+ BasicBlock *OrigNormalDest = II->getNormalDest();
+ OrigNormalDest->removePredecessor(II->getParent());
+ LLVMContext &Ctx = II->getContext();
+ BasicBlock *UnreachableNormalDest = BasicBlock::Create(
+ Ctx, OrigNormalDest->getName() + ".unreachable",
+ II->getFunction(), OrigNormalDest);
+ Reachable.resize(II->getFunction()->getMaxBlockNumber());
+ auto *UI = new UnreachableInst(Ctx, UnreachableNormalDest);
+ UI->setDebugLoc(DebugLoc::getTemporary());
+ II->setNormalDest(UnreachableNormalDest);
if (DTU)
- ++NumPerSuccessorCases[HandlerBB];
- auto *CatchPad = cast<CatchPadInst>(HandlerBB->getFirstNonPHIIt());
- if (!HandlerSet.insert({CatchPad, Empty}).second) {
- if (DTU)
- --NumPerSuccessorCases[HandlerBB];
- CatchSwitch->removeHandler(I);
- --I;
- --E;
- Changed = true;
- }
+ DTU->applyUpdates(
+ {{DominatorTree::Delete, BB, OrigNormalDest},
+ {DominatorTree::Insert, BB, UnreachableNormalDest}});
+ Changed = true;
}
- if (DTU) {
- std::vector<DominatorTree::UpdateType> Updates;
- for (const std::pair<BasicBlock *, int> &I : NumPerSuccessorCases)
- if (I.second == 0)
- Updates.push_back({DominatorTree::Delete, BB, I.first});
- DTU->applyUpdates(Updates);
+ if (II->doesNotThrow() && canSimplifyInvokeNoUnwind(&F)) {
+ if (II->use_empty() && !II->mayHaveSideEffects()) {
+ // jump to the normal destination branch.
+ BasicBlock *NormalDestBB = II->getNormalDest();
+ BasicBlock *UnwindDestBB = II->getUnwindDest();
+ UncondBrInst::Create(NormalDestBB, II->getIterator());
+ UnwindDestBB->removePredecessor(II->getParent());
+ II->eraseFromParent();
+ if (DTU)
+ DTU->applyUpdates({{DominatorTree::Delete, BB, UnwindDestBB}});
+ } else
+ changeToCall(II, DTU);
+ Changed = true;
}
}
+ } else if (auto *CatchSwitch = dyn_cast<CatchSwitchInst>(Terminator)) {
+ // Remove catchpads which cannot be reached.
+ struct CatchPadDenseMapInfo {
+ static unsigned getHashValue(CatchPadInst *CatchPad) {
+ return static_cast<unsigned>(hash_combine_range(
+ CatchPad->value_op_begin(), CatchPad->value_op_end()));
+ }
- Changed |= ConstantFoldTerminator(BB, true, nullptr, DTU);
+ static bool isEqual(CatchPadInst *LHS, CatchPadInst *RHS) {
+ return LHS->isIdenticalTo(RHS);
+ }
+ };
+
+ SmallDenseMap<BasicBlock *, int, 8> NumPerSuccessorCases;
+ // Set of unique CatchPads.
+ SmallDenseMap<CatchPadInst *, detail::DenseSetEmpty, 4,
+ CatchPadDenseMapInfo, detail::DenseSetPair<CatchPadInst *>>
+ HandlerSet;
+ detail::DenseSetEmpty Empty;
+ for (CatchSwitchInst::handler_iterator I = CatchSwitch->handler_begin(),
+ E = CatchSwitch->handler_end();
+ I != E; ++I) {
+ BasicBlock *HandlerBB = *I;
+ if (DTU)
+ ++NumPerSuccessorCases[HandlerBB];
+ auto *CatchPad = cast<CatchPadInst>(HandlerBB->getFirstNonPHIIt());
+ if (!HandlerSet.insert({CatchPad, Empty}).second) {
+ if (DTU)
+ --NumPerSuccessorCases[HandlerBB];
+ CatchSwitch->removeHandler(I);
+ --I;
+ --E;
+ Changed = true;
+ }
+ }
+ if (DTU) {
+ std::vector<DominatorTree::UpdateType> Updates;
+ for (const std::pair<BasicBlock *, int> &I : NumPerSuccessorCases)
+ if (I.second == 0)
+ Updates.push_back({DominatorTree::Delete, BB, I.first});
+ DTU->applyUpdates(Updates);
+ }
}
+
+ Changed |= ConstantFoldTerminator(BB, true, nullptr, DTU);
for (BasicBlock *Successor : successors(BB)) {
if (!Reachable[Successor->getNumber()]) {
Worklist.push_back(Successor);
@@ -2920,10 +2912,9 @@ Instruction *llvm::removeUnwindEdge(BasicBlock *BB, DomTreeUpdater *DTU) {
/// if they are in a dead cycle. Return true if a change was made, false
/// otherwise.
bool llvm::removeUnreachableBlocks(Function &F, DomTreeUpdater *DTU,
- MemorySSAUpdater *MSSAU,
- bool FoldInstsToUnreachable) {
+ MemorySSAUpdater *MSSAU) {
SmallVector<bool, 16> Reachable(F.getMaxBlockNumber());
- bool Changed = markAliveBlocks(F, Reachable, DTU, FoldInstsToUnreachable);
+ bool Changed = markAliveBlocks(F, Reachable, DTU);
// Are there any blocks left to actually delete?
SmallSetVector<BasicBlock *, 8> BlocksToRemove;
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 3c65eda187a6e..28237c7d037d4 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -1417,7 +1417,7 @@ class LoopVectorizationCostModel {
/// Holds the instructions (address computations) that are forced to be
/// scalarized.
- DenseMap<ElementCount, SmallSetVector<Instruction *, 4>> ForcedScalars;
+ DenseMap<ElementCount, SmallPtrSet<Instruction *, 4>> ForcedScalars;
/// Returns the expected difference in cost from scalarizing the expression
/// feeding a predicated instruction \p PredInst. The instructions to
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index a04877d183516..444c5937f15b2 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -4633,28 +4633,8 @@ class slpvectorizer::BoUpSLP {
IsCommutativeUser && User->getOperand(0) == User->getOperand(1);
if ((!IsCommutativeUser || IsCommutativeWithSameOps) &&
!isa<CmpInst>(User)) {
- if (CurNumOps != NumOps)
- continue;
- // A reassociated node flattens the operand chain, so the operand
- // may be placed in any operand column rather than at the
- // instruction's operand number.
- if (TE->hasReassocScalars()) {
- bool ReplacedByCopyable = false;
- for (auto It = find(TE->Scalars, User); It != TE->Scalars.end();
- It = find(make_range(std::next(It), TE->Scalars.end()),
- User)) {
- int Lane = std::distance(TE->Scalars.begin(), It);
- for (unsigned OpIdx : seq<unsigned>(TE->getNumOperands()))
- ReplacedByCopyable |=
- TE->getOperand(OpIdx)[Lane] == Op &&
- getScheduleCopyableData(EdgeInfo(TE, OpIdx), Op);
- }
- if (ReplacedByCopyable)
- continue;
- return false;
- }
EdgeInfo EI(TE, U.getOperandNo());
- if (getScheduleCopyableData(EI, Op))
+ if (CurNumOps != NumOps || getScheduleCopyableData(EI, Op))
continue;
return false;
}
@@ -18698,22 +18678,9 @@ InstructionCost BoUpSLP::getSpillCost() {
if (ScalarOrPseudoEntries.contains(Op))
continue;
if (Entry->State == TreeEntry::SplitVectorize ||
+ (Entry->getOpcode() != Instruction::PHI && Op->isGather()) ||
(Op->isGather() && allConstant(Op->Scalars)))
continue;
- // A gather with all loop-invariant lanes is hoisted to the loop
- // preheader by optimizeGatherSequence, so its vector value becomes live
- // across any non-vectorized call in the loop body. Charge it like any
- // other vectorized value live over a call instead of skipping it.
- if (Entry->hasState() && Entry->getOpcode() != Instruction::PHI &&
- Op->isGather()) {
- if (const Loop *L = LI->getLoopFor(Parent);
- L && L->getLoopPreheader() && LoopBodyHasCall(L) &&
- all_of(Op->Scalars, [&](Value *V) {
- return !isa<Instruction>(V) || L->isLoopInvariant(V);
- }))
- AddCosts(Op);
- continue;
- }
Budget = 0;
BasicBlock *Pred = nullptr;
if (auto *Phi = dyn_cast<PHINode>(Entry->getMainOp()))
@@ -25948,8 +25915,10 @@ void BoUpSLP::optimizeGatherSequence() {
SmallVector<const DomTreeNode *, 8> CSEWorkList;
CSEWorkList.reserve(CSEBlocks.size());
for (BasicBlock *BB : CSEBlocks)
- if (DomTreeNode *N = DT->getNode(BB))
+ if (DomTreeNode *N = DT->getNode(BB)) {
+ assert(DT->isReachableFromEntry(N));
CSEWorkList.push_back(N);
+ }
// Sort blocks by domination. This ensures we visit a block after all blocks
// dominating it are visited.
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index f077932cf7217..5b53312c3ebda 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -1077,14 +1077,14 @@ InstructionCost VPlan::cost(ElementCount VF, VPCostContext &Ctx) {
return Cost;
}
-VPRegionBlock *VPlan::getVectorLoopRegion() {
- // Find the vector loop region by following the last successor of each block,
- // starting from the plan's entry. The vector code path is always the last
- // successor of the entry (and of the min-iters bypass block, if present), and
- // every block on the path to the region has a single predecessor. Stop at the
- // first block with multiple predecessors: in a plain CFG that is the loop
- // header (no region exists yet), and in a rolled CFG it is the middle block
- // following the region.
+// Find the vector loop region by following the last successor of each block,
+// starting from the plan's entry. The vector code path is always the last
+// successor of the entry (and of the min-iters bypass block, if present), and
+// every block on the path to the region has a single predecessor. Stop at the
+// first block with multiple predecessors: in a plain CFG that is the loop
+// header (no region exists yet), and in a rolled CFG it is the middle block
+// following the region.
+static VPRegionBlock *findVectorLoopRegion(VPBlockBase *Entry) {
for (VPBlockBase *B = Entry; B && B->getNumPredecessors() <= 1;
B = B->hasSuccessors() ? B->getSuccessors().back() : nullptr)
if (auto *R = dyn_cast<VPRegionBlock>(B))
@@ -1092,6 +1092,26 @@ VPRegionBlock *VPlan::getVectorLoopRegion() {
return nullptr;
}
+#ifdef EXPENSIVE_CHECKS
+// Reference lookup that scans every top-level block. Used only to validate
+// findVectorLoopRegion() when the invariants of the last-successor walk change.
+static VPRegionBlock *findVectorLoopRegionByScan(VPBlockBase *Entry) {
+ for (VPBlockBase *B : vp_depth_first_shallow(Entry))
+ if (auto *R = dyn_cast<VPRegionBlock>(B))
+ return R->isReplicator() ? nullptr : R;
+ return nullptr;
+}
+#endif
+
+VPRegionBlock *VPlan::getVectorLoopRegion() {
+ VPRegionBlock *LoopRegion = findVectorLoopRegion(getEntry());
+#ifdef EXPENSIVE_CHECKS
+ assert(LoopRegion == findVectorLoopRegionByScan(getEntry()) &&
+ "fast vector loop region lookup disagrees with full CFG scan");
+#endif
+ return LoopRegion;
+}
+
const VPRegionBlock *VPlan::getVectorLoopRegion() const {
return const_cast<VPlan *>(this)->getVectorLoopRegion();
}
diff --git a/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp b/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
index 4c09e10fe6ea0..421478c85c188 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
@@ -792,14 +792,13 @@ static bool hoistPreviousBeforeFORUsers(VPFirstOrderRecurrencePHIRecipe *FOR,
if (!HoistPoint || VPDT.properlyDominates(R, HoistPoint))
HoistPoint = R;
}
- // Dominance is only a partial order, so the users of FOR may not have a
- // single user dominating all others. Bail out in that case.
- if (!HoistPoint || HoistPoint->isPhi() ||
- any_of(FOR->users(), [&VPDT, HoistPoint](VPUser *U) {
- auto *R = cast<VPRecipeBase>(U);
- return HoistPoint != R && !VPDT.properlyDominates(HoistPoint, R);
- }))
- return false;
+ assert(all_of(FOR->users(),
+ [&VPDT, HoistPoint](VPUser *U) {
+ auto *R = cast<VPRecipeBase>(U);
+ return HoistPoint == R ||
+ VPDT.properlyDominates(HoistPoint, R);
+ }) &&
+ "HoistPoint must dominate all users of FOR");
auto NeedsHoisting = [HoistPoint, &VPDT,
&Visited](VPValue *HoistCandidateV) -> VPRecipeBase * {
@@ -848,13 +847,6 @@ static bool hoistPreviousBeforeFORUsers(VPFirstOrderRecurrencePHIRecipe *FOR,
}
}
- // Moving a candidate to HoistPoint keeps it dominating its other users only
- // if HoistPoint dominates the candidate's current position.
- if (any_of(HoistCandidates, [&VPDT, HoistPoint](VPRecipeBase *R) {
- return !VPDT.properlyDominates(HoistPoint, R);
- }))
- return false;
-
// Order recipes to hoist by dominance so earlier instructions are processed
// first.
sort(HoistCandidates, [&VPDT](const VPRecipeBase *A, const VPRecipeBase *B) {
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index a5343caccc992..ca63d1498316b 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -911,7 +911,7 @@ Value *VPInstruction::generate(VPTransformState &State) {
Value *Res = PoisonValue::get(toVectorizedTy(ScalarTy, NumOfElements));
for (const auto &[Idx, Op] : enumerate(operands()))
Res = Builder.CreateInsertElement(Res, State.get(Op, true),
- Builder.getInt64(Idx));
+ Builder.getInt32(Idx));
return Res;
}
case VPInstruction::ReductionStartVector: {
@@ -925,7 +925,7 @@ Value *VPInstruction::generate(VPTransformState &State) {
cast<VPConstantInt>(getOperand(2))->getZExtValue());
auto *Iden = Builder.CreateVectorSplat(VF, State.get(getOperand(1), true));
return Builder.CreateInsertElement(Iden, State.get(getOperand(0), true),
- Builder.getInt64(0));
+ Builder.getInt32(0));
}
case VPInstruction::ComputeReductionResult: {
RecurKind RK = getRecurKind();
diff --git a/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp b/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
index ecf5fea92f4df..a4d6cc0ecb480 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
@@ -483,19 +483,7 @@ bool VPlanVerifier::verify(const VPlan &Plan) {
[this](const VPBlockBase *VPB) { return !verifyBlock(VPB); }))
return false;
- // Check that the plan has a single loop region reachable from entry, and it
- // matches the one returned by getVectorLoopRegion.
const VPRegionBlock *TopRegion = Plan.getVectorLoopRegion();
- if (any_of(VPBlockUtils::blocksOnly<const VPRegionBlock>(
- vp_depth_first_shallow(Plan.getEntry())),
- [TopRegion](const VPRegionBlock *R) {
- return !R->isReplicator() && R != TopRegion;
- })) {
- errs() << "VPlan must have a single top-level loop region, reachable from "
- "the entry by following the last successor of each block\n";
- return false;
- }
-
// TODO: Verify all blocks using vp_depth_first_deep iterators.
if (!TopRegion)
return true;
@@ -537,13 +525,6 @@ bool VPlanVerifier::verify(const VPlan &Plan) {
}
bool llvm::verifyVPlanIsValid(const VPlan &Plan) {
- // The entry must be the root of the plan's top-level CFG: the dominator tree
- // constructed below and the verifier's block walks all start there.
- if (Plan.getEntry()->hasPredecessors()) {
- errs() << "VPlan entry block has predecessors\n";
- return false;
- }
-
VPDominatorTree VPDT(const_cast<VPlan &>(Plan));
VPlanVerifier Verifier(VPDT);
return Verifier.verify(Plan);
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/knownbits-rotl-rotr.mir b/llvm/test/CodeGen/AArch64/GlobalISel/knownbits-rotl-rotr.mir
index 74d2b0ac0eb36..004484ff1f5ac 100644
--- a/llvm/test/CodeGen/AArch64/GlobalISel/knownbits-rotl-rotr.mir
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/knownbits-rotl-rotr.mir
@@ -232,53 +232,11 @@ body: |
; CHECK-NEXT: %0:_ KnownBits:???????? SignBits:1
; CHECK-NEXT: %1:_ KnownBits:???????????????? SignBits:9
; CHECK-NEXT: %2:_ KnownBits:0000000000001101 SignBits:12
- ; CHECK-NEXT: %3:_ KnownBits:???????????????? SignBits:6
- %0:_(i8) = COPY $b0
- %1:_(i16) = G_SEXT %0(i8)
- %2:_(i16) = G_CONSTANT i16 13
- %3:_(i16) = G_ROTR %1, %2
-...
----
-name: ROTLless
-body: |
- bb.1:
- ; CHECK-LABEL: name: @ROTLless
- ; CHECK-NEXT: %0:_ KnownBits:???????? SignBits:1
- ; CHECK-NEXT: %1:_ KnownBits:???????????????? SignBits:9
- ; CHECK-NEXT: %2:_ KnownBits:0000000000001101 SignBits:12
; CHECK-NEXT: %3:_ KnownBits:???????????????? SignBits:1
%0:_(i8) = COPY $b0
%1:_(i16) = G_SEXT %0(i8)
%2:_(i16) = G_CONSTANT i16 13
- %3:_(i16) = G_ROTL %1, %2
-...
----
-name: ROTLeq
-body: |
- bb.1:
- ; CHECK-LABEL: name: @ROTLeq
- ; CHECK-NEXT: %0:_ KnownBits:???????? SignBits:1
- ; CHECK-NEXT: %1:_ KnownBits:???????????????? SignBits:9
- ; CHECK-NEXT: %2:_ KnownBits:0000000000001000 SignBits:12
- ; CHECK-NEXT: %3:_ KnownBits:???????????????? SignBits:1
- %0:_(i8) = COPY $b0
- %1:_(i16) = G_SEXT %0(i8)
- %2:_(i16) = G_CONSTANT i16 8
- %3:_(i16) = G_ROTL %1, %2
-...
----
-name: ROTLmore
-body: |
- bb.1:
- ; CHECK-LABEL: name: @ROTLmore
- ; CHECK-NEXT: %0:_ KnownBits:???????? SignBits:1
- ; CHECK-NEXT: %1:_ KnownBits:???????????????? SignBits:9
- ; CHECK-NEXT: %2:_ KnownBits:0000000000000011 SignBits:14
- ; CHECK-NEXT: %3:_ KnownBits:???????????????? SignBits:6
- %0:_(i8) = COPY $b0
- %1:_(i16) = G_SEXT %0(i8)
- %2:_(i16) = G_CONSTANT i16 3
- %3:_(i16) = G_ROTL %1, %2
+ %3:_(i16) = G_ROTR %1, %2
...
---
name: SignBitsThroughZext
@@ -310,27 +268,3 @@ body: |
%1:_(i8) = G_CONSTANT i8 2
%2:_(i8) = G_ROTL %0, %1
...
----
-name: RotateAllOnesUnknownAmtROTR
-body: |
- bb.1:
- ; CHECK-LABEL: name: @RotateAllOnesUnknownAmtROTR
- ; CHECK-NEXT: %0:_ KnownBits:11111111 SignBits:8
- ; CHECK-NEXT: %1:_ KnownBits:???????? SignBits:1
- ; CHECK-NEXT: %2:_ KnownBits:???????? SignBits:8
- %0:_(i8) = G_CONSTANT i8 255
- %1:_(i8) = COPY $b0
- %2:_(i8) = G_ROTR %0, %1
-...
----
-name: RotateAllZerosUnknownAmtROTL
-body: |
- bb.1:
- ; CHECK-LABEL: name: @RotateAllZerosUnknownAmtROTL
- ; CHECK-NEXT: %0:_ KnownBits:00000000 SignBits:8
- ; CHECK-NEXT: %1:_ KnownBits:???????? SignBits:1
- ; CHECK-NEXT: %2:_ KnownBits:???????? SignBits:8
- %0:_(i8) = G_CONSTANT i8 0
- %1:_(i8) = COPY $b0
- %2:_(i8) = G_ROTL %0, %1
-...
diff --git a/llvm/test/CodeGen/AArch64/sve-fdiv-int-fold.ll b/llvm/test/CodeGen/AArch64/sve-fdiv-int-fold.ll
new file mode 100644
index 0000000000000..da5e1d8ab633a
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/sve-fdiv-int-fold.ll
@@ -0,0 +1,49 @@
+; RUN: llc -mtriple=aarch64 -mattr=+sve < %s | FileCheck %s
+
+; --- Unsigned Division (UDIV) ---
+
+define <vscale x 4 x i32> @fptoui_fdiv_uitofp_v4i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
+; CHECK-LABEL: fptoui_fdiv_uitofp_v4i32:
+; CHECK: udiv z{{[0-9]+}}.s, p{{[0-9]+}}/m, z{{[0-9]+}}.s, z{{[0-9]+}}.s
+; CHECK: ret
+ %fa = uitofp <vscale x 4 x i32> %a to <vscale x 4 x float>
+ %fb = uitofp <vscale x 4 x i32> %b to <vscale x 4 x float>
+ %fdiv = fdiv <vscale x 4 x float> %fa, %fb
+ %res = fptoui <vscale x 4 x float> %fdiv to <vscale x 4 x i32>
+ ret <vscale x 4 x i32> %res
+}
+
+define <vscale x 2 x i64> @fptoui_fdiv_uitofp_v2i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %b) {
+; CHECK-LABEL: fptoui_fdiv_uitofp_v2i64:
+; CHECK: udiv z{{[0-9]+}}.d, p{{[0-9]+}}/m, z{{[0-9]+}}.d, z{{[0-9]+}}.d
+; CHECK: ret
+ %fa = uitofp <vscale x 2 x i64> %a to <vscale x 2 x double>
+ %fb = uitofp <vscale x 2 x i64> %b to <vscale x 2 x double>
+ %fdiv = fdiv <vscale x 2 x double> %fa, %fb
+ %res = fptoui <vscale x 2 x double> %fdiv to <vscale x 2 x i64>
+ ret <vscale x 2 x i64> %res
+}
+
+; --- Signed Division (SDIV) ---
+
+define <vscale x 4 x i32> @fptosi_fdiv_sitofp_v4i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
+; CHECK-LABEL: fptosi_fdiv_sitofp_v4i32:
+; CHECK: sdiv z{{[0-9]+}}.s, p{{[0-9]+}}/m, z{{[0-9]+}}.s, z{{[0-9]+}}.s
+; CHECK: ret
+ %fa = sitofp <vscale x 4 x i32> %a to <vscale x 4 x float>
+ %fb = sitofp <vscale x 4 x i32> %b to <vscale x 4 x float>
+ %fdiv = fdiv <vscale x 4 x float> %fa, %fb
+ %res = fptosi <vscale x 4 x float> %fdiv to <vscale x 4 x i32>
+ ret <vscale x 4 x i32> %res
+}
+
+define <vscale x 2 x i64> @fptosi_fdiv_sitofp_v2i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %b) {
+; CHECK-LABEL: fptosi_fdiv_sitofp_v2i64:
+; CHECK: sdiv z{{[0-9]+}}.d, p{{[0-9]+}}/m, z{{[0-9]+}}.d, z{{[0-9]+}}.d
+; CHECK: ret
+ %fa = sitofp <vscale x 2 x i64> %a to <vscale x 2 x double>
+ %fb = sitofp <vscale x 2 x i64> %b to <vscale x 2 x double>
+ %fdiv = fdiv <vscale x 2 x double> %fa, %fb
+ %res = fptosi <vscale x 2 x double> %fdiv to <vscale x 2 x i64>
+ ret <vscale x 2 x i64> %res
+}
\ No newline at end of file
diff --git a/llvm/test/CodeGen/SPIRV/GlobalISel/InstCombine/prelegalizercombiner-select-to-faceforward.mir b/llvm/test/CodeGen/SPIRV/GlobalISel/InstCombine/prelegalizercombiner-select-to-faceforward.mir
index 0d160319b1dba..7ca8e1439610b 100644
--- a/llvm/test/CodeGen/SPIRV/GlobalISel/InstCombine/prelegalizercombiner-select-to-faceforward.mir
+++ b/llvm/test/CodeGen/SPIRV/GlobalISel/InstCombine/prelegalizercombiner-select-to-faceforward.mir
@@ -195,70 +195,4 @@ body: |
%12:_(<4 x s32>) = G_FNEG %0:vfid
%13:id(<4 x s32>) = G_SELECT %11:_(s1), %12:_, %0:vfid
OpReturnValue %13:id(<4 x s32>)
----
-name: faceforward_instcombine_float_shared_condition
-tracksRegLiveness: true
-legalized: true
-body: |
- bb.1.entry:
- ; CHECK-LABEL: name: faceforward_instcombine_float_shared_condition
- ; CHECK: %7:_(s32) = G_FMUL %3, %4
- ; CHECK: %8:_(s1) = G_FCMP floatpred(olt), %7(s32), %6
- ; CHECK: %10:id(s32) = G_INTRINSIC intrinsic(@llvm.spv.faceforward), %2(s32), %3(s32), %4(s32)
- ; CHECK: %11:id(s32) = G_SELECT %8(s1), %3, %4
- ; CHECK: %12:id(s32) = G_FADD %10, %11
- ; CHECK: OpReturnValue %12(s32)
- %3:type(s64) = OpTypeFloat 32
- %5:type(s64) = OpTypeFunction %3:type(s64), %3:type(s64), %3:type(s64), %3:type(s64)
- OpName %0:fid(s32), 97
- OpName %1:fid(s32), 98
- OpName %2:fid(s32), 99
- %4:iid(s64) = OpFunction %3:type(s64), 0, %5:type(s64)
- %0:fid(s32) = OpFunctionParameter %3:type(s64)
- %1:fid(s32) = OpFunctionParameter %3:type(s64)
- %2:fid(s32) = OpFunctionParameter %3:type(s64)
- OpName %4:iid(s64), 1701011814, 2003988326, 1600418401, 1953721961, 1651339107, 1600482921, 1634692198, 1752391540, 1684370017, 1852793695, 1769236836, 28271
- %9:_(s32) = G_FCONSTANT float 0.000000e+00
- %8:_(s32) = G_FMUL %1:fid, %2:fid
- %10:_(s1) = G_FCMP floatpred(olt), %8:_(s32), %9:_
- %11:_(s32) = G_FNEG %0:fid
- %12:id(s32) = G_SELECT %10:_(s1), %0:fid, %11:_
- %13:id(s32) = G_SELECT %10:_(s1), %1:fid, %2:fid
- %14:id(s32) = G_FADD %12:id, %13:id
- OpReturnValue %14:id(s32)
-...
----
-name: faceforward_instcombine_float4_shared_dot
-tracksRegLiveness: true
-legalized: true
-body: |
- bb.1.entry:
- ; CHECK-LABEL: name: faceforward_instcombine_float4_shared_dot
- ; CHECK: %8:_(s32) = G_INTRINSIC intrinsic(@llvm.spv.fdot), %4(<4 x s32>), %5(<4 x s32>)
- ; CHECK: %11:id(<4 x s32>) = G_INTRINSIC intrinsic(@llvm.spv.faceforward), %3(<4 x s32>), %4(<4 x s32>), %5(<4 x s32>)
- ; CHECK: %13:_(s1) = G_FCMP floatpred(ogt), %8(s32), %12
- ; CHECK: %14:id(<4 x s32>) = G_SELECT %13(s1), %4, %5
- ; CHECK: %15:id(<4 x s32>) = G_FADD %11, %14
- ; CHECK: OpReturnValue %15(<4 x s32>)
- %4:type(s64) = OpTypeVector %3:type(s64), 4
- %6:type(s64) = OpTypeFunction %4:type(s64), %4:type(s64), %4:type(s64), %4:type(s64)
- %3:type(s64) = OpTypeFloat 32
- OpName %0:vfid(<4 x s32>), 97
- OpName %1:vfid(<4 x s32>), 98
- OpName %2:vfid(<4 x s32>), 99
- %5:iid(s64) = OpFunction %4:type(s64), 0, %6:type(s64)
- %0:vfid(<4 x s32>) = OpFunctionParameter %4:type(s64)
- %1:vfid(<4 x s32>) = OpFunctionParameter %4:type(s64)
- %2:vfid(<4 x s32>) = OpFunctionParameter %4:type(s64)
- OpName %5:iid(s64), 1701011814, 2003988326, 1600418401, 1953721961, 1651339107, 1600482921, 1634692198, 1935619188, 1701994856, 1868848996, 116
- %10:_(s32) = G_FCONSTANT float 0.000000e+00
- %9:_(s32) = G_INTRINSIC intrinsic(@llvm.spv.fdot), %1:vfid(<4 x s32>), %2:vfid(<4 x s32>)
- %11:_(s1) = G_FCMP floatpred(olt), %9:_(s32), %10:_
- %13:_(<4 x s32>) = G_FNEG %0:vfid
- %14:id(<4 x s32>) = G_SELECT %11:_(s1), %0:vfid, %13:_
- %12:_(s32) = G_FCONSTANT float 5.000000e+00
- %17:_(s1) = G_FCMP floatpred(ogt), %9:_(s32), %12:_
- %15:id(<4 x s32>) = G_SELECT %17:_(s1), %1:vfid, %2:vfid
- %16:id(<4 x s32>) = G_FADD %14:id, %15:id
- OpReturnValue %16:id(<4 x s32>)
-...
+
diff --git a/llvm/test/CodeGen/SPIRV/hlsl-intrinsics/faceforward.ll b/llvm/test/CodeGen/SPIRV/hlsl-intrinsics/faceforward.ll
index 1a6231e3a39c6..f7aa42a53de8a 100644
--- a/llvm/test/CodeGen/SPIRV/hlsl-intrinsics/faceforward.ll
+++ b/llvm/test/CodeGen/SPIRV/hlsl-intrinsics/faceforward.ll
@@ -148,24 +148,6 @@ entry:
ret <4 x float> %select
}
-define internal float @faceforward_instcombine_float_shared_dot_store(float %a, float %b, float %c, ptr %out) {
-entry:
- ; CHECK: %[[#]] = OpFunction %[[#float_32]] None %[[#]]
- ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#float_32]]
- ; CHECK: %[[#arg1:]] = OpFunctionParameter %[[#float_32]]
- ; CHECK: %[[#arg2:]] = OpFunctionParameter %[[#float_32]]
- ; CHECK: %[[#arg3:]] = OpFunctionParameter %[[#]]
- ; CHECK: %[[#dot:]] = OpFMul %[[#float_32]] %[[#arg1]] %[[#arg2]]
- ; CHECK: %[[#]] = OpExtInst %[[#float_32]] %[[#op_ext_glsl]] FaceForward %[[#arg0]] %[[#arg1]] %[[#arg2]]
- ; CHECK: OpStore %[[#arg3]] %[[#dot]]
- %fmul = fmul float %b, %c
- %fcmp = fcmp olt float %fmul, 0.000000e+00
- %fneg = fneg float %a
- %select = select i1 %fcmp, float %a, float %fneg
- store float %fmul, ptr %out, align 4
- ret float %select
-}
-
; The other functions are the test, but a entry point is required to have a valid SPIR-V module.
define void @main() #1 {
entry:
diff --git a/llvm/test/CodeGen/X86/avx512bf16-intrinsics.ll b/llvm/test/CodeGen/X86/avx512bf16-intrinsics.ll
index ea0be592de710..a5767ecf14a53 100644
--- a/llvm/test/CodeGen/X86/avx512bf16-intrinsics.ll
+++ b/llvm/test/CodeGen/X86/avx512bf16-intrinsics.ll
@@ -35,22 +35,6 @@ entry:
ret <8 x i64> %3
}
-; concatenation test for swapped operands
-define <8 x i64> @test_mm512_cvtne2ps2bf16_512_concat(<16 x float> %A, <16 x float> %B) {
-; CHECK-LABEL: test_mm512_cvtne2ps2bf16_512_concat:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: vcvtneps2bf16 %zmm0, %ymm0 # encoding: [0x62,0xf2,0x7e,0x48,0x72,0xc0]
-; CHECK-NEXT: vcvtneps2bf16 %zmm1, %ymm1 # encoding: [0x62,0xf2,0x7e,0x48,0x72,0xc9]
-; CHECK-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0 # encoding: [0x62,0xf3,0xfd,0x48,0x1a,0xc1,0x01]
-; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
-entry:
- %0 = tail call <16 x bfloat> @llvm.x86.avx512bf16.cvtneps2bf16.512(<16 x float> %A)
- %1 = tail call <16 x bfloat> @llvm.x86.avx512bf16.cvtneps2bf16.512(<16 x float> %B)
- %2 = shufflevector <16 x bfloat> %0, <16 x bfloat> %1, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
- %3 = bitcast <32 x bfloat> %2 to <8 x i64>
- ret <8 x i64> %3
-}
-
define <8 x i64> @test_mm512_mask_cvtne2ps2bf16_512(<8 x i64> %C, i32 %U, <16 x float> %A, <16 x float> %B) local_unnamed_addr #2 {
; X86-LABEL: test_mm512_mask_cvtne2ps2bf16_512:
; X86: # %bb.0: # %entry
diff --git a/llvm/test/CodeGen/X86/avx512bf16-vl-intrinsics.ll b/llvm/test/CodeGen/X86/avx512bf16-vl-intrinsics.ll
index 936d764a909e0..b3c261147c773 100644
--- a/llvm/test/CodeGen/X86/avx512bf16-vl-intrinsics.ll
+++ b/llvm/test/CodeGen/X86/avx512bf16-vl-intrinsics.ll
@@ -58,23 +58,6 @@ entry:
ret <2 x i64> %4
}
-; concatenation test for swapped operands
-define <2 x i64> @test_mm_cvtne2ps2bf16_128_concat(<4 x float> %A, <4 x float> %B) {
-; CHECK-LABEL: test_mm_cvtne2ps2bf16_128_concat:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: vcvtneps2bf16 %xmm0, %xmm0 # encoding: [0x62,0xf2,0x7e,0x08,0x72,0xc0]
-; CHECK-NEXT: vcvtneps2bf16 %xmm1, %xmm1 # encoding: [0x62,0xf2,0x7e,0x08,0x72,0xc9]
-; CHECK-NEXT: vmovlhps %xmm1, %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc5,0xf8,0x16,0xc1]
-; CHECK-NEXT: # xmm0 = xmm0[0],xmm1[0]
-; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
-entry:
- %0 = tail call <8 x bfloat> @llvm.x86.avx512bf16.mask.cvtneps2bf16.128(<4 x float> %A, <8 x bfloat> poison, <4 x i1> <i1 true, i1 true, i1 true, i1 true>)
- %1 = tail call <8 x bfloat> @llvm.x86.avx512bf16.mask.cvtneps2bf16.128(<4 x float> %B, <8 x bfloat> poison, <4 x i1> <i1 true, i1 true, i1 true, i1 true>)
- %2 = shufflevector <8 x bfloat> %0, <8 x bfloat> %1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>
- %3 = bitcast <8 x bfloat> %2 to <2 x i64>
- ret <2 x i64> %3
-}
-
declare <16 x bfloat> @llvm.x86.avx512bf16.cvtne2ps2bf16.256(<8 x float>, <8 x float>) #3
define <4 x i64> @test_mm256_cvtne2ps2bf16_256(<8 x float> %A, <8 x float> %B) local_unnamed_addr #1 {
@@ -129,22 +112,6 @@ entry:
ret <4 x i64> %4
}
-; concatenation test for swapped operands
-define <4 x i64> @test_mm256_cvtne2ps2bf16_256_concat(<8 x float> %A, <8 x float> %B) {
-; CHECK-LABEL: test_mm256_cvtne2ps2bf16_256_concat:
-; CHECK: # %bb.0: # %entry
-; CHECK-NEXT: vcvtneps2bf16 %ymm0, %xmm0 # encoding: [0x62,0xf2,0x7e,0x28,0x72,0xc0]
-; CHECK-NEXT: vcvtneps2bf16 %ymm1, %xmm1 # encoding: [0x62,0xf2,0x7e,0x28,0x72,0xc9]
-; CHECK-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe3,0x7d,0x18,0xc1,0x01]
-; CHECK-NEXT: ret{{[l|q]}} # encoding: [0xc3]
-entry:
- %0 = tail call <8 x bfloat> @llvm.x86.avx512bf16.cvtneps2bf16.256(<8 x float> %A)
- %1 = tail call <8 x bfloat> @llvm.x86.avx512bf16.cvtneps2bf16.256(<8 x float> %B)
- %2 = shufflevector <8 x bfloat> %0, <8 x bfloat> %1, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
- %3 = bitcast <16 x bfloat> %2 to <4 x i64>
- ret <4 x i64> %3
-}
-
declare <8 x bfloat> @llvm.x86.avx512bf16.cvtneps2bf16.256(<8 x float>) #3
define <2 x i64> @test_mm256_cvtneps2bf16_256(<8 x float> %A) local_unnamed_addr #2 {
diff --git a/llvm/test/MC/AMDGPU/gfx1250_asm_operands.s b/llvm/test/MC/AMDGPU/gfx1250_asm_operands.s
index 14ad95cbf7366..f6746af03df41 100644
--- a/llvm/test/MC/AMDGPU/gfx1250_asm_operands.s
+++ b/llvm/test/MC/AMDGPU/gfx1250_asm_operands.s
@@ -1,6 +1,5 @@
// RUN: not llvm-mc -triple=amdgpu12.00 -filetype=null %s 2>&1 | FileCheck --check-prefixes=GFX1200-ERR %s
-// RUN: not llvm-mc -triple=amdgpu12.50 -filetype=null %s 2>&1 | FileCheck --check-prefixes=GFX1250-ERR %s
-// RUN: not llvm-mc -triple=amdgpu12.50 -show-encoding %s | FileCheck --check-prefix=GFX1250 %s
+// RUN: llvm-mc -triple=amdgpu12.50 -show-encoding %s | FileCheck --check-prefix=GFX1250 %s
s_mov_b32 s0, src_flat_scratch_base_lo
// GFX1200-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: src_flat_scratch_base_lo register not available on this GPU
@@ -26,18 +25,6 @@ s_mov_b64 s[0:1], shared_limit
s_mov_b64 s[0:1], src_shared_limit
// GFX1250: encoding: [0xec,0x01,0x80,0xbe]
-s_mov_b32 s0, src_private_base
-// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: src_private_base register not available on this GPU
-
-s_mov_b32 s0, src_private_limit
-// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: src_private_limit register not available on this GPU
-
-s_mov_b64 s[0:1], src_private_base
-// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: src_private_base register not available on this GPU
-
-s_mov_b64 s[0:1], src_private_limit
-// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: src_private_limit register not available on this GPU
-
s_getreg_b32 s1, hwreg(33)
// GFX1250: encoding: [0x21,0xf8,0x81,0xb8]
diff --git a/llvm/test/MC/AMDGPU/literals.s b/llvm/test/MC/AMDGPU/literals.s
index 471d484a4df3b..391fb93c55926 100644
--- a/llvm/test/MC/AMDGPU/literals.s
+++ b/llvm/test/MC/AMDGPU/literals.s
@@ -1406,19 +1406,17 @@ s_add_i32 s0, src_shared_limit, s0
s_add_i32 s0, src_private_base, s0
// GFX11: s_add_i32 s0, src_private_base, s0 ; encoding: [0xed,0x00,0x00,0x81]
-// GFX12: s_add_co_i32 s0, src_private_base, s0 ; encoding: [0xed,0x00,0x00,0x81]
+// GFX12XX: s_add_co_i32 s0, src_private_base, s0 ; encoding: [0xed,0x00,0x00,0x81]
// GFX9: s_add_i32 s0, src_private_base, s0 ; encoding: [0xed,0x00,0x00,0x81]
-// NOGFX1250: :[[@LINE-4]]:15: error: src_private_base register not available on this GPU
-// NOSICI: :[[@LINE-5]]:15: error: src_private_base register not available on this GPU
-// NOVI: :[[@LINE-6]]:15: error: src_private_base register not available on this GPU
+// NOSICI: :[[@LINE-4]]:15: error: src_private_base register not available on this GPU
+// NOVI: :[[@LINE-5]]:15: error: src_private_base register not available on this GPU
s_add_i32 s0, src_private_limit, s0
// GFX11: s_add_i32 s0, src_private_limit, s0 ; encoding: [0xee,0x00,0x00,0x81]
-// GFX12: s_add_co_i32 s0, src_private_limit, s0 ; encoding: [0xee,0x00,0x00,0x81]
+// GFX12XX: s_add_co_i32 s0, src_private_limit, s0 ; encoding: [0xee,0x00,0x00,0x81]
// GFX9: s_add_i32 s0, src_private_limit, s0 ; encoding: [0xee,0x00,0x00,0x81]
-// NOGFX1250: :[[@LINE-4]]:15: error: src_private_limit register not available on this GPU
-// NOSICI: :[[@LINE-5]]:15: error: src_private_limit register not available on this GPU
-// NOVI: :[[@LINE-6]]:15: error: src_private_limit register not available on this GPU
+// NOSICI: :[[@LINE-4]]:15: error: src_private_limit register not available on this GPU
+// NOVI: :[[@LINE-5]]:15: error: src_private_limit register not available on this GPU
s_add_i32 s0, src_pops_exiting_wave_id, s0
// GFX9: s_add_i32 s0, src_pops_exiting_wave_id, s0 ; encoding: [0xef,0x00,0x00,0x81]
@@ -1449,19 +1447,17 @@ s_and_b64 s[0:1], s[0:1], src_shared_limit
s_and_b64 s[0:1], s[0:1], src_private_base
// GFX11: s_and_b64 s[0:1], s[0:1], src_private_base ; encoding: [0x00,0xed,0x80,0x8b]
-// GFX12: s_and_b64 s[0:1], s[0:1], src_private_base ; encoding: [0x00,0xed,0x80,0x8b]
+// GFX12XX: s_and_b64 s[0:1], s[0:1], src_private_base ; encoding: [0x00,0xed,0x80,0x8b]
// GFX9: s_and_b64 s[0:1], s[0:1], src_private_base ; encoding: [0x00,0xed,0x80,0x86]
-// NOGFX1250: :[[@LINE-4]]:27: error: src_private_base register not available on this GPU
-// NOSICI: :[[@LINE-5]]:27: error: src_private_base register not available on this GPU
-// NOVI: :[[@LINE-6]]:27: error: src_private_base register not available on this GPU
+// NOSICI: :[[@LINE-4]]:27: error: src_private_base register not available on this GPU
+// NOVI: :[[@LINE-5]]:27: error: src_private_base register not available on this GPU
s_and_b64 s[0:1], s[0:1], src_private_limit
// GFX11: s_and_b64 s[0:1], s[0:1], src_private_limit ; encoding: [0x00,0xee,0x80,0x8b]
-// GFX12: s_and_b64 s[0:1], s[0:1], src_private_limit ; encoding: [0x00,0xee,0x80,0x8b]
+// GFX12XX: s_and_b64 s[0:1], s[0:1], src_private_limit ; encoding: [0x00,0xee,0x80,0x8b]
// GFX9: s_and_b64 s[0:1], s[0:1], src_private_limit ; encoding: [0x00,0xee,0x80,0x86]
-// NOGFX1250: :[[@LINE-4]]:27: error: src_private_limit register not available on this GPU
-// NOSICI: :[[@LINE-5]]:27: error: src_private_limit register not available on this GPU
-// NOVI: :[[@LINE-6]]:27: error: src_private_limit register not available on this GPU
+// NOSICI: :[[@LINE-4]]:27: error: src_private_limit register not available on this GPU
+// NOVI: :[[@LINE-5]]:27: error: src_private_limit register not available on this GPU
s_and_b64 s[0:1], s[0:1], src_pops_exiting_wave_id
// GFX9: s_and_b64 s[0:1], s[0:1], src_pops_exiting_wave_id ; encoding: [0x00,0xef,0x80,0x86]
@@ -1683,12 +1679,11 @@ v_ceil_f32_sdwa v5, |src_shared_base| dst_sel:DWORD src0_sel:DWORD
v_add_u32 v0, private_base, s0
// GFX11: v_add_nc_u32_e64 v0, src_private_base, s0 ; encoding: [0x00,0x00,0x25,0xd5,0xed,0x00,0x00,0x02]
-// GFX12: v_add_nc_u32_e64 v0, src_private_base, s0 ; encoding: [0x00,0x00,0x25,0xd5,0xed,0x00,0x00,0x02]
+// GFX12XX: v_add_nc_u32_e64 v0, src_private_base, s0 ; encoding: [0x00,0x00,0x25,0xd5,0xed,0x00,0x00,0x02]
// NOCI: :[[@LINE-3]]:1: error: instruction not supported on this GPU (gfx704): v_add_u32
-// NOGFX1250: :[[@LINE-4]]:15: error: src_private_base register not available on this GPU
-// NOGFX9: :[[@LINE-5]]:29: error: invalid operand (violates constant bus restrictions)
-// NOSI: :[[@LINE-6]]:1: error: instruction not supported on this GPU (gfx600): v_add_u32
-// NOVI: :[[@LINE-7]]:15: error: src_private_base register not available on this GPU
+// NOGFX9: :[[@LINE-4]]:29: error: invalid operand (violates constant bus restrictions)
+// NOSI: :[[@LINE-5]]:1: error: instruction not supported on this GPU (gfx600): v_add_u32
+// NOVI: :[[@LINE-6]]:15: error: src_private_base register not available on this GPU
// NOSICIVI: :[[@LINE-1]]:1: error: instruction not supported on this GPU
v_add_u32 v0, scc, s0
@@ -1719,11 +1714,10 @@ v_div_fmas_f32 v0, v0, shared_limit, v1
// v_div_fmas implicitly reads VCC
v_div_fmas_f32 v0, v0, v1, private_limit
// GFX11: v_div_fmas_f32 v0, v0, v1, src_private_limit ; encoding: [0x00,0x00,0x37,0xd6,0x00,0x03,0xba,0x03]
-// GFX12: v_div_fmas_f32 v0, v0, v1, src_private_limit ; encoding: [0x00,0x00,0x37,0xd6,0x00,0x03,0xba,0x03]
-// NOGFX1250: :[[@LINE-3]]:28: error: src_private_limit register not available on this GPU
-// NOGFX9: :[[@LINE-4]]:28: error: invalid operand (violates constant bus restrictions)
-// NOSICI: :[[@LINE-5]]:28: error: src_private_limit register not available on this GPU
-// NOVI: :[[@LINE-6]]:28: error: src_private_limit register not available on this GPU
+// GFX12XX: v_div_fmas_f32 v0, v0, v1, src_private_limit ; encoding: [0x00,0x00,0x37,0xd6,0x00,0x03,0xba,0x03]
+// NOGFX9: :[[@LINE-3]]:28: error: invalid operand (violates constant bus restrictions)
+// NOSICI: :[[@LINE-4]]:28: error: src_private_limit register not available on this GPU
+// NOVI: :[[@LINE-5]]:28: error: src_private_limit register not available on this GPU
// v_div_fmas implicitly reads VCC
v_div_fmas_f32 v0, execz, v0, v1
@@ -1841,7 +1835,7 @@ v_madmk_f16 v0, 0xff32, 1, v0
v_cmp_eq_f32 s[0:1], private_base, private_limit
// NOGFX11: :[[@LINE-1]]:14: error: invalid operand for instruction
// NOGFX12: :[[@LINE-2]]:14: error: invalid operand for instruction
-// NOGFX1250: :[[@LINE-3]]:22: error: src_private_base register not available on this GPU
+// NOGFX1250: :[[@LINE-3]]:14: error: invalid operand for instruction
// NOGFX9: :[[@LINE-4]]:36: error: invalid operand (violates constant bus restrictions)
// NOSICI: :[[@LINE-5]]:22: error: src_private_base register not available on this GPU
// NOVI: :[[@LINE-6]]:22: error: src_private_base register not available on this GPU
@@ -1849,7 +1843,7 @@ v_cmp_eq_f32 s[0:1], private_base, private_limit
v_cmp_eq_f32 s[0:1], private_base, s0
// NOGFX11: :[[@LINE-1]]:14: error: invalid operand for instruction
// NOGFX12: :[[@LINE-2]]:14: error: invalid operand for instruction
-// NOGFX1250: :[[@LINE-3]]:22: error: src_private_base register not available on this GPU
+// NOGFX1250: :[[@LINE-3]]:14: error: invalid operand for instruction
// NOGFX9: :[[@LINE-4]]:36: error: invalid operand (violates constant bus restrictions)
// NOSICI: :[[@LINE-5]]:22: error: src_private_base register not available on this GPU
// NOVI: :[[@LINE-6]]:22: error: src_private_base register not available on this GPU
@@ -1863,12 +1857,11 @@ v_cmp_eq_f32 s[0:1], execz, s0
v_pk_add_f16 v255, private_base, private_limit
// GFX11: v_pk_add_f16 v255, src_private_base, src_private_limit ; encoding: [0xff,0x40,0x0f,0xcc,0xed,0xdc,0x01,0x1a]
-// GFX12: v_pk_add_f16 v255, src_private_base, src_private_limit ; encoding: [0xff,0x40,0x0f,0xcc,0xed,0xdc,0x01,0x1a]
+// GFX12XX: v_pk_add_f16 v255, src_private_base, src_private_limit ; encoding: [0xff,0x40,0x0f,0xcc,0xed,0xdc,0x01,0x1a]
// NOCI: :[[@LINE-3]]:1: error: instruction not supported on this GPU (gfx704): v_pk_add_f16
-// NOGFX1250: :[[@LINE-4]]:20: error: src_private_base register not available on this GPU
-// NOGFX9: :[[@LINE-5]]:34: error: invalid operand (violates constant bus restrictions)
-// NOSI: :[[@LINE-6]]:1: error: instruction not supported on this GPU (gfx600): v_pk_add_f16
-// NOVI: :[[@LINE-7]]:1: error: instruction not supported on this GPU (gfx802): v_pk_add_f16
+// NOGFX9: :[[@LINE-4]]:34: error: invalid operand (violates constant bus restrictions)
+// NOSI: :[[@LINE-5]]:1: error: instruction not supported on this GPU (gfx600): v_pk_add_f16
+// NOVI: :[[@LINE-6]]:1: error: instruction not supported on this GPU (gfx802): v_pk_add_f16
// NOSICIVI: :[[@LINE-1]]:1: error: instruction not supported on this GPU
v_pk_add_f16 v255, vccz, execz
diff --git a/llvm/test/MC/Disassembler/AMDGPU/decode-err.txt b/llvm/test/MC/Disassembler/AMDGPU/decode-err.txt
index de9bf7bac9548..6855d2e687951 100644
--- a/llvm/test/MC/Disassembler/AMDGPU/decode-err.txt
+++ b/llvm/test/MC/Disassembler/AMDGPU/decode-err.txt
@@ -7,16 +7,6 @@
# GCN-ERR: [[@LINE+1]]:1: warning: invalid instruction encoding
0xdf,0x00,0x00,0x02
-# This is v_readfirstlane_b32 with an SGPR destination that does not fit the
-# 7-bit scalar register encoding of the 8-bit VOP1 vdst field.
-# GCN-ERR: [[@LINE+1]]:1: warning: invalid instruction encoding
-0x00,0x05,0xf4,0x7f
-
-# This is v_s_exp_f32 with an SGPR destination that does not fit the 7-bit
-# scalar register encoding of the 8-bit VOP3 vdst field.
-# GFX12-ERR: [[@LINE+1]]:1: warning: invalid instruction encoding
-0xfa,0x00,0x80,0xd6,0x01,0x00,0x01,0x02
-
# this is s_waitcnt_vscnt exec_hi, 0x1234, which is valid on gfx11, but not on gfx12
# GFX12-ERR: [[@LINE+1]]:1: warning: invalid instruction encoding
0x34,0x12,0x7f,0xbc
@@ -31,36 +21,6 @@
# GFX1250-ERR: [[@LINE+1]]:1: warning: invalid instruction encoding
0xff,0x4e,0x80,0xbe,0xbe,0x00,0x00,0x00
-# src_private_base (237) and src_private_limit (238) are reserved on targets
-# with globally addressable scratch. Both the 32-bit and the 64-bit operand
-# forms are covered here.
-# GFX1250-ERR: [[@LINE+1]]:1: warning: invalid instruction encoding
-0xed,0x0e,0x80,0xbe
-
-# GFX1250-ERR: [[@LINE+1]]:1: warning: invalid instruction encoding
-0xed,0x01,0xfe,0xbe
-
-# GFX1250-ERR: [[@LINE+1]]:1: warning: invalid instruction encoding
-0xee,0x0e,0x80,0xbe
-
-# GFX1250-ERR: [[@LINE+1]]:1: warning: invalid instruction encoding
-0xee,0x01,0xfe,0xbe
-
-# src_pops_exiting_wave_id (239) is only available on targets that support
-# POPS.
-# GFX12-ERR: [[@LINE+2]]:1: warning: invalid instruction encoding
-# GFX1250-ERR: [[@LINE+1]]:1: warning: invalid instruction encoding
-0x00,0xef,0x0c,0xbf
-
-# src_vccz (251) and src_execz (252) are reserved on GFX11+.
-# GFX12-ERR: [[@LINE+2]]:1: warning: invalid instruction encoding
-# GFX1250-ERR: [[@LINE+1]]:1: warning: invalid instruction encoding
-0xfb,0x0e,0x80,0xbe
-
-# GFX12-ERR: [[@LINE+2]]:1: warning: invalid instruction encoding
-# GFX1250-ERR: [[@LINE+1]]:1: warning: invalid instruction encoding
-0xfc,0x0e,0x80,0xbe
-
# W32: v_dual_add_f32 v5, 0xaf123456, v2 :: v_dual_fmaak_f32 v6, v3, v1, 0xaf123456 ; encoding: [0xff,0x04,0x02,0xc9,0x03,0x03,0x06,0x05,0x56,0x34,0x12,0xaf]
# W64: [[@LINE+1]]:1: warning: invalid instruction encoding
0xff,0x04,0x02,0xc9,0x03,0x03,0x06,0x05,0x56,0x34,0x12,0xaf
diff --git a/llvm/test/MC/Sparc/Relocations/absolute-hi-lo.s b/llvm/test/MC/Sparc/Relocations/absolute-hi-lo.s
deleted file mode 100644
index ed50b63e22ef5..0000000000000
--- a/llvm/test/MC/Sparc/Relocations/absolute-hi-lo.s
+++ /dev/null
@@ -1,35 +0,0 @@
-# RUN: llvm-mc -triple=sparcv9 -filetype=obj %s | llvm-objdump -dr - | FileCheck %s --implicit-check-not=R_SPARC
-# RUN: llvm-mc -triple=sparcv9 --position-independent -filetype=obj %s | llvm-objdump -dr - | FileCheck %s --implicit-check-not=R_SPARC
-
-# CHECK-LABEL: <abs>:
-# CHECK-NEXT: sethi 0x48d15, %l5
-# CHECK-NEXT: or %l5, 0x278, %l5
-# CHECK-NEXT: sethi 0x3fb72e, %o0
-# CHECK-NEXT: xor %o0, 0x298, %o0
-# CHECK-NEXT: sethi 0x21d950, %o1
-# CHECK-NEXT: or %o1, 0x321, %o1
-# CHECK-NEXT: sethi 0x4, %o2
-# CHECK-NEXT: or %o2, 0x234, %o2
-# CHECK-NEXT: sethi 0x48d15, %o3
-# CHECK-NEXT: or %o3, 0x278, %o3
-
-defined = 0xfedcba98
-
-.globl abs
-abs:
- sethi %hi(0x12345678), %l5
- or %l5, %lo(0x12345678), %l5
- sethi %hi(defined), %o0
- xor %o0, %lo(defined), %o0
- sethi %hi(forward), %o1
- or %o1, %lo(forward), %o1
- sethi %hi(.Lend-.Lbegin), %o2
- or %o2, %lo(.Lend-.Lbegin), %o2
- set 0x12345678, %o3
-
-forward = 0x87654321
-
-.data
-.Lbegin:
- .space 0x1234
-.Lend:
diff --git a/llvm/test/MC/Sparc/Relocations/relocation-specifier.s b/llvm/test/MC/Sparc/Relocations/relocation-specifier.s
index a994e37dd6d63..8a996c99e55ac 100644
--- a/llvm/test/MC/Sparc/Relocations/relocation-specifier.s
+++ b/llvm/test/MC/Sparc/Relocations/relocation-specifier.s
@@ -57,20 +57,6 @@ or %o1, %pc10(sym), %o1
sethi %pc22(main), %o1
or %o1, %pc10(main), %o1
-## GNU as has no %got operators, so these do not round-trip through ASM output.
-# ASM: sethi %hi(sym), %o1
-# ASM-NEXT: or %o1, %lo(sym), %o1
-# ASM-NEXT: ld [%l7+sym], %o2
-# OBJDUMP: sethi 0x0, %o1
-# OBJDUMP-NEXT: R_SPARC_GOT22 sym
-# OBJDUMP-NEXT: or %o1, 0x0, %o1
-# OBJDUMP-NEXT: R_SPARC_GOT10 sym
-# OBJDUMP-NEXT: ld [%l7], %o2
-# OBJDUMP-NEXT: R_SPARC_GOT13 sym
-sethi %got22(sym), %o1
-or %o1, %got10(sym), %o1
-ld [%l7 + %got13(sym)], %o2
-
# ASM: sethi %hh(sym), %l0
# ASM-NEXT: sethi %hh(sym), %l0
# ASM-NEXT: or %g1, %hm(sym), %g3
diff --git a/llvm/test/Transforms/ConstraintElimination/shl.ll b/llvm/test/Transforms/ConstraintElimination/shl.ll
index fe053120ac871..bff8c7e037dee 100644
--- a/llvm/test/Transforms/ConstraintElimination/shl.ll
+++ b/llvm/test/Transforms/ConstraintElimination/shl.ll
@@ -1478,54 +1478,3 @@ define i1 @shl_nuw_signed_shift_zero(i8 %x) {
%t = icmp slt i8 %m, 0
ret i1 %t
}
-
-define i1 @shl_nuw_by_62(i64 %start, i64 %high) {
-; CHECK-LABEL: @shl_nuw_by_62(
-; CHECK-NEXT: entry:
-; CHECK-NEXT: [[START_SHL_62:%.*]] = shl nuw i64 [[START:%.*]], 62
-; CHECK-NEXT: [[C_1:%.*]] = icmp ult i64 [[START_SHL_62]], [[HIGH:%.*]]
-; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
-; CHECK-NEXT: ret i1 true
-;
-entry:
- %start.shl.62 = shl nuw i64 %start, 62
- %c.1 = icmp ult i64 %start.shl.62, %high
- call void @llvm.assume(i1 %c.1)
- %t.1 = icmp ult i64 %start, %high
- ret i1 %t.1
-}
-
-; A shift of 63 would require a scale of 2^63, which is not representable in
-; the signed i64 coefficient
-define i1 @shl_nuw_by_63(i64 %start, i64 %high) {
-; CHECK-LABEL: @shl_nuw_by_63(
-; CHECK-NEXT: entry:
-; CHECK-NEXT: [[START_SHL_63:%.*]] = shl nuw i64 [[START:%.*]], 63
-; CHECK-NEXT: [[C_1:%.*]] = icmp ult i64 [[START_SHL_63]], [[HIGH:%.*]]
-; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i64 [[START]], [[HIGH]]
-; CHECK-NEXT: ret i1 [[T_1]]
-;
-entry:
- %start.shl.63 = shl nuw i64 %start, 63
- %c.1 = icmp ult i64 %start.shl.63, %high
- call void @llvm.assume(i1 %c.1)
- %t.1 = icmp ult i64 %start, %high
- ret i1 %t.1
-}
-
-define i1 @shl_nuw_by_63_self(i64 %x, i64 %b) {
-; CHECK-LABEL: @shl_nuw_by_63_self(
-; CHECK-NEXT: entry:
-; CHECK-NEXT: [[S:%.*]] = shl nuw i64 [[X:%.*]], 63
-; CHECK-NEXT: [[C:%.*]] = icmp ule i64 [[S]], [[B:%.*]]
-; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: ret i1 true
-;
-entry:
- %s = shl nuw i64 %x, 63
- %c = icmp ule i64 %s, %b
- call void @llvm.assume(i1 %c)
- %c2 = icmp ule i64 %s, %b
- ret i1 %c2
-}
diff --git a/llvm/test/Transforms/InstCombine/and-or-icmps.ll b/llvm/test/Transforms/InstCombine/and-or-icmps.ll
index 420b963110364..91b9f702f4575 100644
--- a/llvm/test/Transforms/InstCombine/and-or-icmps.ll
+++ b/llvm/test/Transforms/InstCombine/and-or-icmps.ll
@@ -3341,7 +3341,9 @@ define i1 @icmp_eq_or_z_or_pow2orz_fail_nonzero_const(i8 %x, i8 %y) {
define <2 x i1> @icmp_ne_and_z_and_pow2orz_fail_bad_pred(<2 x i8> %x, <2 x i8> %y) {
; CHECK-LABEL: @icmp_ne_and_z_and_pow2orz_fail_bad_pred(
-; CHECK-NEXT: [[TMP1:%.*]] = or <2 x i8> [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT: [[NY:%.*]] = sub <2 x i8> zeroinitializer, [[Y:%.*]]
+; CHECK-NEXT: [[POW2ORZ:%.*]] = and <2 x i8> [[Y]], [[NY]]
+; CHECK-NEXT: [[TMP1:%.*]] = or <2 x i8> [[X:%.*]], [[POW2ORZ]]
; CHECK-NEXT: [[R:%.*]] = icmp eq <2 x i8> [[TMP1]], zeroinitializer
; CHECK-NEXT: ret <2 x i1> [[R]]
;
diff --git a/llvm/test/Transforms/InstCombine/ctpop-pow2.ll b/llvm/test/Transforms/InstCombine/ctpop-pow2.ll
index 859828de56d56..e86d32de51f36 100644
--- a/llvm/test/Transforms/InstCombine/ctpop-pow2.ll
+++ b/llvm/test/Transforms/InstCombine/ctpop-pow2.ll
@@ -11,7 +11,9 @@ declare void @llvm.assume(i1)
define i16 @ctpop_x_and_negx(i16 %x) {
; CHECK-LABEL: @ctpop_x_and_negx(
-; CHECK-NEXT: [[TMP1:%.*]] = icmp ne i16 [[X:%.*]], 0
+; CHECK-NEXT: [[V0:%.*]] = sub i16 0, [[X:%.*]]
+; CHECK-NEXT: [[V1:%.*]] = and i16 [[X]], [[V0]]
+; CHECK-NEXT: [[TMP1:%.*]] = icmp ne i16 [[V1]], 0
; CHECK-NEXT: [[CNT:%.*]] = zext i1 [[TMP1]] to i16
; CHECK-NEXT: ret i16 [[CNT]]
;
@@ -71,7 +73,9 @@ define i8 @ctpop_imin_plus1_lshr_nz(i8 %x) {
define i64 @ctpop_x_and_negx_nz(i64 %x) {
; CHECK-LABEL: @ctpop_x_and_negx_nz(
-; CHECK-NEXT: [[CMP:%.*]] = icmp ne i64 [[X:%.*]], 0
+; CHECK-NEXT: [[V0:%.*]] = sub i64 0, [[X:%.*]]
+; CHECK-NEXT: [[V1:%.*]] = and i64 [[X]], [[V0]]
+; CHECK-NEXT: [[CMP:%.*]] = icmp ne i64 [[V1]], 0
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: ret i64 1
;
@@ -122,7 +126,9 @@ define <2 x i32> @ctpop_shl2_1_vec_nz(<2 x i32> %x) {
define <2 x i64> @ctpop_x_and_negx_vec(<2 x i64> %x) {
; CHECK-LABEL: @ctpop_x_and_negx_vec(
-; CHECK-NEXT: [[TMP1:%.*]] = icmp ne <2 x i64> [[X:%.*]], zeroinitializer
+; CHECK-NEXT: [[SUB:%.*]] = sub <2 x i64> zeroinitializer, [[X:%.*]]
+; CHECK-NEXT: [[AND:%.*]] = and <2 x i64> [[X]], [[SUB]]
+; CHECK-NEXT: [[TMP1:%.*]] = icmp ne <2 x i64> [[AND]], zeroinitializer
; CHECK-NEXT: [[CNT:%.*]] = zext <2 x i1> [[TMP1]] to <2 x i64>
; CHECK-NEXT: ret <2 x i64> [[CNT]]
;
diff --git a/llvm/test/Transforms/InstCombine/cttz.ll b/llvm/test/Transforms/InstCombine/cttz.ll
index cd9e9881edc90..7af67faab1d47 100644
--- a/llvm/test/Transforms/InstCombine/cttz.ll
+++ b/llvm/test/Transforms/InstCombine/cttz.ll
@@ -392,70 +392,6 @@ define i9 @fold_clz_log2_i9(i9 %x) {
%r = call i9 @llvm.ctlz(i9 %v, i1 true)
ret i9 %r
}
-
-define i32 @cttz_odd_mul(i32 %x) {
-; CHECK-LABEL: @cttz_odd_mul(
-; CHECK-NEXT: [[R:%.*]] = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 [[X:%.*]], i1 false)
-; CHECK-NEXT: ret i32 [[R]]
-;
- %m = mul i32 %x, 3
- %r = call i32 @llvm.cttz.i32(i32 %m, i1 false)
- ret i32 %r
-}
-
-define i32 @cttz_odd_mul_zero_poison(i32 %x) {
-; CHECK-LABEL: @cttz_odd_mul_zero_poison(
-; CHECK-NEXT: [[R:%.*]] = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 [[X:%.*]], i1 true)
-; CHECK-NEXT: ret i32 [[R]]
-;
- %m = mul i32 %x, 5
- %r = call i32 @llvm.cttz.i32(i32 %m, i1 true)
- ret i32 %r
-}
-
-define <2 x i64> @cttz_odd_mul_splat(<2 x i64> %x) {
-; CHECK-LABEL: @cttz_odd_mul_splat(
-; CHECK-NEXT: [[R:%.*]] = call range(i64 0, 65) <2 x i64> @llvm.cttz.v2i64(<2 x i64> [[X:%.*]], i1 false)
-; CHECK-NEXT: ret <2 x i64> [[R]]
-;
- %m = mul <2 x i64> %x, splat (i64 3)
- %r = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> %m, i1 false)
- ret <2 x i64> %r
-}
-
-define i32 @cttz_even_mul(i32 %x) {
-; CHECK-LABEL: @cttz_even_mul(
-; CHECK-NEXT: [[M:%.*]] = mul i32 [[X:%.*]], 6
-; CHECK-NEXT: [[R:%.*]] = call range(i32 1, 33) i32 @llvm.cttz.i32(i32 [[M]], i1 false)
-; CHECK-NEXT: ret i32 [[R]]
-;
- %m = mul i32 %x, 6
- %r = call i32 @llvm.cttz.i32(i32 %m, i1 false)
- ret i32 %r
-}
-
-define i32 @cttz_odd_mul_multiuse(i32 %x) {
-; CHECK-LABEL: @cttz_odd_mul_multiuse(
-; CHECK-NEXT: [[M:%.*]] = mul i32 [[X:%.*]], 3
-; CHECK-NEXT: call void @use(i32 [[M]])
-; CHECK-NEXT: [[R:%.*]] = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 [[X]], i1 false)
-; CHECK-NEXT: ret i32 [[R]]
-;
- %m = mul i32 %x, 3
- call void @use(i32 %m)
- %r = call i32 @llvm.cttz.i32(i32 %m, i1 false)
- ret i32 %r
-}
-
-define i32 @cttz_odd_mul_nsw(i32 %x) {
-; CHECK-LABEL: @cttz_odd_mul_nsw(
-; CHECK-NEXT: [[R:%.*]] = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 [[X:%.*]], i1 false)
-; CHECK-NEXT: ret i32 [[R]]
-;
- %m = mul nsw i32 %x, 3
- %r = call i32 @llvm.cttz.i32(i32 %m, i1 false)
- ret i32 %r
-}
;.
; CHECK: [[PROF0]] = !{!"branch_weights", i32 1, i32 2}
;.
diff --git a/llvm/test/Transforms/InstCombine/div.ll b/llvm/test/Transforms/InstCombine/div.ll
index 75a6c897e6133..2adf6036d4bcf 100644
--- a/llvm/test/Transforms/InstCombine/div.ll
+++ b/llvm/test/Transforms/InstCombine/div.ll
@@ -2033,330 +2033,6 @@ define <2 x i32> @sdiv_select_one_false_poison_vec(<2 x i32> %a, i1 %b) {
ret <2 x i32> %div
}
-define i32 @sdiv_mul_nsw_gcd(i32 %x) {
-; CHECK-LABEL: @sdiv_mul_nsw_gcd(
-; CHECK-NEXT: [[M:%.*]] = mul nsw i32 [[X:%.*]], 5
-; CHECK-NEXT: [[D:%.*]] = sdiv i32 [[M]], 3
-; CHECK-NEXT: ret i32 [[D]]
-;
- %m = mul nsw i32 %x, 150
- %d = sdiv i32 %m, 90
- ret i32 %d
-}
-
-define i32 @sdiv_mul_nsw_gcd_neg_c1(i32 %x) {
-; CHECK-LABEL: @sdiv_mul_nsw_gcd_neg_c1(
-; CHECK-NEXT: [[M:%.*]] = mul nsw i32 [[X:%.*]], -5
-; CHECK-NEXT: [[D:%.*]] = sdiv i32 [[M]], 3
-; CHECK-NEXT: ret i32 [[D]]
-;
- %m = mul nsw i32 %x, -150
- %d = sdiv i32 %m, 90
- ret i32 %d
-}
-
-define i32 @sdiv_mul_nsw_gcd_neg_c2(i32 %x) {
-; CHECK-LABEL: @sdiv_mul_nsw_gcd_neg_c2(
-; CHECK-NEXT: [[M:%.*]] = mul nsw i32 [[X:%.*]], 5
-; CHECK-NEXT: [[D:%.*]] = sdiv i32 [[M]], -3
-; CHECK-NEXT: ret i32 [[D]]
-;
- %m = mul nsw i32 %x, 150
- %d = sdiv i32 %m, -90
- ret i32 %d
-}
-
-define i32 @sdiv_mul_nsw_gcd_neg_both(i32 %x) {
-; CHECK-LABEL: @sdiv_mul_nsw_gcd_neg_both(
-; CHECK-NEXT: [[M:%.*]] = mul nsw i32 [[X:%.*]], -5
-; CHECK-NEXT: [[D:%.*]] = sdiv i32 [[M]], -3
-; CHECK-NEXT: ret i32 [[D]]
-;
- %m = mul nsw i32 %x, -150
- %d = sdiv i32 %m, -90
- ret i32 %d
-}
-
-define i32 @udiv_mul_nuw_gcd(i32 %x) {
-; CHECK-LABEL: @udiv_mul_nuw_gcd(
-; CHECK-NEXT: [[M:%.*]] = mul nuw i32 [[X:%.*]], 5
-; CHECK-NEXT: [[D1:%.*]] = udiv i32 [[M]], 3
-; CHECK-NEXT: ret i32 [[D1]]
-;
- %m = mul nuw i32 %x, 150
- %d = udiv i32 %m, 90
- ret i32 %d
-}
-
-define i32 @udiv_mul_nuw_nsw_gcd(i32 %x) {
-; CHECK-LABEL: @udiv_mul_nuw_nsw_gcd(
-; CHECK-NEXT: [[M:%.*]] = mul nuw nsw i32 [[X:%.*]], 5
-; CHECK-NEXT: [[D1:%.*]] = udiv i32 [[M]], 3
-; CHECK-NEXT: ret i32 [[D1]]
-;
- %m = mul nuw nsw i32 %x, 150
- %d = udiv i32 %m, 90
- ret i32 %d
-}
-
-define i32 @sdiv_mul_nsw_exact_gcd(i32 %x) {
-; CHECK-LABEL: @sdiv_mul_nsw_exact_gcd(
-; CHECK-NEXT: [[M:%.*]] = mul nsw i32 [[X:%.*]], 5
-; CHECK-NEXT: [[D:%.*]] = sdiv exact i32 [[M]], 3
-; CHECK-NEXT: ret i32 [[D]]
-;
- %m = mul nsw i32 %x, 150
- %d = sdiv exact i32 %m, 90
- ret i32 %d
-}
-
-define i32 @udiv_mul_nuw_exact_gcd(i32 %x) {
-; CHECK-LABEL: @udiv_mul_nuw_exact_gcd(
-; CHECK-NEXT: [[M:%.*]] = mul nuw i32 [[X:%.*]], 5
-; CHECK-NEXT: [[D1:%.*]] = udiv exact i32 [[M]], 3
-; CHECK-NEXT: ret i32 [[D1]]
-;
- %m = mul nuw i32 %x, 150
- %d = udiv exact i32 %m, 90
- ret i32 %d
-}
-
-define i32 @sdiv_shl_nsw_gcd(i32 %x) {
-; CHECK-LABEL: @sdiv_shl_nsw_gcd(
-; CHECK-NEXT: [[SHL:%.*]] = shl nsw i32 [[X:%.*]], 1
-; CHECK-NEXT: [[D:%.*]] = sdiv i32 [[SHL]], 3
-; CHECK-NEXT: ret i32 [[D]]
-;
- %shl = shl nsw i32 %x, 2
- %d = sdiv i32 %shl, 6
- ret i32 %d
-}
-
-define i32 @udiv_shl_nuw_gcd(i32 %x) {
-; CHECK-LABEL: @udiv_shl_nuw_gcd(
-; CHECK-NEXT: [[SHL:%.*]] = shl nuw i32 [[X:%.*]], 1
-; CHECK-NEXT: [[D:%.*]] = udiv i32 [[SHL]], 3
-; CHECK-NEXT: ret i32 [[D]]
-;
- %shl = shl nuw i32 %x, 2
- %d = udiv i32 %shl, 6
- ret i32 %d
-}
-
-define i32 @sdiv_shl_nsw_exact_gcd(i32 %x) {
-; CHECK-LABEL: @sdiv_shl_nsw_exact_gcd(
-; CHECK-NEXT: [[SHL:%.*]] = shl nsw i32 [[X:%.*]], 1
-; CHECK-NEXT: [[D:%.*]] = sdiv exact i32 [[SHL]], 3
-; CHECK-NEXT: ret i32 [[D]]
-;
- %shl = shl nsw i32 %x, 2
- %d = sdiv exact i32 %shl, 6
- ret i32 %d
-}
-
-; Vector splat test
-define <2 x i32> @sdiv_mul_nsw_gcd_splat(<2 x i32> %x) {
-; CHECK-LABEL: @sdiv_mul_nsw_gcd_splat(
-; CHECK-NEXT: [[M:%.*]] = mul nsw <2 x i32> [[X:%.*]], splat (i32 5)
-; CHECK-NEXT: [[D:%.*]] = sdiv <2 x i32> [[M]], splat (i32 3)
-; CHECK-NEXT: ret <2 x i32> [[D]]
-;
- %m = mul nsw <2 x i32> %x, <i32 150, i32 150>
- %d = sdiv <2 x i32> %m, <i32 90, i32 90>
- ret <2 x i32> %d
-}
-
-; Vector non-splat test (should not fold)
-define <2 x i32> @sdiv_mul_nsw_gcd_non_splat(<2 x i32> %x) {
-; CHECK-LABEL: @sdiv_mul_nsw_gcd_non_splat(
-; CHECK-NEXT: [[M:%.*]] = mul nsw <2 x i32> [[X:%.*]], <i32 150, i32 90>
-; CHECK-NEXT: [[D:%.*]] = sdiv <2 x i32> [[M]], <i32 90, i32 60>
-; CHECK-NEXT: ret <2 x i32> [[D]]
-;
- %m = mul nsw <2 x i32> %x, <i32 150, i32 90>
- %d = sdiv <2 x i32> %m, <i32 90, i32 60>
- ret <2 x i32> %d
-}
-
-; Negative tests
-
-define i32 @sdiv_mul_no_nsw_gcd(i32 %x) {
-; CHECK-LABEL: @sdiv_mul_no_nsw_gcd(
-; CHECK-NEXT: [[M:%.*]] = mul i32 [[X:%.*]], 150
-; CHECK-NEXT: [[D:%.*]] = sdiv i32 [[M]], 90
-; CHECK-NEXT: ret i32 [[D]]
-;
- %m = mul i32 %x, 150
- %d = sdiv i32 %m, 90
- ret i32 %d
-}
-
-define i32 @udiv_mul_no_nuw_gcd(i32 %x) {
-; CHECK-LABEL: @udiv_mul_no_nuw_gcd(
-; CHECK-NEXT: [[M:%.*]] = mul i32 [[X:%.*]], 150
-; CHECK-NEXT: [[D:%.*]] = udiv i32 [[M]], 90
-; CHECK-NEXT: ret i32 [[D]]
-;
- %m = mul i32 %x, 150
- %d = udiv i32 %m, 90
- ret i32 %d
-}
-
-define i32 @sdiv_shl_no_nsw_gcd(i32 %x) {
-; CHECK-LABEL: @sdiv_shl_no_nsw_gcd(
-; CHECK-NEXT: [[SHL:%.*]] = shl i32 [[X:%.*]], 2
-; CHECK-NEXT: [[D:%.*]] = sdiv i32 [[SHL]], 6
-; CHECK-NEXT: ret i32 [[D]]
-;
- %shl = shl i32 %x, 2
- %d = sdiv i32 %shl, 6
- ret i32 %d
-}
-
-define i32 @udiv_shl_no_nuw_gcd(i32 %x) {
-; CHECK-LABEL: @udiv_shl_no_nuw_gcd(
-; CHECK-NEXT: [[SHL:%.*]] = shl i32 [[X:%.*]], 2
-; CHECK-NEXT: [[D:%.*]] = udiv i32 [[SHL]], 6
-; CHECK-NEXT: ret i32 [[D]]
-;
- %shl = shl i32 %x, 2
- %d = udiv i32 %shl, 6
- ret i32 %d
-}
-
-define i32 @sdiv_mul_nsw_gcd_multi_use(i32 %x) {
-; CHECK-LABEL: @sdiv_mul_nsw_gcd_multi_use(
-; CHECK-NEXT: [[M:%.*]] = mul nsw i32 [[X:%.*]], 150
-; CHECK-NEXT: call void @use(i32 [[M]])
-; CHECK-NEXT: [[D:%.*]] = sdiv i32 [[M]], 90
-; CHECK-NEXT: ret i32 [[D]]
-;
- %m = mul nsw i32 %x, 150
- call void @use(i32 %m)
- %d = sdiv i32 %m, 90
- ret i32 %d
-}
-
-define i32 @sdiv_shl_nsw_gcd_multi_use(i32 %x) {
-; CHECK-LABEL: @sdiv_shl_nsw_gcd_multi_use(
-; CHECK-NEXT: [[SHL:%.*]] = shl nsw i32 [[X:%.*]], 2
-; CHECK-NEXT: call void @use(i32 [[SHL]])
-; CHECK-NEXT: [[D:%.*]] = sdiv i32 [[SHL]], 6
-; CHECK-NEXT: ret i32 [[D]]
-;
- %shl = shl nsw i32 %x, 2
- call void @use(i32 %shl)
- %d = sdiv i32 %shl, 6
- ret i32 %d
-}
-
-define i32 @sdiv_mul_nsw_gcd_is_one(i32 %x) {
-; CHECK-LABEL: @sdiv_mul_nsw_gcd_is_one(
-; CHECK-NEXT: [[M:%.*]] = mul nsw i32 [[X:%.*]], 150
-; CHECK-NEXT: [[D:%.*]] = sdiv i32 [[M]], 101
-; CHECK-NEXT: ret i32 [[D]]
-;
- %m = mul nsw i32 %x, 150
- %d = sdiv i32 %m, 101
- ret i32 %d
-}
-; (X udiv Y) udiv Z --> X udiv (Y * Z) if Y * Z does not overflow
-
-define i8 @udiv_udiv_bounded(i8 %a, i8 range(i8 0, 15) %b, i8 range(i8 0, 15) %c) {
-; CHECK-LABEL: @udiv_udiv_bounded(
-; CHECK-NEXT: [[TMP1:%.*]] = mul nuw i8 [[B:%.*]], [[C:%.*]]
-; CHECK-NEXT: [[D2:%.*]] = udiv i8 [[A:%.*]], [[TMP1]]
-; CHECK-NEXT: ret i8 [[D2]]
-;
- %d1 = udiv i8 %a, %b
- %d2 = udiv i8 %d1, %c
- ret i8 %d2
-}
-
-; negative test - the product may overflow
-
-define i8 @udiv_udiv_unbounded(i8 %a, i8 %b, i8 %c) {
-; CHECK-LABEL: @udiv_udiv_unbounded(
-; CHECK-NEXT: [[D1:%.*]] = udiv i8 [[A:%.*]], [[B:%.*]]
-; CHECK-NEXT: [[D2:%.*]] = udiv i8 [[D1]], [[C:%.*]]
-; CHECK-NEXT: ret i8 [[D2]]
-;
- %d1 = udiv i8 %a, %b
- %d2 = udiv i8 %d1, %c
- ret i8 %d2
-}
-
-; negative test - inner div has an extra use
-
-define i32 @udiv_udiv_multiuse(i32 %a, i32 range(i32 0, 15) %b, i32 range(i32 0, 15) %c) {
-; CHECK-LABEL: @udiv_udiv_multiuse(
-; CHECK-NEXT: [[D1:%.*]] = udiv i32 [[A:%.*]], [[B:%.*]]
-; CHECK-NEXT: [[D2:%.*]] = udiv i32 [[D1]], [[C:%.*]]
-; CHECK-NEXT: call void @use(i32 [[D1]])
-; CHECK-NEXT: ret i32 [[D2]]
-;
- %d1 = udiv i32 %a, %b
- %d2 = udiv i32 %d1, %c
- call void @use(i32 %d1)
- ret i32 %d2
-}
-
-; exact propagates when both divides are exact
-
-define i8 @udiv_udiv_exact(i8 %a, i8 range(i8 0, 15) %b, i8 range(i8 0, 15) %c) {
-; CHECK-LABEL: @udiv_udiv_exact(
-; CHECK-NEXT: [[TMP1:%.*]] = mul nuw i8 [[B:%.*]], [[C:%.*]]
-; CHECK-NEXT: [[D2:%.*]] = udiv exact i8 [[A:%.*]], [[TMP1]]
-; CHECK-NEXT: ret i8 [[D2]]
-;
- %d1 = udiv exact i8 %a, %b
- %d2 = udiv exact i8 %d1, %c
- ret i8 %d2
-}
-
-; exact does not propagate when only the inner divide is exact
-
-define i8 @udiv_udiv_exact_inner_only(i8 %a, i8 range(i8 0, 15) %b, i8 range(i8 0, 15) %c) {
-; CHECK-LABEL: @udiv_udiv_exact_inner_only(
-; CHECK-NEXT: [[TMP1:%.*]] = mul nuw i8 [[B:%.*]], [[C:%.*]]
-; CHECK-NEXT: [[D2:%.*]] = udiv i8 [[A:%.*]], [[TMP1]]
-; CHECK-NEXT: ret i8 [[D2]]
-;
- %d1 = udiv exact i8 %a, %b
- %d2 = udiv i8 %d1, %c
- ret i8 %d2
-}
-
-; exact does not propagate when only the outer divide is exact
-
-define i8 @udiv_udiv_exact_outer_only(i8 %a, i8 range(i8 0, 15) %b, i8 range(i8 0, 15) %c) {
-; CHECK-LABEL: @udiv_udiv_exact_outer_only(
-; CHECK-NEXT: [[TMP1:%.*]] = mul nuw i8 [[B:%.*]], [[C:%.*]]
-; CHECK-NEXT: [[D2:%.*]] = udiv i8 [[A:%.*]], [[TMP1]]
-; CHECK-NEXT: ret i8 [[D2]]
-;
- %d1 = udiv i8 %a, %b
- %d2 = udiv exact i8 %d1, %c
- ret i8 %d2
-}
-
-; vector splat
-
-define <2 x i8> @udiv_udiv_vec(<2 x i8> %a, <2 x i8> %b, <2 x i8> %c) {
-; CHECK-LABEL: @udiv_udiv_vec(
-; CHECK-NEXT: [[B_N:%.*]] = and <2 x i8> [[B:%.*]], splat (i8 15)
-; CHECK-NEXT: [[C_N:%.*]] = and <2 x i8> [[C:%.*]], splat (i8 15)
-; CHECK-NEXT: [[TMP1:%.*]] = mul nuw <2 x i8> [[B_N]], [[C_N]]
-; CHECK-NEXT: [[D2:%.*]] = udiv <2 x i8> [[A:%.*]], [[TMP1]]
-; CHECK-NEXT: ret <2 x i8> [[D2]]
-;
- %b.n = and <2 x i8> %b, <i8 15, i8 15>
- %c.n = and <2 x i8> %c, <i8 15, i8 15>
- %d1 = udiv <2 x i8> %a, %b.n
- %d2 = udiv <2 x i8> %d1, %c.n
- ret <2 x i8> %d2
-}
-
!0 = !{!"function_entry_count", i64 1000}
;.
; CHECK: [[META0:![0-9]+]] = !{!"function_entry_count", i64 1000}
diff --git a/llvm/test/Transforms/InstCombine/frexp-implied-exponent-range-dominating-conditions.ll b/llvm/test/Transforms/InstCombine/frexp-implied-exponent-range-dominating-conditions.ll
index a7c40a96067cd..7226e64b30971 100644
--- a/llvm/test/Transforms/InstCombine/frexp-implied-exponent-range-dominating-conditions.ll
+++ b/llvm/test/Transforms/InstCombine/frexp-implied-exponent-range-dominating-conditions.ll
@@ -1244,8 +1244,9 @@ define i1 @issue208192(float nofpclass(nan inf) %x) {
; CHECK-NEXT: [[C:%.*]] = fcmp ugt float [[ABS]], 1.000000e+00
; CHECK-NEXT: br i1 [[C]], label %[[LARGE:.*]], label %[[SMALL:.*]]
; CHECK: [[SMALL]]:
-; CHECK-NEXT: [[TMP0:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[R:%.*]] = fcmp olt float [[TMP0]], 1.000000e+00
+; CHECK-NEXT: [[FX:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
+; CHECK-NEXT: [[E:%.*]] = extractvalue { float, i32 } [[FX]], 1
+; CHECK-NEXT: [[R:%.*]] = icmp slt i32 [[E]], 1
; CHECK-NEXT: ret i1 [[R]]
; CHECK: [[LARGE]]:
; CHECK-NEXT: ret i1 false
@@ -1305,8 +1306,9 @@ define i1 @frexp_exp_ogt_1_nofold(float nofpclass(nan inf) %x) {
; CHECK-NEXT: [[C:%.*]] = fcmp ogt float [[ABS]], 1.000000e+00
; CHECK-NEXT: br i1 [[C]], label %[[LARGE:.*]], label %[[SMALL:.*]]
; CHECK: [[SMALL]]:
-; CHECK-NEXT: [[TMP0:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[R:%.*]] = fcmp olt float [[TMP0]], 1.000000e+00
+; CHECK-NEXT: [[FX:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
+; CHECK-NEXT: [[E:%.*]] = extractvalue { float, i32 } [[FX]], 1
+; CHECK-NEXT: [[R:%.*]] = icmp slt i32 [[E]], 1
; CHECK-NEXT: ret i1 [[R]]
; CHECK: [[LARGE]]:
; CHECK-NEXT: ret i1 false
@@ -1418,8 +1420,9 @@ define i1 @frexp_exp_ugt_1_nofold(float nofpclass(nan inf) %x) {
; CHECK-NEXT: [[C:%.*]] = fcmp ugt float [[ABS]], 1.000000e+00
; CHECK-NEXT: br i1 [[C]], label %[[LARGE:.*]], label %[[SMALL:.*]]
; CHECK: [[SMALL]]:
-; CHECK-NEXT: [[TMP0:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[R:%.*]] = fcmp olt float [[TMP0]], 1.000000e+00
+; CHECK-NEXT: [[FX:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
+; CHECK-NEXT: [[E:%.*]] = extractvalue { float, i32 } [[FX]], 1
+; CHECK-NEXT: [[R:%.*]] = icmp slt i32 [[E]], 1
; CHECK-NEXT: ret i1 [[R]]
; CHECK: [[LARGE]]:
; CHECK-NEXT: ret i1 false
@@ -1588,8 +1591,9 @@ define i1 @frexp_exp_ole_1_nofold(float nofpclass(nan inf) %x) {
; CHECK-NEXT: [[C:%.*]] = fcmp ugt float [[ABS]], 1.000000e+00
; CHECK-NEXT: br i1 [[C]], label %[[LARGE:.*]], label %[[SMALL:.*]]
; CHECK: [[SMALL]]:
-; CHECK-NEXT: [[TMP0:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[R:%.*]] = fcmp olt float [[TMP0]], 1.000000e+00
+; CHECK-NEXT: [[FX:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
+; CHECK-NEXT: [[E:%.*]] = extractvalue { float, i32 } [[FX]], 1
+; CHECK-NEXT: [[R:%.*]] = icmp slt i32 [[E]], 1
; CHECK-NEXT: ret i1 [[R]]
; CHECK: [[LARGE]]:
; CHECK-NEXT: ret i1 false
@@ -1701,8 +1705,9 @@ define i1 @frexp_exp_ule_1_nofold(float nofpclass(nan inf) %x) {
; CHECK-NEXT: [[C:%.*]] = fcmp ule float [[ABS]], 1.000000e+00
; CHECK-NEXT: br i1 [[C]], label %[[SMALL:.*]], label %[[LARGE:.*]]
; CHECK: [[SMALL]]:
-; CHECK-NEXT: [[TMP0:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[R:%.*]] = fcmp olt float [[TMP0]], 1.000000e+00
+; CHECK-NEXT: [[FX:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
+; CHECK-NEXT: [[E:%.*]] = extractvalue { float, i32 } [[FX]], 1
+; CHECK-NEXT: [[R:%.*]] = icmp slt i32 [[E]], 1
; CHECK-NEXT: ret i1 [[R]]
; CHECK: [[LARGE]]:
; CHECK-NEXT: ret i1 false
@@ -1757,8 +1762,9 @@ define i1 @frexp_exp_oeq_1_nofold(float nofpclass(nan inf) %x) {
; CHECK-NEXT: [[C:%.*]] = fcmp oeq float [[ABS]], 1.000000e+00
; CHECK-NEXT: br i1 [[C]], label %[[SMALL:.*]], label %[[LARGE:.*]]
; CHECK: [[SMALL]]:
-; CHECK-NEXT: [[TMP0:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[R:%.*]] = fcmp olt float [[TMP0]], 1.000000e+00
+; CHECK-NEXT: [[FX:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
+; CHECK-NEXT: [[E:%.*]] = extractvalue { float, i32 } [[FX]], 1
+; CHECK-NEXT: [[R:%.*]] = icmp slt i32 [[E]], 1
; CHECK-NEXT: ret i1 [[R]]
; CHECK: [[LARGE]]:
; CHECK-NEXT: ret i1 false
@@ -1813,8 +1819,9 @@ define i1 @frexp_exp_ueq_1_nofold(float nofpclass(nan inf) %x) {
; CHECK-NEXT: [[C:%.*]] = fcmp ueq float [[ABS]], 1.000000e+00
; CHECK-NEXT: br i1 [[C]], label %[[SMALL:.*]], label %[[LARGE:.*]]
; CHECK: [[SMALL]]:
-; CHECK-NEXT: [[TMP0:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[R:%.*]] = fcmp olt float [[TMP0]], 1.000000e+00
+; CHECK-NEXT: [[FX:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
+; CHECK-NEXT: [[E:%.*]] = extractvalue { float, i32 } [[FX]], 1
+; CHECK-NEXT: [[R:%.*]] = icmp slt i32 [[E]], 1
; CHECK-NEXT: ret i1 [[R]]
; CHECK: [[LARGE]]:
; CHECK-NEXT: ret i1 false
@@ -1869,8 +1876,9 @@ define i1 @frexp_exp_one_1_nofold(float nofpclass(nan inf) %x) {
; CHECK-NEXT: [[C:%.*]] = fcmp ueq float [[ABS]], 1.000000e+00
; CHECK-NEXT: br i1 [[C]], label %[[SMALL:.*]], label %[[LARGE:.*]]
; CHECK: [[SMALL]]:
-; CHECK-NEXT: [[TMP0:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[R:%.*]] = fcmp olt float [[TMP0]], 1.000000e+00
+; CHECK-NEXT: [[FX:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
+; CHECK-NEXT: [[E:%.*]] = extractvalue { float, i32 } [[FX]], 1
+; CHECK-NEXT: [[R:%.*]] = icmp slt i32 [[E]], 1
; CHECK-NEXT: ret i1 [[R]]
; CHECK: [[LARGE]]:
; CHECK-NEXT: ret i1 false
@@ -1925,8 +1933,9 @@ define i1 @frexp_exp_une_1_nofold(float nofpclass(nan inf) %x) {
; CHECK-NEXT: [[C:%.*]] = fcmp une float [[ABS]], 1.000000e+00
; CHECK-NEXT: br i1 [[C]], label %[[LARGE:.*]], label %[[SMALL:.*]]
; CHECK: [[SMALL]]:
-; CHECK-NEXT: [[TMP0:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[R:%.*]] = fcmp olt float [[TMP0]], 1.000000e+00
+; CHECK-NEXT: [[FX:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
+; CHECK-NEXT: [[E:%.*]] = extractvalue { float, i32 } [[FX]], 1
+; CHECK-NEXT: [[R:%.*]] = icmp slt i32 [[E]], 1
; CHECK-NEXT: ret i1 [[R]]
; CHECK: [[LARGE]]:
; CHECK-NEXT: ret i1 false
@@ -2190,8 +2199,9 @@ define i1 @frexp_exp_olt_4_nofold(float nofpclass(nan inf) %x) {
; CHECK-NEXT: [[C:%.*]] = fcmp olt float [[ABS]], 4.000000e+00
; CHECK-NEXT: br i1 [[C]], label %[[SMALL:.*]], label %[[LARGE:.*]]
; CHECK: [[SMALL]]:
-; CHECK-NEXT: [[TMP0:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[R:%.*]] = fcmp olt float [[TMP0]], 2.000000e+00
+; CHECK-NEXT: [[FX:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
+; CHECK-NEXT: [[E:%.*]] = extractvalue { float, i32 } [[FX]], 1
+; CHECK-NEXT: [[R:%.*]] = icmp slt i32 [[E]], 2
; CHECK-NEXT: ret i1 [[R]]
; CHECK: [[LARGE]]:
; CHECK-NEXT: ret i1 false
@@ -2248,8 +2258,9 @@ define i1 @frexp_exp_ole_4_nofold(float nofpclass(nan inf) %x) {
; CHECK-NEXT: [[C:%.*]] = fcmp ugt float [[ABS]], 4.000000e+00
; CHECK-NEXT: br i1 [[C]], label %[[LARGE:.*]], label %[[SMALL:.*]]
; CHECK: [[SMALL]]:
-; CHECK-NEXT: [[TMP0:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[R:%.*]] = fcmp olt float [[TMP0]], 4.000000e+00
+; CHECK-NEXT: [[FX:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
+; CHECK-NEXT: [[E:%.*]] = extractvalue { float, i32 } [[FX]], 1
+; CHECK-NEXT: [[R:%.*]] = icmp slt i32 [[E]], 3
; CHECK-NEXT: ret i1 [[R]]
; CHECK: [[LARGE]]:
; CHECK-NEXT: ret i1 false
@@ -2306,8 +2317,9 @@ define i1 @frexp_exp_olt_3_nofold(float nofpclass(nan inf) %x) {
; CHECK-NEXT: [[C:%.*]] = fcmp olt float [[ABS]], 3.000000e+00
; CHECK-NEXT: br i1 [[C]], label %[[SMALL:.*]], label %[[LARGE:.*]]
; CHECK: [[SMALL]]:
-; CHECK-NEXT: [[TMP0:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[R:%.*]] = fcmp olt float [[TMP0]], 2.000000e+00
+; CHECK-NEXT: [[FX:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
+; CHECK-NEXT: [[E:%.*]] = extractvalue { float, i32 } [[FX]], 1
+; CHECK-NEXT: [[R:%.*]] = icmp slt i32 [[E]], 2
; CHECK-NEXT: ret i1 [[R]]
; CHECK: [[LARGE]]:
; CHECK-NEXT: ret i1 false
@@ -2362,8 +2374,9 @@ define i1 @frexp_exp_ole_3_nofold(float nofpclass(nan inf) %x) {
; CHECK-NEXT: [[C:%.*]] = fcmp ugt float [[ABS]], 3.000000e+00
; CHECK-NEXT: br i1 [[C]], label %[[LARGE:.*]], label %[[SMALL:.*]]
; CHECK: [[SMALL]]:
-; CHECK-NEXT: [[TMP0:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[R:%.*]] = fcmp olt float [[TMP0]], 2.000000e+00
+; CHECK-NEXT: [[FX:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
+; CHECK-NEXT: [[E:%.*]] = extractvalue { float, i32 } [[FX]], 1
+; CHECK-NEXT: [[R:%.*]] = icmp slt i32 [[E]], 2
; CHECK-NEXT: ret i1 [[R]]
; CHECK: [[LARGE]]:
; CHECK-NEXT: ret i1 false
@@ -2421,8 +2434,9 @@ define i1 @frexp_exp_negative_limit(float nofpclass(nan inf) %x) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: br i1 true, label %[[SMALL:.*]], label %[[LARGE:.*]]
; CHECK: [[SMALL]]:
-; CHECK-NEXT: [[TMP0:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[R:%.*]] = fcmp olt float [[TMP0]], 2.000000e+00
+; CHECK-NEXT: [[FX:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
+; CHECK-NEXT: [[E:%.*]] = extractvalue { float, i32 } [[FX]], 1
+; CHECK-NEXT: [[R:%.*]] = icmp slt i32 [[E]], 2
; CHECK-NEXT: ret i1 [[R]]
; CHECK: [[LARGE]]:
; CHECK-NEXT: ret i1 false
diff --git a/llvm/test/Transforms/InstCombine/icmp-lowbit.ll b/llvm/test/Transforms/InstCombine/icmp-lowbit.ll
deleted file mode 100644
index 838e07ee4d64a..0000000000000
--- a/llvm/test/Transforms/InstCombine/icmp-lowbit.ll
+++ /dev/null
@@ -1,261 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
-; RUN: opt < %s -passes=instcombine -S | FileCheck %s
-
-; x & -x isolates the lowest set bit of x, or produces zero if x is zero.
-; (x & -x) == 0 --> x == 0
-; (x & -x) != 0 --> x != 0
-; (x & -x) == 1 --> trunc x to i1
-; (x & -x) != 1 --> xor (trunc x to i1), true
-
-; Scalar tests with different integer widths.
-
-; i2, (x & -x) == 0 --> x == 0
-define i1 @lowbit_eq_zero_i2(i2 %x) {
-; CHECK-LABEL: define i1 @lowbit_eq_zero_i2(
-; CHECK-SAME: i2 [[X:%.*]]) {
-; CHECK-NEXT: [[R:%.*]] = icmp eq i2 [[X]], 0
-; CHECK-NEXT: ret i1 [[R]]
-;
- %neg = sub i2 0, %x
- %lowbit = and i2 %x, %neg
- %r = icmp eq i2 %lowbit, 0
- ret i1 %r
-}
-
-; i8, (x & -x) != 0 --> x != 0
-define i1 @lowbit_ne_zero_i8(i8 %x) {
-; CHECK-LABEL: define i1 @lowbit_ne_zero_i8(
-; CHECK-SAME: i8 [[X:%.*]]) {
-; CHECK-NEXT: [[R:%.*]] = icmp ne i8 [[X]], 0
-; CHECK-NEXT: ret i1 [[R]]
-;
- %neg = sub i8 0, %x
- %lowbit = and i8 %x, %neg
- %r = icmp ne i8 %lowbit, 0
- ret i1 %r
-}
-
-; i32, (x & -x) == 1 --> trunc x to i1
-define i1 @lowbit_eq_one_i32(i32 %x) {
-; CHECK-LABEL: define i1 @lowbit_eq_one_i32(
-; CHECK-SAME: i32 [[X:%.*]]) {
-; CHECK-NEXT: [[R:%.*]] = trunc i32 [[X]] to i1
-; CHECK-NEXT: ret i1 [[R]]
-;
- %neg = sub i32 0, %x
- %lowbit = and i32 %x, %neg
- %r = icmp eq i32 %lowbit, 1
- ret i1 %r
-}
-
-; i64, (x & -x) != 1 --> xor (trunc x to i1), true
-define i1 @lowbit_ne_one_i64(i64 %x) {
-; CHECK-LABEL: define i1 @lowbit_ne_one_i64(
-; CHECK-SAME: i64 [[X:%.*]]) {
-; CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[X]] to i1
-; CHECK-NEXT: [[R:%.*]] = xor i1 [[TMP1]], true
-; CHECK-NEXT: ret i1 [[R]]
-;
- %neg = sub i64 0, %x
- %lowbit = and i64 %x, %neg
- %r = icmp ne i64 %lowbit, 1
- ret i1 %r
-}
-
-; Fixed-width vector tests cover all four comparisons.
-
-; <2 x i8>, (x & -x) == 0 --> x == 0
-define <2 x i1> @lowbit_eq_zero_v2i8(<2 x i8> %x) {
-; CHECK-LABEL: define <2 x i1> @lowbit_eq_zero_v2i8(
-; CHECK-SAME: <2 x i8> [[X:%.*]]) {
-; CHECK-NEXT: [[R:%.*]] = icmp eq <2 x i8> [[X]], zeroinitializer
-; CHECK-NEXT: ret <2 x i1> [[R]]
-;
- %neg = sub <2 x i8> zeroinitializer, %x
- %lowbit = and <2 x i8> %x, %neg
- %r = icmp eq <2 x i8> %lowbit, zeroinitializer
- ret <2 x i1> %r
-}
-
-; <2 x i8>, (x & -x) != 0 --> x != 0
-define <2 x i1> @lowbit_ne_zero_v2i8(<2 x i8> %x) {
-; CHECK-LABEL: define <2 x i1> @lowbit_ne_zero_v2i8(
-; CHECK-SAME: <2 x i8> [[X:%.*]]) {
-; CHECK-NEXT: [[R:%.*]] = icmp ne <2 x i8> [[X]], zeroinitializer
-; CHECK-NEXT: ret <2 x i1> [[R]]
-;
- %neg = sub <2 x i8> zeroinitializer, %x
- %lowbit = and <2 x i8> %x, %neg
- %r = icmp ne <2 x i8> %lowbit, zeroinitializer
- ret <2 x i1> %r
-}
-
-; <2 x i8>, (x & -x) == 1 --> trunc x to <2 x i1>
-define <2 x i1> @lowbit_eq_one_v2i8(<2 x i8> %x) {
-; CHECK-LABEL: define <2 x i1> @lowbit_eq_one_v2i8(
-; CHECK-SAME: <2 x i8> [[X:%.*]]) {
-; CHECK-NEXT: [[R:%.*]] = trunc <2 x i8> [[X]] to <2 x i1>
-; CHECK-NEXT: ret <2 x i1> [[R]]
-;
- %neg = sub <2 x i8> zeroinitializer, %x
- %lowbit = and <2 x i8> %x, %neg
- %r = icmp eq <2 x i8> %lowbit, splat (i8 1)
- ret <2 x i1> %r
-}
-
-; <2 x i8>, (x & -x) != 1 --> xor (trunc x to <2 x i1>), true
-define <2 x i1> @lowbit_ne_one_v2i8(<2 x i8> %x) {
-; CHECK-LABEL: define <2 x i1> @lowbit_ne_one_v2i8(
-; CHECK-SAME: <2 x i8> [[X:%.*]]) {
-; CHECK-NEXT: [[TMP1:%.*]] = trunc <2 x i8> [[X]] to <2 x i1>
-; CHECK-NEXT: [[R:%.*]] = xor <2 x i1> [[TMP1]], splat (i1 true)
-; CHECK-NEXT: ret <2 x i1> [[R]]
-;
- %neg = sub <2 x i8> zeroinitializer, %x
- %lowbit = and <2 x i8> %x, %neg
- %r = icmp ne <2 x i8> %lowbit, splat (i8 1)
- ret <2 x i1> %r
-}
-
-; Scalable vector tests cover all four comparisons.
-
-; <vscale x 2 x i8>, (x & -x) == 0 --> x == 0
-define <vscale x 2 x i1> @lowbit_eq_zero_nxv2i8(<vscale x 2 x i8> %x) {
-; CHECK-LABEL: define <vscale x 2 x i1> @lowbit_eq_zero_nxv2i8(
-; CHECK-SAME: <vscale x 2 x i8> [[X:%.*]]) {
-; CHECK-NEXT: [[R:%.*]] = icmp eq <vscale x 2 x i8> [[X]], zeroinitializer
-; CHECK-NEXT: ret <vscale x 2 x i1> [[R]]
-;
- %neg = sub <vscale x 2 x i8> zeroinitializer, %x
- %lowbit = and <vscale x 2 x i8> %x, %neg
- %r = icmp eq <vscale x 2 x i8> %lowbit, zeroinitializer
- ret <vscale x 2 x i1> %r
-}
-
-; <vscale x 2 x i8>, (x & -x) != 0 --> x != 0
-define <vscale x 2 x i1> @lowbit_ne_zero_nxv2i8(<vscale x 2 x i8> %x) {
-; CHECK-LABEL: define <vscale x 2 x i1> @lowbit_ne_zero_nxv2i8(
-; CHECK-SAME: <vscale x 2 x i8> [[X:%.*]]) {
-; CHECK-NEXT: [[R:%.*]] = icmp ne <vscale x 2 x i8> [[X]], zeroinitializer
-; CHECK-NEXT: ret <vscale x 2 x i1> [[R]]
-;
- %neg = sub <vscale x 2 x i8> zeroinitializer, %x
- %lowbit = and <vscale x 2 x i8> %x, %neg
- %r = icmp ne <vscale x 2 x i8> %lowbit, zeroinitializer
- ret <vscale x 2 x i1> %r
-}
-
-; <vscale x 2 x i8>, (x & -x) == 1 --> trunc x to <vscale x 2 x i1>
-define <vscale x 2 x i1> @lowbit_eq_one_nxv2i8(<vscale x 2 x i8> %x) {
-; CHECK-LABEL: define <vscale x 2 x i1> @lowbit_eq_one_nxv2i8(
-; CHECK-SAME: <vscale x 2 x i8> [[X:%.*]]) {
-; CHECK-NEXT: [[R:%.*]] = trunc <vscale x 2 x i8> [[X]] to <vscale x 2 x i1>
-; CHECK-NEXT: ret <vscale x 2 x i1> [[R]]
-;
- %neg = sub <vscale x 2 x i8> zeroinitializer, %x
- %lowbit = and <vscale x 2 x i8> %x, %neg
- %r = icmp eq <vscale x 2 x i8> %lowbit, splat (i8 1)
- ret <vscale x 2 x i1> %r
-}
-
-; <vscale x 2 x i8>, (x & -x) != 1 --> xor (trunc x to <vscale x 2 x i1>), true
-define <vscale x 2 x i1> @lowbit_ne_one_nxv2i8(<vscale x 2 x i8> %x) {
-; CHECK-LABEL: define <vscale x 2 x i1> @lowbit_ne_one_nxv2i8(
-; CHECK-SAME: <vscale x 2 x i8> [[X:%.*]]) {
-; CHECK-NEXT: [[TMP1:%.*]] = trunc <vscale x 2 x i8> [[X]] to <vscale x 2 x i1>
-; CHECK-NEXT: [[R:%.*]] = xor <vscale x 2 x i1> [[TMP1]], splat (i1 true)
-; CHECK-NEXT: ret <vscale x 2 x i1> [[R]]
-;
- %neg = sub <vscale x 2 x i8> zeroinitializer, %x
- %lowbit = and <vscale x 2 x i8> %x, %neg
- %r = icmp ne <vscale x 2 x i8> %lowbit, splat (i8 1)
- ret <vscale x 2 x i1> %r
-}
-
-; The operands of the and may be commuted.
-
-define i1 @lowbit_ne_one_commuted_i8(i8 %x) {
-; CHECK-LABEL: define i1 @lowbit_ne_one_commuted_i8(
-; CHECK-SAME: i8 [[X:%.*]]) {
-; CHECK-NEXT: [[TMP1:%.*]] = trunc i8 [[X]] to i1
-; CHECK-NEXT: [[R:%.*]] = xor i1 [[TMP1]], true
-; CHECK-NEXT: ret i1 [[R]]
-;
- %neg = sub i8 0, %x
- %lowbit = and i8 %neg, %x
- %r = icmp ne i8 %lowbit, 1
- ret i1 %r
-}
-
-; Zero comparisons do not require the negation or lowbit to have one use.
-
-declare void @use_i8(i8)
-
-define i1 @lowbit_eq_zero_neg_extra_use_i8(i8 %x) {
-; CHECK-LABEL: define i1 @lowbit_eq_zero_neg_extra_use_i8(
-; CHECK-SAME: i8 [[X:%.*]]) {
-; CHECK-NEXT: [[NEG:%.*]] = sub i8 0, [[X]]
-; CHECK-NEXT: call void @use_i8(i8 [[NEG]])
-; CHECK-NEXT: [[R:%.*]] = icmp eq i8 [[X]], 0
-; CHECK-NEXT: ret i1 [[R]]
-;
- %neg = sub i8 0, %x
- call void @use_i8(i8 %neg)
- %lowbit = and i8 %x, %neg
- %r = icmp eq i8 %lowbit, 0
- ret i1 %r
-}
-
-define i1 @lowbit_eq_zero_extra_uses_i8(i8 %x) {
-; CHECK-LABEL: define i1 @lowbit_eq_zero_extra_uses_i8(
-; CHECK-SAME: i8 [[X:%.*]]) {
-; CHECK-NEXT: [[NEG:%.*]] = sub i8 0, [[X]]
-; CHECK-NEXT: call void @use_i8(i8 [[NEG]])
-; CHECK-NEXT: [[LOWBIT:%.*]] = and i8 [[X]], [[NEG]]
-; CHECK-NEXT: call void @use_i8(i8 [[LOWBIT]])
-; CHECK-NEXT: [[R:%.*]] = icmp eq i8 [[X]], 0
-; CHECK-NEXT: ret i1 [[R]]
-;
- %neg = sub i8 0, %x
- call void @use_i8(i8 %neg)
- %lowbit = and i8 %x, %neg
- call void @use_i8(i8 %lowbit)
- %r = icmp eq i8 %lowbit, 0
- ret i1 %r
-}
-
-; Do not fold != 1 when lowbit has another use, as that would increase the
-; instruction count.
-
-define i1 @lowbit_ne_one_extra_use_i8(i8 %x) {
-; CHECK-LABEL: define i1 @lowbit_ne_one_extra_use_i8(
-; CHECK-SAME: i8 [[X:%.*]]) {
-; CHECK-NEXT: [[NEG:%.*]] = sub i8 0, [[X]]
-; CHECK-NEXT: [[LOWBIT:%.*]] = and i8 [[X]], [[NEG]]
-; CHECK-NEXT: call void @use_i8(i8 [[LOWBIT]])
-; CHECK-NEXT: [[R:%.*]] = icmp ne i8 [[LOWBIT]], 1
-; CHECK-NEXT: ret i1 [[R]]
-;
- %neg = sub i8 0, %x
- %lowbit = and i8 %x, %neg
- call void @use_i8(i8 %lowbit)
- %r = icmp ne i8 %lowbit, 1
- ret i1 %r
-}
-
-; Negative test: the negated operand must be the negation of the other and
-; operand.
-
-define i1 @not_lowbit_eq_zero_different_operands_i8(i8 %x, i8 %y) {
-; CHECK-LABEL: define i1 @not_lowbit_eq_zero_different_operands_i8(
-; CHECK-SAME: i8 [[X:%.*]], i8 [[Y:%.*]]) {
-; CHECK-NEXT: [[NEG:%.*]] = sub i8 0, [[Y]]
-; CHECK-NEXT: [[NOT_LOWBIT:%.*]] = and i8 [[X]], [[NEG]]
-; CHECK-NEXT: [[R:%.*]] = icmp eq i8 [[NOT_LOWBIT]], 0
-; CHECK-NEXT: ret i1 [[R]]
-;
- %neg = sub i8 0, %y
- %not_lowbit = and i8 %x, %neg
- %r = icmp eq i8 %not_lowbit, 0
- ret i1 %r
-}
diff --git a/llvm/test/Transforms/InstCombine/known-non-zero.ll b/llvm/test/Transforms/InstCombine/known-non-zero.ll
index ead43b2ea29a8..9bfec0d7289dd 100644
--- a/llvm/test/Transforms/InstCombine/known-non-zero.ll
+++ b/llvm/test/Transforms/InstCombine/known-non-zero.ll
@@ -315,29 +315,3 @@ non_zero:
exit:
ret i64 -1
}
-
-define i32 @test0_odd_mul(i64 %x) {
-; CHECK-LABEL: @test0_odd_mul(
-; CHECK-NEXT: start:
-; CHECK-NEXT: [[C:%.*]] = icmp eq i64 [[X:%.*]], 0
-; CHECK-NEXT: br i1 [[C]], label [[EXIT:%.*]], label [[NON_ZERO:%.*]]
-; CHECK: non_zero:
-; CHECK-NEXT: [[CTZ:%.*]] = call range(i64 0, 65) i64 @llvm.cttz.i64(i64 [[X]], i1 true)
-; CHECK-NEXT: [[CTZ32:%.*]] = trunc nuw nsw i64 [[CTZ]] to i32
-; CHECK-NEXT: br label [[EXIT]]
-; CHECK: exit:
-; CHECK-NEXT: [[RES:%.*]] = phi i32 [ [[CTZ32]], [[NON_ZERO]] ], [ 0, [[START:%.*]] ]
-; CHECK-NEXT: ret i32 [[RES]]
-;
-start:
- %c = icmp eq i64 %x, 0
- br i1 %c, label %exit, label %non_zero
-non_zero:
- %m = mul i64 %x, 3
- %ctz = call i64 @llvm.cttz.i64(i64 %m, i1 false)
- %ctz32 = trunc i64 %ctz to i32
- br label %exit
-exit:
- %res = phi i32 [ %ctz32, %non_zero ], [ 0, %start ]
- ret i32 %res
-}
diff --git a/llvm/test/Transforms/InstCombine/known-range-frexp-exp.ll b/llvm/test/Transforms/InstCombine/known-range-frexp-exp.ll
index 50ee28dcbe8dc..c6f3153f8c435 100644
--- a/llvm/test/Transforms/InstCombine/known-range-frexp-exp.ll
+++ b/llvm/test/Transforms/InstCombine/known-range-frexp-exp.ll
@@ -1,8 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
; RUN: opt -S -passes=instcombine < %s | FileCheck %s
-declare void @use.i32(i32)
-
define i32 @frexp_f32_clamp_min(float %x) {
; CHECK-LABEL: define i32 @frexp_f32_clamp_min(
; CHECK-SAME: float [[X:%.*]]) {
@@ -157,142 +155,3 @@ define i32 @frexp_f32_clamp_min_no_nan_inf(float nofpclass(nan inf) %x) {
%clamp = call i32 @llvm.smax.i32(i32 %exp, i32 -148)
ret i32 %clamp
}
-
-;Fold icmp on frexp's exponent result into an fcmp against fabs(x).
-; Float exponent signed less-than comparison.
-define i1 @frexp_slt_float(float nofpclass(nan inf) %x) {
-; CHECK-LABEL: define i1 @frexp_slt_float(
-; CHECK-SAME: float nofpclass(nan inf) [[X:%.*]]) {
-; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[V2:%.*]] = fcmp olt float [[TMP1]], f0x4B000000
-; CHECK-NEXT: ret i1 [[V2]]
-;
- %v0 = call { float, i32 } @llvm.frexp.f32.i32(float %x)
- %v1 = extractvalue { float, i32 } %v0, 1
- %v2 = icmp slt i32 %v1, 24
- ret i1 %v2
-}
-
-; Double exponent signed less-than comparison.
-define i1 @frexp_slt_double(double nofpclass(nan inf) %x) {
-; CHECK-LABEL: define i1 @frexp_slt_double(
-; CHECK-SAME: double nofpclass(nan inf) [[X:%.*]]) {
-; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.fabs.f64(double [[X]])
-; CHECK-NEXT: [[V2:%.*]] = fcmp olt double [[TMP1]], 5.120000e+02
-; CHECK-NEXT: ret i1 [[V2]]
-;
- %v0 = call { double, i32 } @llvm.frexp.f64.i32(double %x)
- %v1 = extractvalue { double, i32 } %v0, 1
- %v2 = icmp slt i32 %v1, 10
- ret i1 %v2
-}
-
-;128 bit exponent signed less-than comparison
-define i1 @frexp_slt_fp128(fp128 nofpclass(nan inf) %x) {
-; CHECK-LABEL: define i1 @frexp_slt_fp128(
-; CHECK-SAME: fp128 nofpclass(nan inf) [[X:%.*]]) {
-; CHECK-NEXT: [[TMP1:%.*]] = call fp128 @llvm.fabs.f128(fp128 [[X]])
-; CHECK-NEXT: [[V2:%.*]] = fcmp olt fp128 [[TMP1]], f0x7FFE0000000000000000000000000000
-; CHECK-NEXT: ret i1 [[V2]]
-;
- %v0 = call { fp128, i128 } @llvm.frexp.fp128.i128(fp128 %x)
- %v1 = extractvalue { fp128, i128 } %v0, 1
- %v2 = icmp slt i128 %v1, 16384
- ret i1 %v2
-}
-
-; Float exponent signed greater-than comparison.
-define i1 @frexp_sgt_float(float nofpclass(nan inf) %x) {
-; CHECK-LABEL: define i1 @frexp_sgt_float(
-; CHECK-SAME: float nofpclass(nan inf) [[X:%.*]]) {
-; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.fabs.f32(float [[X]])
-; CHECK-NEXT: [[V2:%.*]] = fcmp oge float [[TMP1]], 1.310720e+05
-; CHECK-NEXT: ret i1 [[V2]]
-;
- %v0 = call { float, i32 } @llvm.frexp.f32.i32(float %x)
- %v1 = extractvalue { float, i32 } %v0, 1
- %v2 = icmp sgt i32 %v1, 17
- ret i1 %v2
-}
-
-; Splat vector test.
-define <2 x i1> @frexp_slt_splat(<2 x float> nofpclass(nan inf) %x) {
-; CHECK-LABEL: define <2 x i1> @frexp_slt_splat(
-; CHECK-SAME: <2 x float> nofpclass(nan inf) [[X:%.*]]) {
-; CHECK-NEXT: [[TMP1:%.*]] = call <2 x float> @llvm.fabs.v2f32(<2 x float> [[X]])
-; CHECK-NEXT: [[V2:%.*]] = fcmp olt <2 x float> [[TMP1]], splat (float 1.600000e+01)
-; CHECK-NEXT: ret <2 x i1> [[V2]]
-;
- %v0 = call { <2 x float>, <2 x i32> } @llvm.frexp.v2f32.v2i32(<2 x float> %x)
- %v1 = extractvalue { <2 x float>, <2 x i32> } %v0, 1
- %v2 = icmp slt <2 x i32> %v1, splat (i32 5)
- ret <2 x i1> %v2
-}
-
-; Negative test - exponent may come from a NaN or Inf input.
-define i1 @frexp_slt_no_fold_maybe_nan_inf(float %x) {
-; CHECK-LABEL: define i1 @frexp_slt_no_fold_maybe_nan_inf(
-; CHECK-SAME: float [[X:%.*]]) {
-; CHECK-NEXT: [[V0:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
-; CHECK-NEXT: [[V1:%.*]] = extractvalue { float, i32 } [[V0]], 1
-; CHECK-NEXT: [[V2:%.*]] = icmp slt i32 [[V1]], 24
-; CHECK-NEXT: ret i1 [[V2]]
-;
- %v0 = call { float, i32 } @llvm.frexp.f32.i32(float %x)
- %v1 = extractvalue { float, i32 } %v0, 1
- %v2 = icmp slt i32 %v1, 24
- ret i1 %v2
-}
-
-; Negative test - Negative exponent.
-define i1 @frexp_slt_no_fold_negative_exp(float nofpclass(nan inf) %x) {
-; CHECK-LABEL: define i1 @frexp_slt_no_fold_negative_exp(
-; CHECK-SAME: float nofpclass(nan inf) [[X:%.*]]) {
-; CHECK-NEXT: [[V0:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
-; CHECK-NEXT: [[V1:%.*]] = extractvalue { float, i32 } [[V0]], 1
-; CHECK-NEXT: [[V2:%.*]] = icmp slt i32 [[V1]], 0
-; CHECK-NEXT: ret i1 [[V2]]
-;
- %v0 = call { float, i32 } @llvm.frexp.f32.i32(float %x)
- %v1 = extractvalue { float, i32 } %v0, 1
- %v2 = icmp slt i32 %v1, 0
- ret i1 %v2
-}
-
-; Negative test- extractvalue has an additional use.
-define i1 @frexp_slt_no_fold_exp_multi_use(float nofpclass(nan inf) %x) {
-; CHECK-LABEL: define i1 @frexp_slt_no_fold_exp_multi_use(
-; CHECK-SAME: float nofpclass(nan inf) [[X:%.*]]) {
-; CHECK-NEXT: [[V0:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
-; CHECK-NEXT: [[V1:%.*]] = extractvalue { float, i32 } [[V0]], 1
-; CHECK-NEXT: call void @use.i32(i32 [[V1]])
-; CHECK-NEXT: [[V2:%.*]] = icmp slt i32 [[V1]], 5
-; CHECK-NEXT: ret i1 [[V2]]
-;
- %v0 = call { float, i32 } @llvm.frexp.f32.i32(float %x)
- %v1 = extractvalue { float, i32 } %v0, 1
- call void @use.i32(i32 %v1)
- %v2 = icmp slt i32 %v1, 5
- ret i1 %v2
-}
-
-;Negative test- frexp result has multiple use .
-define { float, i1 } @frexp_slt_no_fold_mantissa_use(float nofpclass(nan inf) %x) {
-; CHECK-LABEL: define { float, i1 } @frexp_slt_no_fold_mantissa_use(
-; CHECK-SAME: float nofpclass(nan inf) [[X:%.*]]) {
-; CHECK-NEXT: [[V0:%.*]] = call { float, i32 } @llvm.frexp.f32.i32(float [[X]])
-; CHECK-NEXT: [[MANT:%.*]] = extractvalue { float, i32 } [[V0]], 0
-; CHECK-NEXT: [[EXP:%.*]] = extractvalue { float, i32 } [[V0]], 1
-; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[EXP]], 24
-; CHECK-NEXT: [[R0:%.*]] = insertvalue { float, i1 } poison, float [[MANT]], 0
-; CHECK-NEXT: [[R1:%.*]] = insertvalue { float, i1 } [[R0]], i1 [[CMP]], 1
-; CHECK-NEXT: ret { float, i1 } [[R1]]
-;
- %v0 = call { float, i32 } @llvm.frexp.f32.i32(float %x)
- %mant = extractvalue { float, i32 } %v0, 0
- %exp = extractvalue { float, i32 } %v0, 1
- %cmp = icmp slt i32 %exp, 24
- %r0 = insertvalue { float, i1 } poison, float %mant, 0
- %r1 = insertvalue { float, i1 } %r0, i1 %cmp, 1
- ret { float, i1 } %r1
-}
diff --git a/llvm/test/Transforms/InstCombine/select-cmp-cttz-ctlz.ll b/llvm/test/Transforms/InstCombine/select-cmp-cttz-ctlz.ll
index 5d76cfb73f2a4..c1afdfef97a1c 100644
--- a/llvm/test/Transforms/InstCombine/select-cmp-cttz-ctlz.ll
+++ b/llvm/test/Transforms/InstCombine/select-cmp-cttz-ctlz.ll
@@ -835,180 +835,6 @@ define i32 @test_abs_int_min_poison_wrong_const(i32 %arg) {
ret i32 %sel
}
-; (X == 0) ? C : ctz(X * OddC) --> is_zero_poison can be set
-
-define i32 @test_cttz_not_bw_odd_mul(i32 %x) {
-; CHECK-LABEL: @test_cttz_not_bw_odd_mul(
-; CHECK-NEXT: [[CT:%.*]] = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 [[X:%.*]], i1 true)
-; CHECK-NEXT: [[CMP_NOT:%.*]] = icmp eq i32 [[X]], 0
-; CHECK-NEXT: [[RES:%.*]] = select i1 [[CMP_NOT]], i32 123, i32 [[CT]]
-; CHECK-NEXT: ret i32 [[RES]]
-;
- %m = mul i32 %x, 3
- %ct = tail call i32 @llvm.cttz.i32(i32 %m, i1 false)
- %cmp = icmp ne i32 %x, 0
- %res = select i1 %cmp, i32 %ct, i32 123
- ret i32 %res
-}
-
-define i32 @test_cttz_not_bw_odd_mul_eq(i32 %x) {
-; CHECK-LABEL: @test_cttz_not_bw_odd_mul_eq(
-; CHECK-NEXT: [[CT:%.*]] = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 [[X:%.*]], i1 true)
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[X]], 0
-; CHECK-NEXT: [[RES:%.*]] = select i1 [[CMP]], i32 123, i32 [[CT]]
-; CHECK-NEXT: ret i32 [[RES]]
-;
- %m = mul i32 %x, 3
- %ct = tail call i32 @llvm.cttz.i32(i32 %m, i1 false)
- %cmp = icmp eq i32 %x, 0
- %res = select i1 %cmp, i32 123, i32 %ct
- ret i32 %res
-}
-
-
-define i32 @test_cttz_not_bw_large_odd_mul(i32 %x) {
-; CHECK-LABEL: @test_cttz_not_bw_large_odd_mul(
-; CHECK-NEXT: [[CT:%.*]] = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 [[X:%.*]], i1 true)
-; CHECK-NEXT: [[CMP_NOT:%.*]] = icmp eq i32 [[X]], 0
-; CHECK-NEXT: [[RES:%.*]] = select i1 [[CMP_NOT]], i32 123, i32 [[CT]]
-; CHECK-NEXT: ret i32 [[RES]]
-;
- %m = mul i32 %x, 1234567
- %ct = tail call i32 @llvm.cttz.i32(i32 %m, i1 false)
- %cmp = icmp ne i32 %x, 0
- %res = select i1 %cmp, i32 %ct, i32 123
- ret i32 %res
-}
-
-
-define <2 x i32> @test_cttz_not_bw_odd_mul_vec(<2 x i32> %x) {
-; CHECK-LABEL: @test_cttz_not_bw_odd_mul_vec(
-; CHECK-NEXT: [[CT:%.*]] = call range(i32 0, 33) <2 x i32> @llvm.cttz.v2i32(<2 x i32> [[X:%.*]], i1 true)
-; CHECK-NEXT: [[CMP_NOT:%.*]] = icmp eq <2 x i32> [[X]], zeroinitializer
-; CHECK-NEXT: [[RES:%.*]] = select <2 x i1> [[CMP_NOT]], <2 x i32> splat (i32 123), <2 x i32> [[CT]]
-; CHECK-NEXT: ret <2 x i32> [[RES]]
-;
- %m = mul <2 x i32> %x, splat (i32 3)
- %ct = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %m, i1 false)
- %cmp = icmp ne <2 x i32> %x, zeroinitializer
- %res = select <2 x i1> %cmp, <2 x i32> %ct, <2 x i32> splat (i32 123)
- ret <2 x i32> %res
-}
-
-; negative test - X * 6 can be zero for non-zero X (X = 2^31)
-
-define i32 @test_cttz_not_bw_even_mul(i32 %x) {
-; CHECK-LABEL: @test_cttz_not_bw_even_mul(
-; CHECK-NEXT: [[M:%.*]] = mul i32 [[X:%.*]], 6
-; CHECK-NEXT: [[CT:%.*]] = tail call range(i32 1, 33) i32 @llvm.cttz.i32(i32 [[M]], i1 false)
-; CHECK-NEXT: [[CMP_NOT:%.*]] = icmp eq i32 [[X]], 0
-; CHECK-NEXT: [[RES:%.*]] = select i1 [[CMP_NOT]], i32 123, i32 [[CT]]
-; CHECK-NEXT: ret i32 [[RES]]
-;
- %m = mul i32 %x, 6
- %ct = tail call i32 @llvm.cttz.i32(i32 %m, i1 false)
- %cmp = icmp ne i32 %x, 0
- %res = select i1 %cmp, i32 %ct, i32 123
- ret i32 %res
-}
-
-; negative test
-
-define i32 @test_cttz_not_bw_even_mul_eq(i32 %x) {
-; CHECK-LABEL: @test_cttz_not_bw_even_mul_eq(
-; CHECK-NEXT: [[M:%.*]] = mul i32 [[X:%.*]], 12
-; CHECK-NEXT: [[CT:%.*]] = tail call range(i32 2, 33) i32 @llvm.cttz.i32(i32 [[M]], i1 false)
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[X]], 0
-; CHECK-NEXT: [[RES:%.*]] = select i1 [[CMP]], i32 123, i32 [[CT]]
-; CHECK-NEXT: ret i32 [[RES]]
-;
- %m = mul i32 %x, 12
- %ct = tail call i32 @llvm.cttz.i32(i32 %m, i1 false)
- %cmp = icmp eq i32 %x, 0
- %res = select i1 %cmp, i32 123, i32 %ct
- ret i32 %res
-}
-
-; negative test - one lane is even
-
-define <2 x i32> @test_cttz_not_bw_mixed_mul_vec(<2 x i32> %x) {
-; CHECK-LABEL: @test_cttz_not_bw_mixed_mul_vec(
-; CHECK-NEXT: [[M:%.*]] = mul <2 x i32> [[X:%.*]], <i32 3, i32 6>
-; CHECK-NEXT: [[CT:%.*]] = tail call range(i32 0, 33) <2 x i32> @llvm.cttz.v2i32(<2 x i32> [[M]], i1 false)
-; CHECK-NEXT: [[CMP_NOT:%.*]] = icmp eq <2 x i32> [[X]], zeroinitializer
-; CHECK-NEXT: [[RES:%.*]] = select <2 x i1> [[CMP_NOT]], <2 x i32> splat (i32 123), <2 x i32> [[CT]]
-; CHECK-NEXT: ret <2 x i32> [[RES]]
-;
- %m = mul <2 x i32> %x, <i32 3, i32 6>
- %ct = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %m, i1 false)
- %cmp = icmp ne <2 x i32> %x, zeroinitializer
- %res = select <2 x i1> %cmp, <2 x i32> %ct, <2 x i32> splat (i32 123)
- ret <2 x i32> %res
-}
-
-; negative test - compared against a non-zero constant
-
-define i32 @test_cttz_not_bw_odd_mul_nonzero_cmp(i32 %x) {
-; CHECK-LABEL: @test_cttz_not_bw_odd_mul_nonzero_cmp(
-; CHECK-NEXT: [[CT:%.*]] = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 [[X:%.*]], i1 false)
-; CHECK-NEXT: [[CMP_NOT:%.*]] = icmp eq i32 [[X]], 5
-; CHECK-NEXT: [[RES:%.*]] = select i1 [[CMP_NOT]], i32 123, i32 [[CT]]
-; CHECK-NEXT: ret i32 [[RES]]
-;
- %m = mul i32 %x, 3
- %ct = tail call i32 @llvm.cttz.i32(i32 %m, i1 false)
- %cmp = icmp ne i32 %x, 5
- %res = select i1 %cmp, i32 %ct, i32 123
- ret i32 %res
-}
-
-; negative test - mul operand is not the compared value
-
-define i32 @test_cttz_not_bw_odd_mul_wrong_op(i32 %x, i32 %y) {
-; CHECK-LABEL: @test_cttz_not_bw_odd_mul_wrong_op(
-; CHECK-NEXT: [[CT:%.*]] = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 [[Y:%.*]], i1 false)
-; CHECK-NEXT: [[CMP_NOT:%.*]] = icmp eq i32 [[X:%.*]], 0
-; CHECK-NEXT: [[RES:%.*]] = select i1 [[CMP_NOT]], i32 123, i32 [[CT]]
-; CHECK-NEXT: ret i32 [[RES]]
-;
- %m = mul i32 %y, 3
- %ct = tail call i32 @llvm.cttz.i32(i32 %m, i1 false)
- %cmp = icmp ne i32 %x, 0
- %res = select i1 %cmp, i32 %ct, i32 123
- ret i32 %res
-}
-
-; negative test - extra use of the intrinsic
-
-define i32 @test_cttz_not_bw_odd_mul_multiuse(i32 %x) {
-; CHECK-LABEL: @test_cttz_not_bw_odd_mul_multiuse(
-; CHECK-NEXT: [[CT:%.*]] = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 [[X:%.*]], i1 false)
-; CHECK-NEXT: [[CMP_NOT:%.*]] = icmp eq i32 [[X]], 0
-; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP_NOT]], i32 123, i32 [[CT]]
-; CHECK-NEXT: [[RES:%.*]] = or i32 [[SEL]], [[CT]]
-; CHECK-NEXT: ret i32 [[RES]]
-;
- %m = mul i32 %x, 3
- %ct = tail call i32 @llvm.cttz.i32(i32 %m, i1 false)
- %cmp = icmp ne i32 %x, 0
- %sel = select i1 %cmp, i32 %ct, i32 123
- %res = or i32 %sel, %ct
- ret i32 %res
-}
-define <2 x i32> @test_cttz_not_bw_odd_mul_vec_nonsplat(<2 x i32> %x) {
-; CHECK-LABEL: @test_cttz_not_bw_odd_mul_vec_nonsplat(
-; CHECK-NEXT: [[CT:%.*]] = call range(i32 0, 33) <2 x i32> @llvm.cttz.v2i32(<2 x i32> [[X:%.*]], i1 true)
-; CHECK-NEXT: [[CMP_NOT:%.*]] = icmp eq <2 x i32> [[X]], zeroinitializer
-; CHECK-NEXT: [[RES:%.*]] = select <2 x i1> [[CMP_NOT]], <2 x i32> splat (i32 123), <2 x i32> [[CT]]
-; CHECK-NEXT: ret <2 x i32> [[RES]]
-;
- %m = mul <2 x i32> %x, <i32 3, i32 5>
- %ct = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %m, i1 false)
- %cmp = icmp ne <2 x i32> %x, zeroinitializer
- %res = select <2 x i1> %cmp, <2 x i32> %ct, <2 x i32> splat (i32 123)
- ret <2 x i32> %res
-}
-
declare i16 @llvm.ctlz.i16(i16, i1)
declare i32 @llvm.ctlz.i32(i32, i1)
declare i64 @llvm.ctlz.i64(i64, i1)
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/alias-mask.ll b/llvm/test/Transforms/LoopVectorize/AArch64/alias-mask.ll
index f50a146db1a69..6abc80385e9dd 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/alias-mask.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/alias-mask.ll
@@ -215,7 +215,7 @@ define i32 @partial_reduce(ptr %a, ptr %b, i64 %n) {
; CHECK-TF: [[VECTOR_BODY]]:
; CHECK-TF-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH1]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
; CHECK-TF-NEXT: [[ACTIVE_LANE_MASK1:%.*]] = phi <vscale x 16 x i1> [ [[ACTIVE_LANE_MASK_ENTRY]], %[[VECTOR_PH1]] ], [ [[ACTIVE_LANE_MASK_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-TF-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x i32> [ insertelement (<vscale x 4 x i32> zeroinitializer, i32 32, i64 0), %[[VECTOR_PH1]] ], [ [[PARTIAL_REDUCE:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-TF-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x i32> [ insertelement (<vscale x 4 x i32> zeroinitializer, i32 32, i32 0), %[[VECTOR_PH1]] ], [ [[PARTIAL_REDUCE:%.*]], %[[VECTOR_BODY]] ]
; CHECK-TF-NEXT: [[CLAMPED_HEADER_MASK:%.*]] = and <vscale x 16 x i1> [[ACTIVE_LANE_MASK1]], [[ALIAS_MASK]]
; CHECK-TF-NEXT: [[TMP2:%.*]] = getelementptr i8, ptr [[A]], i64 [[INDEX]]
; CHECK-TF-NEXT: [[WIDE_MASKED_LOAD:%.*]] = call <vscale x 16 x i8> @llvm.masked.load.nxv16i8.p0(ptr align 1 [[TMP2]], <vscale x 16 x i1> [[CLAMPED_HEADER_MASK]], <vscale x 16 x i8> poison)
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/bounded-load.ll b/llvm/test/Transforms/LoopVectorize/AArch64/bounded-load.ll
index 7fee6fd8fdda2..bc16875a3fe3a 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/bounded-load.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/bounded-load.ll
@@ -64,7 +64,7 @@ define i32 @bounded_load_reduction_bound2(ptr %A, i32 %N) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP15]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF13:%.*]] = and i32 [[N]], 3
; CHECK-NEXT: [[N_VEC14:%.*]] = sub i32 [[N]], [[N_MOD_VF13]]
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX15:%.*]] = phi i32 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT19:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
@@ -173,7 +173,7 @@ define i32 @bounded_load_reduction_bound4(ptr %A, i32 %N) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP12]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF10:%.*]] = and i32 [[N]], 3
; CHECK-NEXT: [[N_VEC11:%.*]] = sub i32 [[N]], [[N_MOD_VF10]]
-; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX12:%.*]] = phi i32 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT15:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
@@ -270,7 +270,7 @@ define i16 @bounded_load_reduction_bound4_i16(ptr %A, i32 %N) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i16 [ [[TMP8]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF4:%.*]] = and i32 [[N]], 3
; CHECK-NEXT: [[N_VEC5:%.*]] = sub i32 [[N]], [[N_MOD_VF4]]
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <4 x i16> zeroinitializer, i16 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <4 x i16> zeroinitializer, i16 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX6:%.*]] = phi i32 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT9:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
@@ -593,7 +593,7 @@ define i32 @reverse_load_with_bounded(ptr %A, ptr %B, i32 %N) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP24]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF18:%.*]] = and i32 [[N]], 3
; CHECK-NEXT: [[N_VEC19:%.*]] = sub i32 [[N]], [[N_MOD_VF18]]
-; CHECK-NEXT: [[TMP25:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP25:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX20:%.*]] = phi i32 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT25:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/epilog-vectorization-widen-inductions.ll b/llvm/test/Transforms/LoopVectorize/AArch64/epilog-vectorization-widen-inductions.ll
index b28e642155b64..9dcf89f4e3ac1 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/epilog-vectorization-widen-inductions.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/epilog-vectorization-widen-inductions.ll
@@ -519,7 +519,7 @@ define i32 @cse_multiple_ivs_with_scalar_resume(ptr %src, i64 %N) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP8]], [[VEC_EPILOG_ITER_CHECK]] ], [ 0, [[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF4:%.*]] = and i64 [[TMP0]], 1
; CHECK-NEXT: [[N_VEC5:%.*]] = sub i64 [[TMP0]], [[N_MOD_VF4]]
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label [[VEC_EPILOG_VECTOR_BODY:%.*]]
; CHECK: vec.epilog.vector.body:
; CHECK-NEXT: [[INDEX6:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], [[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT9:%.*]], [[VEC_EPILOG_VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/force-target-instruction-cost.ll b/llvm/test/Transforms/LoopVectorize/AArch64/force-target-instruction-cost.ll
index 4bc2adc5af8fc..60ab408442e83 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/force-target-instruction-cost.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/force-target-instruction-cost.ll
@@ -718,18 +718,18 @@ define void @force_branch_cost(ptr readonly %src, ptr %dst) {
; COST1-NEXT: [[TMP26:%.*]] = load i8, ptr [[TMP18]], align 1, !alias.scope [[META19]]
; COST1-NEXT: [[TMP27:%.*]] = load i8, ptr [[TMP19]], align 1, !alias.scope [[META19]]
; COST1-NEXT: [[TMP28:%.*]] = load i8, ptr [[TMP20]], align 1, !alias.scope [[META19]]
-; COST1-NEXT: [[TMP29:%.*]] = insertelement <4 x i8> poison, i8 [[TMP25]], i64 0
-; COST1-NEXT: [[TMP30:%.*]] = insertelement <4 x i8> [[TMP29]], i8 [[TMP26]], i64 1
-; COST1-NEXT: [[TMP31:%.*]] = insertelement <4 x i8> [[TMP30]], i8 [[TMP27]], i64 2
-; COST1-NEXT: [[TMP32:%.*]] = insertelement <4 x i8> [[TMP31]], i8 [[TMP28]], i64 3
+; COST1-NEXT: [[TMP29:%.*]] = insertelement <4 x i8> poison, i8 [[TMP25]], i32 0
+; COST1-NEXT: [[TMP30:%.*]] = insertelement <4 x i8> [[TMP29]], i8 [[TMP26]], i32 1
+; COST1-NEXT: [[TMP31:%.*]] = insertelement <4 x i8> [[TMP30]], i8 [[TMP27]], i32 2
+; COST1-NEXT: [[TMP32:%.*]] = insertelement <4 x i8> [[TMP31]], i8 [[TMP28]], i32 3
; COST1-NEXT: [[TMP33:%.*]] = load i8, ptr [[TMP21]], align 1, !alias.scope [[META19]]
; COST1-NEXT: [[TMP34:%.*]] = load i8, ptr [[TMP22]], align 1, !alias.scope [[META19]]
; COST1-NEXT: [[TMP35:%.*]] = load i8, ptr [[TMP23]], align 1, !alias.scope [[META19]]
; COST1-NEXT: [[TMP36:%.*]] = load i8, ptr [[TMP24]], align 1, !alias.scope [[META19]]
-; COST1-NEXT: [[TMP37:%.*]] = insertelement <4 x i8> poison, i8 [[TMP33]], i64 0
-; COST1-NEXT: [[TMP38:%.*]] = insertelement <4 x i8> [[TMP37]], i8 [[TMP34]], i64 1
-; COST1-NEXT: [[TMP39:%.*]] = insertelement <4 x i8> [[TMP38]], i8 [[TMP35]], i64 2
-; COST1-NEXT: [[TMP40:%.*]] = insertelement <4 x i8> [[TMP39]], i8 [[TMP36]], i64 3
+; COST1-NEXT: [[TMP37:%.*]] = insertelement <4 x i8> poison, i8 [[TMP33]], i32 0
+; COST1-NEXT: [[TMP38:%.*]] = insertelement <4 x i8> [[TMP37]], i8 [[TMP34]], i32 1
+; COST1-NEXT: [[TMP39:%.*]] = insertelement <4 x i8> [[TMP38]], i8 [[TMP35]], i32 2
+; COST1-NEXT: [[TMP40:%.*]] = insertelement <4 x i8> [[TMP39]], i8 [[TMP36]], i32 3
; COST1-NEXT: [[TMP41:%.*]] = zext <4 x i8> [[TMP32]] to <4 x i32>
; COST1-NEXT: [[TMP46:%.*]] = zext <4 x i8> [[TMP40]] to <4 x i32>
; COST1-NEXT: [[TMP44:%.*]] = extractelement <4 x i32> [[TMP41]], i64 0
@@ -838,10 +838,10 @@ define void @force_branch_cost(ptr readonly %src, ptr %dst) {
; COST10-NEXT: [[TMP14:%.*]] = load i8, ptr [[TMP10]], align 1, !alias.scope [[META19]]
; COST10-NEXT: [[TMP15:%.*]] = load i8, ptr [[TMP11]], align 1, !alias.scope [[META19]]
; COST10-NEXT: [[TMP16:%.*]] = load i8, ptr [[TMP12]], align 1, !alias.scope [[META19]]
-; COST10-NEXT: [[TMP17:%.*]] = insertelement <4 x i8> poison, i8 [[TMP13]], i64 0
-; COST10-NEXT: [[TMP18:%.*]] = insertelement <4 x i8> [[TMP17]], i8 [[TMP14]], i64 1
-; COST10-NEXT: [[TMP19:%.*]] = insertelement <4 x i8> [[TMP18]], i8 [[TMP15]], i64 2
-; COST10-NEXT: [[TMP20:%.*]] = insertelement <4 x i8> [[TMP19]], i8 [[TMP16]], i64 3
+; COST10-NEXT: [[TMP17:%.*]] = insertelement <4 x i8> poison, i8 [[TMP13]], i32 0
+; COST10-NEXT: [[TMP18:%.*]] = insertelement <4 x i8> [[TMP17]], i8 [[TMP14]], i32 1
+; COST10-NEXT: [[TMP19:%.*]] = insertelement <4 x i8> [[TMP18]], i8 [[TMP15]], i32 2
+; COST10-NEXT: [[TMP20:%.*]] = insertelement <4 x i8> [[TMP19]], i8 [[TMP16]], i32 3
; COST10-NEXT: [[TMP21:%.*]] = zext <4 x i8> [[TMP20]] to <4 x i32>
; COST10-NEXT: [[TMP24:%.*]] = extractelement <4 x i32> [[TMP21]], i64 0
; COST10-NEXT: store i32 [[TMP24]], ptr [[NEXT_GEP]], align 4, !alias.scope [[META22:![0-9]+]], !noalias [[META19]]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/gather-cost.ll b/llvm/test/Transforms/LoopVectorize/AArch64/gather-cost.ll
index 8d9fe041164a6..c5c6c8d23f27f 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/gather-cost.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/gather-cost.ll
@@ -104,34 +104,34 @@ define float @_Z4testmm(i64 %size, i64 %offset) {
; CHECK-NEXT: [[TMP33:%.*]] = load float, ptr [[TMP25]], align 4
; CHECK-NEXT: [[TMP34:%.*]] = load float, ptr [[TMP26]], align 4
; CHECK-NEXT: [[TMP35:%.*]] = load float, ptr [[TMP27]], align 4
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x float> poison, float [[TMP0]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x float> [[TMP36]], float [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x float> [[TMP37]], float [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x float> [[TMP38]], float [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x float> poison, float [[TMP0]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x float> [[TMP36]], float [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x float> [[TMP37]], float [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x float> [[TMP38]], float [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load float, ptr [[TMP28]], align 4
; CHECK-NEXT: [[TMP41:%.*]] = load float, ptr [[TMP29]], align 4
; CHECK-NEXT: [[TMP42:%.*]] = load float, ptr [[TMP30]], align 4
; CHECK-NEXT: [[TMP43:%.*]] = load float, ptr [[TMP31]], align 4
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x float> poison, float [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x float> [[TMP44]], float [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x float> [[TMP45]], float [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x float> [[TMP46]], float [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x float> poison, float [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x float> [[TMP44]], float [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x float> [[TMP45]], float [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x float> [[TMP46]], float [[TMP43]], i32 3
; CHECK-NEXT: [[TMP220:%.*]] = load float, ptr [[TMP208]], align 4
; CHECK-NEXT: [[TMP221:%.*]] = load float, ptr [[TMP211]], align 4
; CHECK-NEXT: [[TMP222:%.*]] = load float, ptr [[TMP212]], align 4
; CHECK-NEXT: [[TMP231:%.*]] = load float, ptr [[TMP215]], align 4
-; CHECK-NEXT: [[TMP232:%.*]] = insertelement <4 x float> poison, float [[TMP220]], i64 0
-; CHECK-NEXT: [[TMP233:%.*]] = insertelement <4 x float> [[TMP232]], float [[TMP221]], i64 1
-; CHECK-NEXT: [[TMP234:%.*]] = insertelement <4 x float> [[TMP233]], float [[TMP222]], i64 2
-; CHECK-NEXT: [[TMP235:%.*]] = insertelement <4 x float> [[TMP234]], float [[TMP231]], i64 3
+; CHECK-NEXT: [[TMP232:%.*]] = insertelement <4 x float> poison, float [[TMP220]], i32 0
+; CHECK-NEXT: [[TMP233:%.*]] = insertelement <4 x float> [[TMP232]], float [[TMP221]], i32 1
+; CHECK-NEXT: [[TMP234:%.*]] = insertelement <4 x float> [[TMP233]], float [[TMP222]], i32 2
+; CHECK-NEXT: [[TMP235:%.*]] = insertelement <4 x float> [[TMP234]], float [[TMP231]], i32 3
; CHECK-NEXT: [[TMP236:%.*]] = load float, ptr [[TMP216]], align 4
; CHECK-NEXT: [[TMP237:%.*]] = load float, ptr [[TMP217]], align 4
; CHECK-NEXT: [[TMP238:%.*]] = load float, ptr [[TMP218]], align 4
; CHECK-NEXT: [[TMP247:%.*]] = load float, ptr [[TMP219]], align 4
-; CHECK-NEXT: [[TMP248:%.*]] = insertelement <4 x float> poison, float [[TMP236]], i64 0
-; CHECK-NEXT: [[TMP249:%.*]] = insertelement <4 x float> [[TMP248]], float [[TMP237]], i64 1
-; CHECK-NEXT: [[TMP250:%.*]] = insertelement <4 x float> [[TMP249]], float [[TMP238]], i64 2
-; CHECK-NEXT: [[TMP251:%.*]] = insertelement <4 x float> [[TMP250]], float [[TMP247]], i64 3
+; CHECK-NEXT: [[TMP248:%.*]] = insertelement <4 x float> poison, float [[TMP236]], i32 0
+; CHECK-NEXT: [[TMP249:%.*]] = insertelement <4 x float> [[TMP248]], float [[TMP237]], i32 1
+; CHECK-NEXT: [[TMP250:%.*]] = insertelement <4 x float> [[TMP249]], float [[TMP238]], i32 2
+; CHECK-NEXT: [[TMP251:%.*]] = insertelement <4 x float> [[TMP250]], float [[TMP247]], i32 3
; CHECK-NEXT: [[GEP_KERNEL:%.*]] = getelementptr inbounds [512 x float], ptr @kernel, i64 0, i64 [[INDEX]]
; CHECK-NEXT: [[TMP49:%.*]] = getelementptr inbounds float, ptr [[GEP_KERNEL]], i64 4
; CHECK-NEXT: [[TMP252:%.*]] = getelementptr inbounds float, ptr [[GEP_KERNEL]], i64 8
@@ -220,34 +220,34 @@ define float @_Z4testmm(i64 %size, i64 %offset) {
; CHECK-NEXT: [[TMP83:%.*]] = load float, ptr [[TMP75]], align 4
; CHECK-NEXT: [[TMP84:%.*]] = load float, ptr [[TMP76]], align 4
; CHECK-NEXT: [[TMP85:%.*]] = load float, ptr [[TMP77]], align 4
-; CHECK-NEXT: [[TMP86:%.*]] = insertelement <4 x float> poison, float [[TMP82]], i64 0
-; CHECK-NEXT: [[TMP87:%.*]] = insertelement <4 x float> [[TMP86]], float [[TMP83]], i64 1
-; CHECK-NEXT: [[TMP88:%.*]] = insertelement <4 x float> [[TMP87]], float [[TMP84]], i64 2
-; CHECK-NEXT: [[TMP89:%.*]] = insertelement <4 x float> [[TMP88]], float [[TMP85]], i64 3
+; CHECK-NEXT: [[TMP86:%.*]] = insertelement <4 x float> poison, float [[TMP82]], i32 0
+; CHECK-NEXT: [[TMP87:%.*]] = insertelement <4 x float> [[TMP86]], float [[TMP83]], i32 1
+; CHECK-NEXT: [[TMP88:%.*]] = insertelement <4 x float> [[TMP87]], float [[TMP84]], i32 2
+; CHECK-NEXT: [[TMP89:%.*]] = insertelement <4 x float> [[TMP88]], float [[TMP85]], i32 3
; CHECK-NEXT: [[TMP90:%.*]] = load float, ptr [[TMP78]], align 4
; CHECK-NEXT: [[TMP91:%.*]] = load float, ptr [[TMP79]], align 4
; CHECK-NEXT: [[TMP92:%.*]] = load float, ptr [[TMP80]], align 4
; CHECK-NEXT: [[TMP93:%.*]] = load float, ptr [[TMP81]], align 4
-; CHECK-NEXT: [[TMP94:%.*]] = insertelement <4 x float> poison, float [[TMP90]], i64 0
-; CHECK-NEXT: [[TMP95:%.*]] = insertelement <4 x float> [[TMP94]], float [[TMP91]], i64 1
-; CHECK-NEXT: [[TMP96:%.*]] = insertelement <4 x float> [[TMP95]], float [[TMP92]], i64 2
-; CHECK-NEXT: [[TMP97:%.*]] = insertelement <4 x float> [[TMP96]], float [[TMP93]], i64 3
+; CHECK-NEXT: [[TMP94:%.*]] = insertelement <4 x float> poison, float [[TMP90]], i32 0
+; CHECK-NEXT: [[TMP95:%.*]] = insertelement <4 x float> [[TMP94]], float [[TMP91]], i32 1
+; CHECK-NEXT: [[TMP96:%.*]] = insertelement <4 x float> [[TMP95]], float [[TMP92]], i32 2
+; CHECK-NEXT: [[TMP97:%.*]] = insertelement <4 x float> [[TMP96]], float [[TMP93]], i32 3
; CHECK-NEXT: [[TMP179:%.*]] = load float, ptr [[TMP317]], align 4
; CHECK-NEXT: [[TMP180:%.*]] = load float, ptr [[TMP156]], align 4
; CHECK-NEXT: [[TMP181:%.*]] = load float, ptr [[TMP157]], align 4
; CHECK-NEXT: [[TMP182:%.*]] = load float, ptr [[TMP158]], align 4
-; CHECK-NEXT: [[TMP183:%.*]] = insertelement <4 x float> poison, float [[TMP179]], i64 0
-; CHECK-NEXT: [[TMP184:%.*]] = insertelement <4 x float> [[TMP183]], float [[TMP180]], i64 1
-; CHECK-NEXT: [[TMP185:%.*]] = insertelement <4 x float> [[TMP184]], float [[TMP181]], i64 2
-; CHECK-NEXT: [[TMP186:%.*]] = insertelement <4 x float> [[TMP185]], float [[TMP182]], i64 3
+; CHECK-NEXT: [[TMP183:%.*]] = insertelement <4 x float> poison, float [[TMP179]], i32 0
+; CHECK-NEXT: [[TMP184:%.*]] = insertelement <4 x float> [[TMP183]], float [[TMP180]], i32 1
+; CHECK-NEXT: [[TMP185:%.*]] = insertelement <4 x float> [[TMP184]], float [[TMP181]], i32 2
+; CHECK-NEXT: [[TMP186:%.*]] = insertelement <4 x float> [[TMP185]], float [[TMP182]], i32 3
; CHECK-NEXT: [[TMP187:%.*]] = load float, ptr [[TMP159]], align 4
; CHECK-NEXT: [[TMP188:%.*]] = load float, ptr [[TMP160]], align 4
; CHECK-NEXT: [[TMP189:%.*]] = load float, ptr [[TMP161]], align 4
; CHECK-NEXT: [[TMP190:%.*]] = load float, ptr [[TMP162]], align 4
-; CHECK-NEXT: [[TMP191:%.*]] = insertelement <4 x float> poison, float [[TMP187]], i64 0
-; CHECK-NEXT: [[TMP192:%.*]] = insertelement <4 x float> [[TMP191]], float [[TMP188]], i64 1
-; CHECK-NEXT: [[TMP193:%.*]] = insertelement <4 x float> [[TMP192]], float [[TMP189]], i64 2
-; CHECK-NEXT: [[TMP194:%.*]] = insertelement <4 x float> [[TMP193]], float [[TMP190]], i64 3
+; CHECK-NEXT: [[TMP191:%.*]] = insertelement <4 x float> poison, float [[TMP187]], i32 0
+; CHECK-NEXT: [[TMP192:%.*]] = insertelement <4 x float> [[TMP191]], float [[TMP188]], i32 1
+; CHECK-NEXT: [[TMP193:%.*]] = insertelement <4 x float> [[TMP192]], float [[TMP189]], i32 2
+; CHECK-NEXT: [[TMP194:%.*]] = insertelement <4 x float> [[TMP193]], float [[TMP190]], i32 3
; CHECK-NEXT: [[TMP98:%.*]] = fmul fast <4 x float> [[WIDE_LOAD]], [[TMP89]]
; CHECK-NEXT: [[TMP99:%.*]] = fmul fast <4 x float> [[WIDE_LOAD6]], [[TMP97]]
; CHECK-NEXT: [[TMP197:%.*]] = fmul fast <4 x float> [[WIDE_LOAD14]], [[TMP186]]
@@ -304,34 +304,34 @@ define float @_Z4testmm(i64 %size, i64 %offset) {
; CHECK-NEXT: [[TMP125:%.*]] = load float, ptr [[TMP117]], align 4
; CHECK-NEXT: [[TMP126:%.*]] = load float, ptr [[TMP118]], align 4
; CHECK-NEXT: [[TMP127:%.*]] = load float, ptr [[TMP119]], align 4
-; CHECK-NEXT: [[TMP128:%.*]] = insertelement <4 x float> poison, float [[TMP124]], i64 0
-; CHECK-NEXT: [[TMP129:%.*]] = insertelement <4 x float> [[TMP128]], float [[TMP125]], i64 1
-; CHECK-NEXT: [[TMP130:%.*]] = insertelement <4 x float> [[TMP129]], float [[TMP126]], i64 2
-; CHECK-NEXT: [[TMP131:%.*]] = insertelement <4 x float> [[TMP130]], float [[TMP127]], i64 3
+; CHECK-NEXT: [[TMP128:%.*]] = insertelement <4 x float> poison, float [[TMP124]], i32 0
+; CHECK-NEXT: [[TMP129:%.*]] = insertelement <4 x float> [[TMP128]], float [[TMP125]], i32 1
+; CHECK-NEXT: [[TMP130:%.*]] = insertelement <4 x float> [[TMP129]], float [[TMP126]], i32 2
+; CHECK-NEXT: [[TMP131:%.*]] = insertelement <4 x float> [[TMP130]], float [[TMP127]], i32 3
; CHECK-NEXT: [[TMP132:%.*]] = load float, ptr [[TMP120]], align 4
; CHECK-NEXT: [[TMP133:%.*]] = load float, ptr [[TMP121]], align 4
; CHECK-NEXT: [[TMP134:%.*]] = load float, ptr [[TMP122]], align 4
; CHECK-NEXT: [[TMP135:%.*]] = load float, ptr [[TMP123]], align 4
-; CHECK-NEXT: [[TMP136:%.*]] = insertelement <4 x float> poison, float [[TMP132]], i64 0
-; CHECK-NEXT: [[TMP137:%.*]] = insertelement <4 x float> [[TMP136]], float [[TMP133]], i64 1
-; CHECK-NEXT: [[TMP138:%.*]] = insertelement <4 x float> [[TMP137]], float [[TMP134]], i64 2
-; CHECK-NEXT: [[TMP139:%.*]] = insertelement <4 x float> [[TMP138]], float [[TMP135]], i64 3
+; CHECK-NEXT: [[TMP136:%.*]] = insertelement <4 x float> poison, float [[TMP132]], i32 0
+; CHECK-NEXT: [[TMP137:%.*]] = insertelement <4 x float> [[TMP136]], float [[TMP133]], i32 1
+; CHECK-NEXT: [[TMP138:%.*]] = insertelement <4 x float> [[TMP137]], float [[TMP134]], i32 2
+; CHECK-NEXT: [[TMP139:%.*]] = insertelement <4 x float> [[TMP138]], float [[TMP135]], i32 3
; CHECK-NEXT: [[TMP263:%.*]] = load float, ptr [[TMP239]], align 4
; CHECK-NEXT: [[TMP264:%.*]] = load float, ptr [[TMP240]], align 4
; CHECK-NEXT: [[TMP265:%.*]] = load float, ptr [[TMP241]], align 4
; CHECK-NEXT: [[TMP266:%.*]] = load float, ptr [[TMP242]], align 4
-; CHECK-NEXT: [[TMP267:%.*]] = insertelement <4 x float> poison, float [[TMP263]], i64 0
-; CHECK-NEXT: [[TMP268:%.*]] = insertelement <4 x float> [[TMP267]], float [[TMP264]], i64 1
-; CHECK-NEXT: [[TMP269:%.*]] = insertelement <4 x float> [[TMP268]], float [[TMP265]], i64 2
-; CHECK-NEXT: [[TMP270:%.*]] = insertelement <4 x float> [[TMP269]], float [[TMP266]], i64 3
+; CHECK-NEXT: [[TMP267:%.*]] = insertelement <4 x float> poison, float [[TMP263]], i32 0
+; CHECK-NEXT: [[TMP268:%.*]] = insertelement <4 x float> [[TMP267]], float [[TMP264]], i32 1
+; CHECK-NEXT: [[TMP269:%.*]] = insertelement <4 x float> [[TMP268]], float [[TMP265]], i32 2
+; CHECK-NEXT: [[TMP270:%.*]] = insertelement <4 x float> [[TMP269]], float [[TMP266]], i32 3
; CHECK-NEXT: [[TMP271:%.*]] = load float, ptr [[TMP243]], align 4
; CHECK-NEXT: [[TMP272:%.*]] = load float, ptr [[TMP244]], align 4
; CHECK-NEXT: [[TMP273:%.*]] = load float, ptr [[TMP245]], align 4
; CHECK-NEXT: [[TMP274:%.*]] = load float, ptr [[TMP246]], align 4
-; CHECK-NEXT: [[TMP275:%.*]] = insertelement <4 x float> poison, float [[TMP271]], i64 0
-; CHECK-NEXT: [[TMP276:%.*]] = insertelement <4 x float> [[TMP275]], float [[TMP272]], i64 1
-; CHECK-NEXT: [[TMP277:%.*]] = insertelement <4 x float> [[TMP276]], float [[TMP273]], i64 2
-; CHECK-NEXT: [[TMP278:%.*]] = insertelement <4 x float> [[TMP277]], float [[TMP274]], i64 3
+; CHECK-NEXT: [[TMP275:%.*]] = insertelement <4 x float> poison, float [[TMP271]], i32 0
+; CHECK-NEXT: [[TMP276:%.*]] = insertelement <4 x float> [[TMP275]], float [[TMP272]], i32 1
+; CHECK-NEXT: [[TMP277:%.*]] = insertelement <4 x float> [[TMP276]], float [[TMP273]], i32 2
+; CHECK-NEXT: [[TMP278:%.*]] = insertelement <4 x float> [[TMP277]], float [[TMP274]], i32 3
; CHECK-NEXT: [[TMP140:%.*]] = fmul fast <4 x float> [[WIDE_LOAD]], [[TMP131]]
; CHECK-NEXT: [[TMP141:%.*]] = fmul fast <4 x float> [[WIDE_LOAD6]], [[TMP139]]
; CHECK-NEXT: [[TMP281:%.*]] = fmul fast <4 x float> [[WIDE_LOAD14]], [[TMP270]]
@@ -380,9 +380,9 @@ define float @_Z4testmm(i64 %size, i64 %offset) {
; CHECK-NEXT: [[BC_MERGE_RDX37:%.*]] = phi float [ [[TMP302]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0.000000e+00, %[[VECTOR_PH]] ]
; CHECK-NEXT: [[N_MOD_VF38:%.*]] = and i64 [[SIZE]], 3
; CHECK-NEXT: [[N_VEC39:%.*]] = sub i64 [[SIZE]], [[N_MOD_VF38]]
-; CHECK-NEXT: [[TMP303:%.*]] = insertelement <4 x float> zeroinitializer, float [[BC_MERGE_RDX]], i64 0
-; CHECK-NEXT: [[TMP304:%.*]] = insertelement <4 x float> zeroinitializer, float [[BC_MERGE_RDX36]], i64 0
-; CHECK-NEXT: [[TMP305:%.*]] = insertelement <4 x float> zeroinitializer, float [[BC_MERGE_RDX37]], i64 0
+; CHECK-NEXT: [[TMP303:%.*]] = insertelement <4 x float> zeroinitializer, float [[BC_MERGE_RDX]], i32 0
+; CHECK-NEXT: [[TMP304:%.*]] = insertelement <4 x float> zeroinitializer, float [[BC_MERGE_RDX36]], i32 0
+; CHECK-NEXT: [[TMP305:%.*]] = insertelement <4 x float> zeroinitializer, float [[BC_MERGE_RDX37]], i32 0
; CHECK-NEXT: br label %[[LOOP:.*]]
; CHECK: [[LOOP]]:
; CHECK-NEXT: [[IV1:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT48:%.*]], %[[LOOP]] ]
@@ -408,10 +408,10 @@ define float @_Z4testmm(i64 %size, i64 %offset) {
; CHECK-NEXT: [[TMP322:%.*]] = load float, ptr [[TMP318]], align 4
; CHECK-NEXT: [[TMP323:%.*]] = load float, ptr [[TMP319]], align 4
; CHECK-NEXT: [[TMP324:%.*]] = load float, ptr [[TMP320]], align 4
-; CHECK-NEXT: [[TMP325:%.*]] = insertelement <4 x float> poison, float [[TMP321]], i64 0
-; CHECK-NEXT: [[TMP326:%.*]] = insertelement <4 x float> [[TMP325]], float [[TMP322]], i64 1
-; CHECK-NEXT: [[TMP327:%.*]] = insertelement <4 x float> [[TMP326]], float [[TMP323]], i64 2
-; CHECK-NEXT: [[TMP328:%.*]] = insertelement <4 x float> [[TMP327]], float [[TMP324]], i64 3
+; CHECK-NEXT: [[TMP325:%.*]] = insertelement <4 x float> poison, float [[TMP321]], i32 0
+; CHECK-NEXT: [[TMP326:%.*]] = insertelement <4 x float> [[TMP325]], float [[TMP322]], i32 1
+; CHECK-NEXT: [[TMP327:%.*]] = insertelement <4 x float> [[TMP326]], float [[TMP323]], i32 2
+; CHECK-NEXT: [[TMP328:%.*]] = insertelement <4 x float> [[TMP327]], float [[TMP324]], i32 3
; CHECK-NEXT: [[GEP_KERNEL1:%.*]] = getelementptr inbounds [512 x float], ptr @kernel, i64 0, i64 [[IV1]]
; CHECK-NEXT: [[WIDE_LOAD44:%.*]] = load <4 x float>, ptr [[GEP_KERNEL1]], align 4
; CHECK-NEXT: [[TMP330:%.*]] = fmul fast <4 x float> [[TMP328]], [[WIDE_LOAD44]]
@@ -437,10 +437,10 @@ define float @_Z4testmm(i64 %size, i64 %offset) {
; CHECK-NEXT: [[TMP347:%.*]] = load float, ptr [[TMP343]], align 4
; CHECK-NEXT: [[TMP348:%.*]] = load float, ptr [[TMP344]], align 4
; CHECK-NEXT: [[TMP349:%.*]] = load float, ptr [[TMP345]], align 4
-; CHECK-NEXT: [[TMP350:%.*]] = insertelement <4 x float> poison, float [[TMP346]], i64 0
-; CHECK-NEXT: [[TMP351:%.*]] = insertelement <4 x float> [[TMP350]], float [[TMP347]], i64 1
-; CHECK-NEXT: [[TMP352:%.*]] = insertelement <4 x float> [[TMP351]], float [[TMP348]], i64 2
-; CHECK-NEXT: [[TMP353:%.*]] = insertelement <4 x float> [[TMP352]], float [[TMP349]], i64 3
+; CHECK-NEXT: [[TMP350:%.*]] = insertelement <4 x float> poison, float [[TMP346]], i32 0
+; CHECK-NEXT: [[TMP351:%.*]] = insertelement <4 x float> [[TMP350]], float [[TMP347]], i32 1
+; CHECK-NEXT: [[TMP352:%.*]] = insertelement <4 x float> [[TMP351]], float [[TMP348]], i32 2
+; CHECK-NEXT: [[TMP353:%.*]] = insertelement <4 x float> [[TMP352]], float [[TMP349]], i32 3
; CHECK-NEXT: [[TMP354:%.*]] = fmul fast <4 x float> [[WIDE_LOAD44]], [[TMP353]]
; CHECK-NEXT: [[TMP355:%.*]] = fmul fast <4 x float> [[WIDE_LOAD45]], [[TMP354]]
; CHECK-NEXT: [[TMP356:%.*]] = fmul fast <4 x float> [[WIDE_LOAD46]], [[TMP355]]
@@ -458,10 +458,10 @@ define float @_Z4testmm(i64 %size, i64 %offset) {
; CHECK-NEXT: [[TMP368:%.*]] = load float, ptr [[TMP364]], align 4
; CHECK-NEXT: [[TMP369:%.*]] = load float, ptr [[TMP365]], align 4
; CHECK-NEXT: [[TMP370:%.*]] = load float, ptr [[TMP366]], align 4
-; CHECK-NEXT: [[TMP371:%.*]] = insertelement <4 x float> poison, float [[TMP367]], i64 0
-; CHECK-NEXT: [[TMP372:%.*]] = insertelement <4 x float> [[TMP371]], float [[TMP368]], i64 1
-; CHECK-NEXT: [[TMP373:%.*]] = insertelement <4 x float> [[TMP372]], float [[TMP369]], i64 2
-; CHECK-NEXT: [[TMP374:%.*]] = insertelement <4 x float> [[TMP373]], float [[TMP370]], i64 3
+; CHECK-NEXT: [[TMP371:%.*]] = insertelement <4 x float> poison, float [[TMP367]], i32 0
+; CHECK-NEXT: [[TMP372:%.*]] = insertelement <4 x float> [[TMP371]], float [[TMP368]], i32 1
+; CHECK-NEXT: [[TMP373:%.*]] = insertelement <4 x float> [[TMP372]], float [[TMP369]], i32 2
+; CHECK-NEXT: [[TMP374:%.*]] = insertelement <4 x float> [[TMP373]], float [[TMP370]], i32 3
; CHECK-NEXT: [[TMP375:%.*]] = fmul fast <4 x float> [[WIDE_LOAD44]], [[TMP374]]
; CHECK-NEXT: [[TMP376:%.*]] = fmul fast <4 x float> [[WIDE_LOAD45]], [[TMP375]]
; CHECK-NEXT: [[TMP377:%.*]] = fmul fast <4 x float> [[WIDE_LOAD46]], [[TMP376]]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/gather-do-not-vectorize-addressing.ll b/llvm/test/Transforms/LoopVectorize/AArch64/gather-do-not-vectorize-addressing.ll
index 40ef146e7ba98..0000d2e2f61b5 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/gather-do-not-vectorize-addressing.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/gather-do-not-vectorize-addressing.ll
@@ -31,8 +31,8 @@ define double @test(ptr nocapture noundef readonly %data, ptr nocapture noundef
; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds double, ptr [[DATA]], i64 [[TMP7]]
; CHECK-NEXT: [[TMP10:%.*]] = load double, ptr [[TMP8]], align 8
; CHECK-NEXT: [[TMP11:%.*]] = load double, ptr [[TMP9]], align 8
-; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x double> poison, double [[TMP10]], i64 0
-; CHECK-NEXT: [[TMP13:%.*]] = insertelement <2 x double> [[TMP12]], double [[TMP11]], i64 1
+; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x double> poison, double [[TMP10]], i32 0
+; CHECK-NEXT: [[TMP13:%.*]] = insertelement <2 x double> [[TMP12]], double [[TMP11]], i32 1
; CHECK-NEXT: [[TMP14]] = fadd <2 x double> [[VEC_PHI]], [[TMP13]]
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 2
; CHECK-NEXT: [[TMP15:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
@@ -81,7 +81,7 @@ define double @test(ptr nocapture noundef readonly %data, ptr nocapture noundef
; SVE-NEXT: br label [[VECTOR_BODY:%.*]]
; SVE: vector.body:
; SVE-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
-; SVE-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 2 x double> [ insertelement (<vscale x 2 x double> splat (double -0.000000e+00), double 0.000000e+00, i64 0), [[VECTOR_PH]] ], [ [[TMP9:%.*]], [[VECTOR_BODY]] ]
+; SVE-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 2 x double> [ insertelement (<vscale x 2 x double> splat (double -0.000000e+00), double 0.000000e+00, i32 0), [[VECTOR_PH]] ], [ [[TMP9:%.*]], [[VECTOR_BODY]] ]
; SVE-NEXT: [[TMP5:%.*]] = getelementptr inbounds i32, ptr [[OFFSET:%.*]], i64 [[INDEX]]
; SVE-NEXT: [[WIDE_LOAD:%.*]] = load <vscale x 2 x i32>, ptr [[TMP5]], align 4
; SVE-NEXT: [[TMP7:%.*]] = sext <vscale x 2 x i32> [[WIDE_LOAD]] to <vscale x 2 x i64>
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/induction-costs.ll b/llvm/test/Transforms/LoopVectorize/AArch64/induction-costs.ll
index cc4370f653274..ce4c6587ad099 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/induction-costs.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/induction-costs.ll
@@ -626,20 +626,20 @@ define void at sext_sub_nsw_for_address(ptr %base, i64 %n, ptr %src) #0 {
; CHECK-NEXT: [[TMP65:%.*]] = getelementptr double, ptr [[BASE]], i64 [[TMP57]]
; CHECK-NEXT: [[TMP66:%.*]] = load double, ptr [[TMP58]], align 8, !alias.scope [[META17:![0-9]+]]
; CHECK-NEXT: [[TMP67:%.*]] = load double, ptr [[TMP59]], align 8, !alias.scope [[META17]]
-; CHECK-NEXT: [[TMP68:%.*]] = insertelement <2 x double> poison, double [[TMP66]], i64 0
-; CHECK-NEXT: [[TMP69:%.*]] = insertelement <2 x double> [[TMP68]], double [[TMP67]], i64 1
+; CHECK-NEXT: [[TMP68:%.*]] = insertelement <2 x double> poison, double [[TMP66]], i32 0
+; CHECK-NEXT: [[TMP69:%.*]] = insertelement <2 x double> [[TMP68]], double [[TMP67]], i32 1
; CHECK-NEXT: [[TMP70:%.*]] = load double, ptr [[TMP60]], align 8, !alias.scope [[META17]]
; CHECK-NEXT: [[TMP71:%.*]] = load double, ptr [[TMP61]], align 8, !alias.scope [[META17]]
-; CHECK-NEXT: [[TMP72:%.*]] = insertelement <2 x double> poison, double [[TMP70]], i64 0
-; CHECK-NEXT: [[TMP73:%.*]] = insertelement <2 x double> [[TMP72]], double [[TMP71]], i64 1
+; CHECK-NEXT: [[TMP72:%.*]] = insertelement <2 x double> poison, double [[TMP70]], i32 0
+; CHECK-NEXT: [[TMP73:%.*]] = insertelement <2 x double> [[TMP72]], double [[TMP71]], i32 1
; CHECK-NEXT: [[TMP74:%.*]] = load double, ptr [[TMP62]], align 8, !alias.scope [[META17]]
; CHECK-NEXT: [[TMP75:%.*]] = load double, ptr [[TMP63]], align 8, !alias.scope [[META17]]
-; CHECK-NEXT: [[TMP76:%.*]] = insertelement <2 x double> poison, double [[TMP74]], i64 0
-; CHECK-NEXT: [[TMP77:%.*]] = insertelement <2 x double> [[TMP76]], double [[TMP75]], i64 1
+; CHECK-NEXT: [[TMP76:%.*]] = insertelement <2 x double> poison, double [[TMP74]], i32 0
+; CHECK-NEXT: [[TMP77:%.*]] = insertelement <2 x double> [[TMP76]], double [[TMP75]], i32 1
; CHECK-NEXT: [[TMP78:%.*]] = load double, ptr [[TMP64]], align 8, !alias.scope [[META17]]
; CHECK-NEXT: [[TMP79:%.*]] = load double, ptr [[TMP65]], align 8, !alias.scope [[META17]]
-; CHECK-NEXT: [[TMP80:%.*]] = insertelement <2 x double> poison, double [[TMP78]], i64 0
-; CHECK-NEXT: [[TMP81:%.*]] = insertelement <2 x double> [[TMP80]], double [[TMP79]], i64 1
+; CHECK-NEXT: [[TMP80:%.*]] = insertelement <2 x double> poison, double [[TMP78]], i32 0
+; CHECK-NEXT: [[TMP81:%.*]] = insertelement <2 x double> [[TMP80]], double [[TMP79]], i32 1
; CHECK-NEXT: [[TMP82:%.*]] = shufflevector <2 x double> zeroinitializer, <2 x double> [[TMP69]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
; CHECK-NEXT: [[INTERLEAVED_VEC:%.*]] = shufflevector <4 x double> [[TMP82]], <4 x double> poison, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
; CHECK-NEXT: store <4 x double> [[INTERLEAVED_VEC]], ptr [[TMP38]], align 8, !alias.scope [[META20:![0-9]+]], !noalias [[META17]]
@@ -689,8 +689,8 @@ define void at sext_sub_nsw_for_address(ptr %base, i64 %n, ptr %src) #0 {
; CHECK-NEXT: [[TMP99:%.*]] = getelementptr double, ptr [[BASE]], i64 [[TMP97]]
; CHECK-NEXT: [[TMP100:%.*]] = load double, ptr [[TMP98]], align 8, !alias.scope [[META17]]
; CHECK-NEXT: [[TMP101:%.*]] = load double, ptr [[TMP99]], align 8, !alias.scope [[META17]]
-; CHECK-NEXT: [[TMP102:%.*]] = insertelement <2 x double> poison, double [[TMP100]], i64 0
-; CHECK-NEXT: [[TMP103:%.*]] = insertelement <2 x double> [[TMP102]], double [[TMP101]], i64 1
+; CHECK-NEXT: [[TMP102:%.*]] = insertelement <2 x double> poison, double [[TMP100]], i32 0
+; CHECK-NEXT: [[TMP103:%.*]] = insertelement <2 x double> [[TMP102]], double [[TMP101]], i32 1
; CHECK-NEXT: [[TMP104:%.*]] = shufflevector <2 x double> zeroinitializer, <2 x double> [[TMP103]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
; CHECK-NEXT: [[INTERLEAVED_VEC26:%.*]] = shufflevector <4 x double> [[TMP104]], <4 x double> poison, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
; CHECK-NEXT: store <4 x double> [[INTERLEAVED_VEC26]], ptr [[TMP93]], align 8, !alias.scope [[META20]], !noalias [[META17]]
@@ -817,22 +817,22 @@ define i64 @live_out_extract_from_ptr_iv_increment(i64 %count, ptr %start, ptr n
; CHECK-NEXT: [[TMP32:%.*]] = load i8, ptr [[NEXT_GEP14]], align 1
; CHECK-NEXT: [[TMP33:%.*]] = load i8, ptr [[NEXT_GEP15]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i8, ptr [[NEXT_GEP16]], align 1
-; CHECK-NEXT: [[TMP35:%.*]] = insertelement <16 x i8> poison, i8 [[TMP19]], i64 0
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <16 x i8> [[TMP35]], i8 [[TMP20]], i64 1
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <16 x i8> [[TMP36]], i8 [[TMP21]], i64 2
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <16 x i8> [[TMP37]], i8 [[TMP22]], i64 3
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <16 x i8> [[TMP38]], i8 [[TMP23]], i64 4
-; CHECK-NEXT: [[TMP40:%.*]] = insertelement <16 x i8> [[TMP39]], i8 [[TMP24]], i64 5
-; CHECK-NEXT: [[TMP41:%.*]] = insertelement <16 x i8> [[TMP40]], i8 [[TMP25]], i64 6
-; CHECK-NEXT: [[TMP42:%.*]] = insertelement <16 x i8> [[TMP41]], i8 [[TMP26]], i64 7
-; CHECK-NEXT: [[TMP43:%.*]] = insertelement <16 x i8> [[TMP42]], i8 [[TMP27]], i64 8
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <16 x i8> [[TMP43]], i8 [[TMP28]], i64 9
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <16 x i8> [[TMP44]], i8 [[TMP29]], i64 10
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <16 x i8> [[TMP45]], i8 [[TMP30]], i64 11
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <16 x i8> [[TMP46]], i8 [[TMP31]], i64 12
-; CHECK-NEXT: [[TMP48:%.*]] = insertelement <16 x i8> [[TMP47]], i8 [[TMP32]], i64 13
-; CHECK-NEXT: [[TMP49:%.*]] = insertelement <16 x i8> [[TMP48]], i8 [[TMP33]], i64 14
-; CHECK-NEXT: [[TMP50:%.*]] = insertelement <16 x i8> [[TMP49]], i8 [[TMP34]], i64 15
+; CHECK-NEXT: [[TMP35:%.*]] = insertelement <16 x i8> poison, i8 [[TMP19]], i32 0
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <16 x i8> [[TMP35]], i8 [[TMP20]], i32 1
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <16 x i8> [[TMP36]], i8 [[TMP21]], i32 2
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <16 x i8> [[TMP37]], i8 [[TMP22]], i32 3
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <16 x i8> [[TMP38]], i8 [[TMP23]], i32 4
+; CHECK-NEXT: [[TMP40:%.*]] = insertelement <16 x i8> [[TMP39]], i8 [[TMP24]], i32 5
+; CHECK-NEXT: [[TMP41:%.*]] = insertelement <16 x i8> [[TMP40]], i8 [[TMP25]], i32 6
+; CHECK-NEXT: [[TMP42:%.*]] = insertelement <16 x i8> [[TMP41]], i8 [[TMP26]], i32 7
+; CHECK-NEXT: [[TMP43:%.*]] = insertelement <16 x i8> [[TMP42]], i8 [[TMP27]], i32 8
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <16 x i8> [[TMP43]], i8 [[TMP28]], i32 9
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <16 x i8> [[TMP44]], i8 [[TMP29]], i32 10
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <16 x i8> [[TMP45]], i8 [[TMP30]], i32 11
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <16 x i8> [[TMP46]], i8 [[TMP31]], i32 12
+; CHECK-NEXT: [[TMP48:%.*]] = insertelement <16 x i8> [[TMP47]], i8 [[TMP32]], i32 13
+; CHECK-NEXT: [[TMP49:%.*]] = insertelement <16 x i8> [[TMP48]], i8 [[TMP33]], i32 14
+; CHECK-NEXT: [[TMP50:%.*]] = insertelement <16 x i8> [[TMP49]], i8 [[TMP34]], i32 15
; CHECK-NEXT: [[TMP51:%.*]] = zext <16 x i8> [[TMP50]] to <16 x i32>
; CHECK-NEXT: [[TMP52:%.*]] = extractelement <16 x i32> [[TMP51]], i64 15
; CHECK-NEXT: store i32 [[TMP52]], ptr [[DST]], align 4
@@ -852,22 +852,22 @@ define i64 @live_out_extract_from_ptr_iv_increment(i64 %count, ptr %start, ptr n
; CHECK-NEXT: [[TMP66:%.*]] = getelementptr i8, ptr [[NEXT_GEP14]], i64 3
; CHECK-NEXT: [[TMP67:%.*]] = getelementptr i8, ptr [[NEXT_GEP15]], i64 3
; CHECK-NEXT: [[TMP68:%.*]] = getelementptr i8, ptr [[NEXT_GEP16]], i64 3
-; CHECK-NEXT: [[TMP69:%.*]] = insertelement <16 x ptr> poison, ptr [[TMP53]], i64 0
-; CHECK-NEXT: [[TMP70:%.*]] = insertelement <16 x ptr> [[TMP69]], ptr [[TMP54]], i64 1
-; CHECK-NEXT: [[TMP71:%.*]] = insertelement <16 x ptr> [[TMP70]], ptr [[TMP55]], i64 2
-; CHECK-NEXT: [[TMP72:%.*]] = insertelement <16 x ptr> [[TMP71]], ptr [[TMP56]], i64 3
-; CHECK-NEXT: [[TMP73:%.*]] = insertelement <16 x ptr> [[TMP72]], ptr [[TMP57]], i64 4
-; CHECK-NEXT: [[TMP74:%.*]] = insertelement <16 x ptr> [[TMP73]], ptr [[TMP58]], i64 5
-; CHECK-NEXT: [[TMP75:%.*]] = insertelement <16 x ptr> [[TMP74]], ptr [[TMP59]], i64 6
-; CHECK-NEXT: [[TMP76:%.*]] = insertelement <16 x ptr> [[TMP75]], ptr [[TMP60]], i64 7
-; CHECK-NEXT: [[TMP77:%.*]] = insertelement <16 x ptr> [[TMP76]], ptr [[TMP61]], i64 8
-; CHECK-NEXT: [[TMP78:%.*]] = insertelement <16 x ptr> [[TMP77]], ptr [[TMP62]], i64 9
-; CHECK-NEXT: [[TMP79:%.*]] = insertelement <16 x ptr> [[TMP78]], ptr [[TMP63]], i64 10
-; CHECK-NEXT: [[TMP80:%.*]] = insertelement <16 x ptr> [[TMP79]], ptr [[TMP64]], i64 11
-; CHECK-NEXT: [[TMP81:%.*]] = insertelement <16 x ptr> [[TMP80]], ptr [[TMP65]], i64 12
-; CHECK-NEXT: [[TMP82:%.*]] = insertelement <16 x ptr> [[TMP81]], ptr [[TMP66]], i64 13
-; CHECK-NEXT: [[TMP83:%.*]] = insertelement <16 x ptr> [[TMP82]], ptr [[TMP67]], i64 14
-; CHECK-NEXT: [[TMP84:%.*]] = insertelement <16 x ptr> [[TMP83]], ptr [[TMP68]], i64 15
+; CHECK-NEXT: [[TMP69:%.*]] = insertelement <16 x ptr> poison, ptr [[TMP53]], i32 0
+; CHECK-NEXT: [[TMP70:%.*]] = insertelement <16 x ptr> [[TMP69]], ptr [[TMP54]], i32 1
+; CHECK-NEXT: [[TMP71:%.*]] = insertelement <16 x ptr> [[TMP70]], ptr [[TMP55]], i32 2
+; CHECK-NEXT: [[TMP72:%.*]] = insertelement <16 x ptr> [[TMP71]], ptr [[TMP56]], i32 3
+; CHECK-NEXT: [[TMP73:%.*]] = insertelement <16 x ptr> [[TMP72]], ptr [[TMP57]], i32 4
+; CHECK-NEXT: [[TMP74:%.*]] = insertelement <16 x ptr> [[TMP73]], ptr [[TMP58]], i32 5
+; CHECK-NEXT: [[TMP75:%.*]] = insertelement <16 x ptr> [[TMP74]], ptr [[TMP59]], i32 6
+; CHECK-NEXT: [[TMP76:%.*]] = insertelement <16 x ptr> [[TMP75]], ptr [[TMP60]], i32 7
+; CHECK-NEXT: [[TMP77:%.*]] = insertelement <16 x ptr> [[TMP76]], ptr [[TMP61]], i32 8
+; CHECK-NEXT: [[TMP78:%.*]] = insertelement <16 x ptr> [[TMP77]], ptr [[TMP62]], i32 9
+; CHECK-NEXT: [[TMP79:%.*]] = insertelement <16 x ptr> [[TMP78]], ptr [[TMP63]], i32 10
+; CHECK-NEXT: [[TMP80:%.*]] = insertelement <16 x ptr> [[TMP79]], ptr [[TMP64]], i32 11
+; CHECK-NEXT: [[TMP81:%.*]] = insertelement <16 x ptr> [[TMP80]], ptr [[TMP65]], i32 12
+; CHECK-NEXT: [[TMP82:%.*]] = insertelement <16 x ptr> [[TMP81]], ptr [[TMP66]], i32 13
+; CHECK-NEXT: [[TMP83:%.*]] = insertelement <16 x ptr> [[TMP82]], ptr [[TMP67]], i32 14
+; CHECK-NEXT: [[TMP84:%.*]] = insertelement <16 x ptr> [[TMP83]], ptr [[TMP68]], i32 15
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 16
; CHECK-NEXT: [[TMP85:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
; CHECK-NEXT: br i1 [[TMP85]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP26:![0-9]+]]
@@ -912,14 +912,14 @@ define i64 @live_out_extract_from_ptr_iv_increment(i64 %count, ptr %start, ptr n
; CHECK-NEXT: [[TMP103:%.*]] = load i8, ptr [[NEXT_GEP25]], align 1
; CHECK-NEXT: [[TMP104:%.*]] = load i8, ptr [[NEXT_GEP26]], align 1
; CHECK-NEXT: [[TMP105:%.*]] = load i8, ptr [[NEXT_GEP27]], align 1
-; CHECK-NEXT: [[TMP106:%.*]] = insertelement <8 x i8> poison, i8 [[TMP98]], i64 0
-; CHECK-NEXT: [[TMP107:%.*]] = insertelement <8 x i8> [[TMP106]], i8 [[TMP99]], i64 1
-; CHECK-NEXT: [[TMP108:%.*]] = insertelement <8 x i8> [[TMP107]], i8 [[TMP100]], i64 2
-; CHECK-NEXT: [[TMP109:%.*]] = insertelement <8 x i8> [[TMP108]], i8 [[TMP101]], i64 3
-; CHECK-NEXT: [[TMP110:%.*]] = insertelement <8 x i8> [[TMP109]], i8 [[TMP102]], i64 4
-; CHECK-NEXT: [[TMP111:%.*]] = insertelement <8 x i8> [[TMP110]], i8 [[TMP103]], i64 5
-; CHECK-NEXT: [[TMP112:%.*]] = insertelement <8 x i8> [[TMP111]], i8 [[TMP104]], i64 6
-; CHECK-NEXT: [[TMP113:%.*]] = insertelement <8 x i8> [[TMP112]], i8 [[TMP105]], i64 7
+; CHECK-NEXT: [[TMP106:%.*]] = insertelement <8 x i8> poison, i8 [[TMP98]], i32 0
+; CHECK-NEXT: [[TMP107:%.*]] = insertelement <8 x i8> [[TMP106]], i8 [[TMP99]], i32 1
+; CHECK-NEXT: [[TMP108:%.*]] = insertelement <8 x i8> [[TMP107]], i8 [[TMP100]], i32 2
+; CHECK-NEXT: [[TMP109:%.*]] = insertelement <8 x i8> [[TMP108]], i8 [[TMP101]], i32 3
+; CHECK-NEXT: [[TMP110:%.*]] = insertelement <8 x i8> [[TMP109]], i8 [[TMP102]], i32 4
+; CHECK-NEXT: [[TMP111:%.*]] = insertelement <8 x i8> [[TMP110]], i8 [[TMP103]], i32 5
+; CHECK-NEXT: [[TMP112:%.*]] = insertelement <8 x i8> [[TMP111]], i8 [[TMP104]], i32 6
+; CHECK-NEXT: [[TMP113:%.*]] = insertelement <8 x i8> [[TMP112]], i8 [[TMP105]], i32 7
; CHECK-NEXT: [[TMP114:%.*]] = zext <8 x i8> [[TMP113]] to <8 x i32>
; CHECK-NEXT: [[TMP115:%.*]] = extractelement <8 x i32> [[TMP114]], i64 7
; CHECK-NEXT: store i32 [[TMP115]], ptr [[DST]], align 4
@@ -931,14 +931,14 @@ define i64 @live_out_extract_from_ptr_iv_increment(i64 %count, ptr %start, ptr n
; CHECK-NEXT: [[TMP121:%.*]] = getelementptr i8, ptr [[NEXT_GEP25]], i64 3
; CHECK-NEXT: [[TMP122:%.*]] = getelementptr i8, ptr [[NEXT_GEP26]], i64 3
; CHECK-NEXT: [[TMP123:%.*]] = getelementptr i8, ptr [[NEXT_GEP27]], i64 3
-; CHECK-NEXT: [[TMP124:%.*]] = insertelement <8 x ptr> poison, ptr [[TMP116]], i64 0
-; CHECK-NEXT: [[TMP125:%.*]] = insertelement <8 x ptr> [[TMP124]], ptr [[TMP117]], i64 1
-; CHECK-NEXT: [[TMP126:%.*]] = insertelement <8 x ptr> [[TMP125]], ptr [[TMP118]], i64 2
-; CHECK-NEXT: [[TMP127:%.*]] = insertelement <8 x ptr> [[TMP126]], ptr [[TMP119]], i64 3
-; CHECK-NEXT: [[TMP128:%.*]] = insertelement <8 x ptr> [[TMP127]], ptr [[TMP120]], i64 4
-; CHECK-NEXT: [[TMP129:%.*]] = insertelement <8 x ptr> [[TMP128]], ptr [[TMP121]], i64 5
-; CHECK-NEXT: [[TMP130:%.*]] = insertelement <8 x ptr> [[TMP129]], ptr [[TMP122]], i64 6
-; CHECK-NEXT: [[TMP131:%.*]] = insertelement <8 x ptr> [[TMP130]], ptr [[TMP123]], i64 7
+; CHECK-NEXT: [[TMP124:%.*]] = insertelement <8 x ptr> poison, ptr [[TMP116]], i32 0
+; CHECK-NEXT: [[TMP125:%.*]] = insertelement <8 x ptr> [[TMP124]], ptr [[TMP117]], i32 1
+; CHECK-NEXT: [[TMP126:%.*]] = insertelement <8 x ptr> [[TMP125]], ptr [[TMP118]], i32 2
+; CHECK-NEXT: [[TMP127:%.*]] = insertelement <8 x ptr> [[TMP126]], ptr [[TMP119]], i32 3
+; CHECK-NEXT: [[TMP128:%.*]] = insertelement <8 x ptr> [[TMP127]], ptr [[TMP120]], i32 4
+; CHECK-NEXT: [[TMP129:%.*]] = insertelement <8 x ptr> [[TMP128]], ptr [[TMP121]], i32 5
+; CHECK-NEXT: [[TMP130:%.*]] = insertelement <8 x ptr> [[TMP129]], ptr [[TMP122]], i32 6
+; CHECK-NEXT: [[TMP131:%.*]] = insertelement <8 x ptr> [[TMP130]], ptr [[TMP123]], i32 7
; CHECK-NEXT: [[INDEX_NEXT28]] = add nuw i64 [[INDEX19]], 8
; CHECK-NEXT: [[TMP132:%.*]] = icmp eq i64 [[INDEX_NEXT28]], [[N_VEC18]]
; CHECK-NEXT: br i1 [[TMP132]], label %[[VEC_EPILOG_MIDDLE_BLOCK:.*]], label %[[VEC_EPILOG_VECTOR_BODY]], !llvm.loop [[LOOP27:![0-9]+]]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/interleave-allocsize-not-equal-typesize.ll b/llvm/test/Transforms/LoopVectorize/AArch64/interleave-allocsize-not-equal-typesize.ll
index f1b732f9d67cd..1a87fadbb783b 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/interleave-allocsize-not-equal-typesize.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/interleave-allocsize-not-equal-typesize.ll
@@ -38,10 +38,10 @@ define void @pr58722_load_interleave_group(ptr %src, ptr %dst) {
; CHECK-NEXT: [[TMP14:%.*]] = load i24, ptr [[TMP10]], align 4, !alias.scope [[META0]]
; CHECK-NEXT: [[TMP15:%.*]] = load i24, ptr [[TMP11]], align 4, !alias.scope [[META0]]
; CHECK-NEXT: [[TMP16:%.*]] = load i24, ptr [[TMP12]], align 4, !alias.scope [[META0]]
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i24> poison, i24 [[TMP13]], i64 0
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i24> [[TMP17]], i24 [[TMP14]], i64 1
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i24> [[TMP18]], i24 [[TMP15]], i64 2
-; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x i24> [[TMP19]], i24 [[TMP16]], i64 3
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i24> poison, i24 [[TMP13]], i32 0
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i24> [[TMP17]], i24 [[TMP14]], i32 1
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i24> [[TMP18]], i24 [[TMP15]], i32 2
+; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x i24> [[TMP19]], i24 [[TMP16]], i32 3
; CHECK-NEXT: [[TMP21:%.*]] = zext <4 x i24> [[TMP20]] to <4 x i32>
; CHECK-NEXT: [[TMP22:%.*]] = add <4 x i32> [[STRIDED_VEC]], [[TMP21]]
; CHECK-NEXT: [[TMP23:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 [[INDEX]]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/interleave-with-gaps.ll b/llvm/test/Transforms/LoopVectorize/AArch64/interleave-with-gaps.ll
index 2733930833e7e..1b3b0ec7eb710 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/interleave-with-gaps.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/interleave-with-gaps.ll
@@ -456,7 +456,7 @@ define i32 @load_factor_4_with_gap(i64 %n, ptr noalias %a) {
; CHECK-NOTF-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP44]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NOTF-NEXT: [[N_MOD_VF13:%.*]] = and i64 [[N]], 3
; CHECK-NOTF-NEXT: [[N_VEC14:%.*]] = sub i64 [[N]], [[N_MOD_VF13]]
-; CHECK-NOTF-NEXT: [[TMP45:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NOTF-NEXT: [[TMP45:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NOTF-NEXT: br label %[[LOOP:.*]]
; CHECK-NOTF: [[LOOP]]:
; CHECK-NOTF-NEXT: [[IV:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[INDEX_NEXT21:%.*]], %[[LOOP]] ]
@@ -768,7 +768,7 @@ define i32 @load_factor_4_with_tail_gap(i64 %n, ptr noalias %a) {
; CHECK-NOTF-NEXT: [[TMP47:%.*]] = icmp eq i64 [[N_MOD_VF13]], 0
; CHECK-NOTF-NEXT: [[TMP48:%.*]] = select i1 [[TMP47]], i64 4, i64 [[N_MOD_VF13]]
; CHECK-NOTF-NEXT: [[N_VEC14:%.*]] = sub i64 [[N]], [[TMP48]]
-; CHECK-NOTF-NEXT: [[TMP49:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NOTF-NEXT: [[TMP49:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NOTF-NEXT: br label %[[LOOP:.*]]
; CHECK-NOTF: [[LOOP]]:
; CHECK-NOTF-NEXT: [[IV:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[INDEX_NEXT21:%.*]], %[[LOOP]] ]
@@ -1088,7 +1088,7 @@ define i32 @load_factor_4_with_gap_reverse(i64 %n, ptr noalias %a) {
; CHECK-NOTF-NEXT: [[N_MOD_VF24:%.*]] = urem i64 [[TMP0]], [[TMP50]]
; CHECK-NOTF-NEXT: [[N_VEC25:%.*]] = sub i64 [[TMP0]], [[N_MOD_VF24]]
; CHECK-NOTF-NEXT: [[TMP46:%.*]] = sub i64 [[N]], [[N_VEC25]]
-; CHECK-NOTF-NEXT: [[TMP52:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NOTF-NEXT: [[TMP52:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NOTF-NEXT: br label %[[LOOP:.*]]
; CHECK-NOTF: [[LOOP]]:
; CHECK-NOTF-NEXT: [[INDEX26:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[INDEX_NEXT35:%.*]], %[[LOOP]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/interleaved-vs-scalar.ll b/llvm/test/Transforms/LoopVectorize/AArch64/interleaved-vs-scalar.ll
index b2523ae568e85..5ae0a536a228b 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/interleaved-vs-scalar.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/interleaved-vs-scalar.ll
@@ -13,8 +13,8 @@ target triple = "aarch64--linux-gnu"
; CHECK-LABEL: vector.body:
; CHECK: [[LOAD1:%.*]] = load i8
; CHECK: [[LOAD2:%.*]] = load i8
-; CHECK: [[INSERT:%.*]] = insertelement <2 x i8> poison, i8 [[LOAD1]], i64 0
-; CHECK: insertelement <2 x i8> [[INSERT]], i8 [[LOAD2]], i64 1
+; CHECK: [[INSERT:%.*]] = insertelement <2 x i8> poison, i8 [[LOAD1]], i32 0
+; CHECK: insertelement <2 x i8> [[INSERT]], i8 [[LOAD2]], i32 1
; CHECK: br i1 {{.*}}, label %middle.block, label %vector.body
define void @test(ptr %p, ptr %q, i64 %n) {
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/interleaving-reduction.ll b/llvm/test/Transforms/LoopVectorize/AArch64/interleaving-reduction.ll
index 454b776595a6f..8639fa11d9f48 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/interleaving-reduction.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/interleaving-reduction.ll
@@ -58,7 +58,7 @@ define i32 @interleave_integer_reduction(ptr %src, i64 %N) {
; INTERLEAVE-4-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP9]], [[VEC_EPILOG_ITER_CHECK]] ], [ 0, [[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; INTERLEAVE-4-NEXT: [[N_MOD_VF10:%.*]] = and i64 [[N]], 3
; INTERLEAVE-4-NEXT: [[N_VEC11:%.*]] = sub i64 [[N]], [[N_MOD_VF10]]
-; INTERLEAVE-4-NEXT: [[TMP10:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; INTERLEAVE-4-NEXT: [[TMP10:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; INTERLEAVE-4-NEXT: br label [[VEC_EPILOG_VECTOR_BODY:%.*]]
; INTERLEAVE-4: vec.epilog.vector.body:
; INTERLEAVE-4-NEXT: [[INDEX12:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], [[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT15:%.*]], [[VEC_EPILOG_VECTOR_BODY]] ]
@@ -137,7 +137,7 @@ define i32 @interleave_integer_reduction(ptr %src, i64 %N) {
; INTERLEAVE-2-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP9]], [[VEC_EPILOG_ITER_CHECK]] ], [ 0, [[VECTOR_PH]] ]
; INTERLEAVE-2-NEXT: [[N_MOD_VF10:%.*]] = and i64 [[N]], 3
; INTERLEAVE-2-NEXT: [[N_VEC11:%.*]] = sub i64 [[N]], [[N_MOD_VF10]]
-; INTERLEAVE-2-NEXT: [[TMP10:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; INTERLEAVE-2-NEXT: [[TMP10:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; INTERLEAVE-2-NEXT: br label [[LOOP:%.*]]
; INTERLEAVE-2: vec.epilog.vector.body:
; INTERLEAVE-2-NEXT: [[INDEX12:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], [[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT15:%.*]], [[LOOP]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/load-cast-context.ll b/llvm/test/Transforms/LoopVectorize/AArch64/load-cast-context.ll
index 8626177fa57de..467da4e637aa4 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/load-cast-context.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/load-cast-context.ll
@@ -120,7 +120,7 @@ define i32 @sext_of_non_memory_op(ptr %src, i32 %offset, i64 %n) #0 {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP31]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF10:%.*]] = and i64 [[TMP0]], 15
; CHECK-NEXT: [[N_VEC11:%.*]] = sub i64 [[TMP0]], [[N_MOD_VF10]]
-; CHECK-NEXT: [[TMP32:%.*]] = insertelement <16 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP32:%.*]] = insertelement <16 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX12:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT15:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product-epilogue.ll b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product-epilogue.ll
index c240ee6155e20..de788c938e61d 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product-epilogue.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product-epilogue.ll
@@ -100,7 +100,7 @@ define void @dotp_small_epilogue_vf(i64 %idx.neg, i8 %a) #1 {
; CHECK-NEXT: [[BROADCAST_SPLATINSERT6:%.*]] = insertelement <2 x i8> poison, i8 [[A]], i64 0
; CHECK-NEXT: [[BROADCAST_SPLAT7:%.*]] = shufflevector <2 x i8> [[BROADCAST_SPLATINSERT6]], <2 x i8> poison, <2 x i32> zeroinitializer
; CHECK-NEXT: [[IND_END:%.*]] = add i64 [[IDX_NEG]], [[N_VEC5]]
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: [[TMP10:%.*]] = sext <2 x i8> [[BROADCAST_SPLAT7]] to <2 x i32>
; CHECK-NEXT: [[TMP11:%.*]] = load i8, ptr null, align 1
; CHECK-NEXT: [[BROADCAST_SPLATINSERT8:%.*]] = insertelement <2 x i8> poison, i8 [[TMP11]], i64 0
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product-neon.ll b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product-neon.ll
index 2c86fc16fb3a7..833723b602369 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product-neon.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product-neon.ll
@@ -177,22 +177,22 @@ define i32 @not_dotp_different_types(ptr %a, ptr %b) {
; CHECK-INTERLEAVE1-NEXT: [[TMP48:%.*]] = load i16, ptr [[TMP32]], align 2
; CHECK-INTERLEAVE1-NEXT: [[TMP49:%.*]] = load i16, ptr [[TMP33]], align 2
; CHECK-INTERLEAVE1-NEXT: [[TMP50:%.*]] = load i16, ptr [[TMP34]], align 2
-; CHECK-INTERLEAVE1-NEXT: [[TMP51:%.*]] = insertelement <16 x i16> poison, i16 [[TMP35]], i64 0
-; CHECK-INTERLEAVE1-NEXT: [[TMP52:%.*]] = insertelement <16 x i16> [[TMP51]], i16 [[TMP36]], i64 1
-; CHECK-INTERLEAVE1-NEXT: [[TMP53:%.*]] = insertelement <16 x i16> [[TMP52]], i16 [[TMP37]], i64 2
-; CHECK-INTERLEAVE1-NEXT: [[TMP54:%.*]] = insertelement <16 x i16> [[TMP53]], i16 [[TMP38]], i64 3
-; CHECK-INTERLEAVE1-NEXT: [[TMP55:%.*]] = insertelement <16 x i16> [[TMP54]], i16 [[TMP39]], i64 4
-; CHECK-INTERLEAVE1-NEXT: [[TMP56:%.*]] = insertelement <16 x i16> [[TMP55]], i16 [[TMP40]], i64 5
-; CHECK-INTERLEAVE1-NEXT: [[TMP57:%.*]] = insertelement <16 x i16> [[TMP56]], i16 [[TMP41]], i64 6
-; CHECK-INTERLEAVE1-NEXT: [[TMP58:%.*]] = insertelement <16 x i16> [[TMP57]], i16 [[TMP42]], i64 7
-; CHECK-INTERLEAVE1-NEXT: [[TMP59:%.*]] = insertelement <16 x i16> [[TMP58]], i16 [[TMP43]], i64 8
-; CHECK-INTERLEAVE1-NEXT: [[TMP60:%.*]] = insertelement <16 x i16> [[TMP59]], i16 [[TMP44]], i64 9
-; CHECK-INTERLEAVE1-NEXT: [[TMP61:%.*]] = insertelement <16 x i16> [[TMP60]], i16 [[TMP45]], i64 10
-; CHECK-INTERLEAVE1-NEXT: [[TMP62:%.*]] = insertelement <16 x i16> [[TMP61]], i16 [[TMP46]], i64 11
-; CHECK-INTERLEAVE1-NEXT: [[TMP63:%.*]] = insertelement <16 x i16> [[TMP62]], i16 [[TMP47]], i64 12
-; CHECK-INTERLEAVE1-NEXT: [[TMP64:%.*]] = insertelement <16 x i16> [[TMP63]], i16 [[TMP48]], i64 13
-; CHECK-INTERLEAVE1-NEXT: [[TMP65:%.*]] = insertelement <16 x i16> [[TMP64]], i16 [[TMP49]], i64 14
-; CHECK-INTERLEAVE1-NEXT: [[TMP66:%.*]] = insertelement <16 x i16> [[TMP65]], i16 [[TMP50]], i64 15
+; CHECK-INTERLEAVE1-NEXT: [[TMP51:%.*]] = insertelement <16 x i16> poison, i16 [[TMP35]], i32 0
+; CHECK-INTERLEAVE1-NEXT: [[TMP52:%.*]] = insertelement <16 x i16> [[TMP51]], i16 [[TMP36]], i32 1
+; CHECK-INTERLEAVE1-NEXT: [[TMP53:%.*]] = insertelement <16 x i16> [[TMP52]], i16 [[TMP37]], i32 2
+; CHECK-INTERLEAVE1-NEXT: [[TMP54:%.*]] = insertelement <16 x i16> [[TMP53]], i16 [[TMP38]], i32 3
+; CHECK-INTERLEAVE1-NEXT: [[TMP55:%.*]] = insertelement <16 x i16> [[TMP54]], i16 [[TMP39]], i32 4
+; CHECK-INTERLEAVE1-NEXT: [[TMP56:%.*]] = insertelement <16 x i16> [[TMP55]], i16 [[TMP40]], i32 5
+; CHECK-INTERLEAVE1-NEXT: [[TMP57:%.*]] = insertelement <16 x i16> [[TMP56]], i16 [[TMP41]], i32 6
+; CHECK-INTERLEAVE1-NEXT: [[TMP58:%.*]] = insertelement <16 x i16> [[TMP57]], i16 [[TMP42]], i32 7
+; CHECK-INTERLEAVE1-NEXT: [[TMP59:%.*]] = insertelement <16 x i16> [[TMP58]], i16 [[TMP43]], i32 8
+; CHECK-INTERLEAVE1-NEXT: [[TMP60:%.*]] = insertelement <16 x i16> [[TMP59]], i16 [[TMP44]], i32 9
+; CHECK-INTERLEAVE1-NEXT: [[TMP61:%.*]] = insertelement <16 x i16> [[TMP60]], i16 [[TMP45]], i32 10
+; CHECK-INTERLEAVE1-NEXT: [[TMP62:%.*]] = insertelement <16 x i16> [[TMP61]], i16 [[TMP46]], i32 11
+; CHECK-INTERLEAVE1-NEXT: [[TMP63:%.*]] = insertelement <16 x i16> [[TMP62]], i16 [[TMP47]], i32 12
+; CHECK-INTERLEAVE1-NEXT: [[TMP64:%.*]] = insertelement <16 x i16> [[TMP63]], i16 [[TMP48]], i32 13
+; CHECK-INTERLEAVE1-NEXT: [[TMP65:%.*]] = insertelement <16 x i16> [[TMP64]], i16 [[TMP49]], i32 14
+; CHECK-INTERLEAVE1-NEXT: [[TMP66:%.*]] = insertelement <16 x i16> [[TMP65]], i16 [[TMP50]], i32 15
; CHECK-INTERLEAVE1-NEXT: [[TMP67:%.*]] = zext <16 x i16> [[TMP66]] to <16 x i32>
; CHECK-INTERLEAVE1-NEXT: [[TMP68:%.*]] = mul <16 x i32> [[TMP67]], [[TMP18]]
; CHECK-INTERLEAVE1-NEXT: [[TMP69]] = add <16 x i32> [[TMP68]], [[VEC_PHI]]
@@ -300,22 +300,22 @@ define i32 @not_dotp_different_types(ptr %a, ptr %b) {
; CHECK-INTERLEAVED-NEXT: [[TMP82:%.*]] = load i16, ptr [[TMP50]], align 2
; CHECK-INTERLEAVED-NEXT: [[TMP83:%.*]] = load i16, ptr [[TMP51]], align 2
; CHECK-INTERLEAVED-NEXT: [[TMP84:%.*]] = load i16, ptr [[TMP52]], align 2
-; CHECK-INTERLEAVED-NEXT: [[TMP85:%.*]] = insertelement <16 x i16> poison, i16 [[TMP69]], i64 0
-; CHECK-INTERLEAVED-NEXT: [[TMP86:%.*]] = insertelement <16 x i16> [[TMP85]], i16 [[TMP70]], i64 1
-; CHECK-INTERLEAVED-NEXT: [[TMP87:%.*]] = insertelement <16 x i16> [[TMP86]], i16 [[TMP71]], i64 2
-; CHECK-INTERLEAVED-NEXT: [[TMP88:%.*]] = insertelement <16 x i16> [[TMP87]], i16 [[TMP72]], i64 3
-; CHECK-INTERLEAVED-NEXT: [[TMP89:%.*]] = insertelement <16 x i16> [[TMP88]], i16 [[TMP73]], i64 4
-; CHECK-INTERLEAVED-NEXT: [[TMP90:%.*]] = insertelement <16 x i16> [[TMP89]], i16 [[TMP74]], i64 5
-; CHECK-INTERLEAVED-NEXT: [[TMP91:%.*]] = insertelement <16 x i16> [[TMP90]], i16 [[TMP75]], i64 6
-; CHECK-INTERLEAVED-NEXT: [[TMP92:%.*]] = insertelement <16 x i16> [[TMP91]], i16 [[TMP76]], i64 7
-; CHECK-INTERLEAVED-NEXT: [[TMP93:%.*]] = insertelement <16 x i16> [[TMP92]], i16 [[TMP77]], i64 8
-; CHECK-INTERLEAVED-NEXT: [[TMP94:%.*]] = insertelement <16 x i16> [[TMP93]], i16 [[TMP78]], i64 9
-; CHECK-INTERLEAVED-NEXT: [[TMP95:%.*]] = insertelement <16 x i16> [[TMP94]], i16 [[TMP79]], i64 10
-; CHECK-INTERLEAVED-NEXT: [[TMP96:%.*]] = insertelement <16 x i16> [[TMP95]], i16 [[TMP80]], i64 11
-; CHECK-INTERLEAVED-NEXT: [[TMP97:%.*]] = insertelement <16 x i16> [[TMP96]], i16 [[TMP81]], i64 12
-; CHECK-INTERLEAVED-NEXT: [[TMP98:%.*]] = insertelement <16 x i16> [[TMP97]], i16 [[TMP82]], i64 13
-; CHECK-INTERLEAVED-NEXT: [[TMP99:%.*]] = insertelement <16 x i16> [[TMP98]], i16 [[TMP83]], i64 14
-; CHECK-INTERLEAVED-NEXT: [[TMP100:%.*]] = insertelement <16 x i16> [[TMP99]], i16 [[TMP84]], i64 15
+; CHECK-INTERLEAVED-NEXT: [[TMP85:%.*]] = insertelement <16 x i16> poison, i16 [[TMP69]], i32 0
+; CHECK-INTERLEAVED-NEXT: [[TMP86:%.*]] = insertelement <16 x i16> [[TMP85]], i16 [[TMP70]], i32 1
+; CHECK-INTERLEAVED-NEXT: [[TMP87:%.*]] = insertelement <16 x i16> [[TMP86]], i16 [[TMP71]], i32 2
+; CHECK-INTERLEAVED-NEXT: [[TMP88:%.*]] = insertelement <16 x i16> [[TMP87]], i16 [[TMP72]], i32 3
+; CHECK-INTERLEAVED-NEXT: [[TMP89:%.*]] = insertelement <16 x i16> [[TMP88]], i16 [[TMP73]], i32 4
+; CHECK-INTERLEAVED-NEXT: [[TMP90:%.*]] = insertelement <16 x i16> [[TMP89]], i16 [[TMP74]], i32 5
+; CHECK-INTERLEAVED-NEXT: [[TMP91:%.*]] = insertelement <16 x i16> [[TMP90]], i16 [[TMP75]], i32 6
+; CHECK-INTERLEAVED-NEXT: [[TMP92:%.*]] = insertelement <16 x i16> [[TMP91]], i16 [[TMP76]], i32 7
+; CHECK-INTERLEAVED-NEXT: [[TMP93:%.*]] = insertelement <16 x i16> [[TMP92]], i16 [[TMP77]], i32 8
+; CHECK-INTERLEAVED-NEXT: [[TMP94:%.*]] = insertelement <16 x i16> [[TMP93]], i16 [[TMP78]], i32 9
+; CHECK-INTERLEAVED-NEXT: [[TMP95:%.*]] = insertelement <16 x i16> [[TMP94]], i16 [[TMP79]], i32 10
+; CHECK-INTERLEAVED-NEXT: [[TMP96:%.*]] = insertelement <16 x i16> [[TMP95]], i16 [[TMP80]], i32 11
+; CHECK-INTERLEAVED-NEXT: [[TMP97:%.*]] = insertelement <16 x i16> [[TMP96]], i16 [[TMP81]], i32 12
+; CHECK-INTERLEAVED-NEXT: [[TMP98:%.*]] = insertelement <16 x i16> [[TMP97]], i16 [[TMP82]], i32 13
+; CHECK-INTERLEAVED-NEXT: [[TMP99:%.*]] = insertelement <16 x i16> [[TMP98]], i16 [[TMP83]], i32 14
+; CHECK-INTERLEAVED-NEXT: [[TMP100:%.*]] = insertelement <16 x i16> [[TMP99]], i16 [[TMP84]], i32 15
; CHECK-INTERLEAVED-NEXT: [[TMP101:%.*]] = load i16, ptr [[TMP53]], align 2
; CHECK-INTERLEAVED-NEXT: [[TMP102:%.*]] = load i16, ptr [[TMP54]], align 2
; CHECK-INTERLEAVED-NEXT: [[TMP103:%.*]] = load i16, ptr [[TMP55]], align 2
@@ -332,22 +332,22 @@ define i32 @not_dotp_different_types(ptr %a, ptr %b) {
; CHECK-INTERLEAVED-NEXT: [[TMP114:%.*]] = load i16, ptr [[TMP66]], align 2
; CHECK-INTERLEAVED-NEXT: [[TMP115:%.*]] = load i16, ptr [[TMP67]], align 2
; CHECK-INTERLEAVED-NEXT: [[TMP116:%.*]] = load i16, ptr [[TMP68]], align 2
-; CHECK-INTERLEAVED-NEXT: [[TMP117:%.*]] = insertelement <16 x i16> poison, i16 [[TMP101]], i64 0
-; CHECK-INTERLEAVED-NEXT: [[TMP118:%.*]] = insertelement <16 x i16> [[TMP117]], i16 [[TMP102]], i64 1
-; CHECK-INTERLEAVED-NEXT: [[TMP119:%.*]] = insertelement <16 x i16> [[TMP118]], i16 [[TMP103]], i64 2
-; CHECK-INTERLEAVED-NEXT: [[TMP120:%.*]] = insertelement <16 x i16> [[TMP119]], i16 [[TMP104]], i64 3
-; CHECK-INTERLEAVED-NEXT: [[TMP121:%.*]] = insertelement <16 x i16> [[TMP120]], i16 [[TMP105]], i64 4
-; CHECK-INTERLEAVED-NEXT: [[TMP122:%.*]] = insertelement <16 x i16> [[TMP121]], i16 [[TMP106]], i64 5
-; CHECK-INTERLEAVED-NEXT: [[TMP123:%.*]] = insertelement <16 x i16> [[TMP122]], i16 [[TMP107]], i64 6
-; CHECK-INTERLEAVED-NEXT: [[TMP124:%.*]] = insertelement <16 x i16> [[TMP123]], i16 [[TMP108]], i64 7
-; CHECK-INTERLEAVED-NEXT: [[TMP125:%.*]] = insertelement <16 x i16> [[TMP124]], i16 [[TMP109]], i64 8
-; CHECK-INTERLEAVED-NEXT: [[TMP126:%.*]] = insertelement <16 x i16> [[TMP125]], i16 [[TMP110]], i64 9
-; CHECK-INTERLEAVED-NEXT: [[TMP127:%.*]] = insertelement <16 x i16> [[TMP126]], i16 [[TMP111]], i64 10
-; CHECK-INTERLEAVED-NEXT: [[TMP128:%.*]] = insertelement <16 x i16> [[TMP127]], i16 [[TMP112]], i64 11
-; CHECK-INTERLEAVED-NEXT: [[TMP129:%.*]] = insertelement <16 x i16> [[TMP128]], i16 [[TMP113]], i64 12
-; CHECK-INTERLEAVED-NEXT: [[TMP130:%.*]] = insertelement <16 x i16> [[TMP129]], i16 [[TMP114]], i64 13
-; CHECK-INTERLEAVED-NEXT: [[TMP131:%.*]] = insertelement <16 x i16> [[TMP130]], i16 [[TMP115]], i64 14
-; CHECK-INTERLEAVED-NEXT: [[TMP132:%.*]] = insertelement <16 x i16> [[TMP131]], i16 [[TMP116]], i64 15
+; CHECK-INTERLEAVED-NEXT: [[TMP117:%.*]] = insertelement <16 x i16> poison, i16 [[TMP101]], i32 0
+; CHECK-INTERLEAVED-NEXT: [[TMP118:%.*]] = insertelement <16 x i16> [[TMP117]], i16 [[TMP102]], i32 1
+; CHECK-INTERLEAVED-NEXT: [[TMP119:%.*]] = insertelement <16 x i16> [[TMP118]], i16 [[TMP103]], i32 2
+; CHECK-INTERLEAVED-NEXT: [[TMP120:%.*]] = insertelement <16 x i16> [[TMP119]], i16 [[TMP104]], i32 3
+; CHECK-INTERLEAVED-NEXT: [[TMP121:%.*]] = insertelement <16 x i16> [[TMP120]], i16 [[TMP105]], i32 4
+; CHECK-INTERLEAVED-NEXT: [[TMP122:%.*]] = insertelement <16 x i16> [[TMP121]], i16 [[TMP106]], i32 5
+; CHECK-INTERLEAVED-NEXT: [[TMP123:%.*]] = insertelement <16 x i16> [[TMP122]], i16 [[TMP107]], i32 6
+; CHECK-INTERLEAVED-NEXT: [[TMP124:%.*]] = insertelement <16 x i16> [[TMP123]], i16 [[TMP108]], i32 7
+; CHECK-INTERLEAVED-NEXT: [[TMP125:%.*]] = insertelement <16 x i16> [[TMP124]], i16 [[TMP109]], i32 8
+; CHECK-INTERLEAVED-NEXT: [[TMP126:%.*]] = insertelement <16 x i16> [[TMP125]], i16 [[TMP110]], i32 9
+; CHECK-INTERLEAVED-NEXT: [[TMP127:%.*]] = insertelement <16 x i16> [[TMP126]], i16 [[TMP111]], i32 10
+; CHECK-INTERLEAVED-NEXT: [[TMP128:%.*]] = insertelement <16 x i16> [[TMP127]], i16 [[TMP112]], i32 11
+; CHECK-INTERLEAVED-NEXT: [[TMP129:%.*]] = insertelement <16 x i16> [[TMP128]], i16 [[TMP113]], i32 12
+; CHECK-INTERLEAVED-NEXT: [[TMP130:%.*]] = insertelement <16 x i16> [[TMP129]], i16 [[TMP114]], i32 13
+; CHECK-INTERLEAVED-NEXT: [[TMP131:%.*]] = insertelement <16 x i16> [[TMP130]], i16 [[TMP115]], i32 14
+; CHECK-INTERLEAVED-NEXT: [[TMP132:%.*]] = insertelement <16 x i16> [[TMP131]], i16 [[TMP116]], i32 15
; CHECK-INTERLEAVED-NEXT: [[TMP133:%.*]] = zext <16 x i16> [[TMP100]] to <16 x i32>
; CHECK-INTERLEAVED-NEXT: [[TMP134:%.*]] = zext <16 x i16> [[TMP132]] to <16 x i32>
; CHECK-INTERLEAVED-NEXT: [[TMP135:%.*]] = mul <16 x i32> [[TMP133]], [[TMP35]]
@@ -423,22 +423,22 @@ define i32 @not_dotp_different_types(ptr %a, ptr %b) {
; CHECK-MAXBW-NEXT: [[TMP48:%.*]] = load i16, ptr [[TMP32]], align 2
; CHECK-MAXBW-NEXT: [[TMP49:%.*]] = load i16, ptr [[TMP33]], align 2
; CHECK-MAXBW-NEXT: [[TMP50:%.*]] = load i16, ptr [[TMP34]], align 2
-; CHECK-MAXBW-NEXT: [[TMP51:%.*]] = insertelement <16 x i16> poison, i16 [[TMP35]], i64 0
-; CHECK-MAXBW-NEXT: [[TMP52:%.*]] = insertelement <16 x i16> [[TMP51]], i16 [[TMP36]], i64 1
-; CHECK-MAXBW-NEXT: [[TMP53:%.*]] = insertelement <16 x i16> [[TMP52]], i16 [[TMP37]], i64 2
-; CHECK-MAXBW-NEXT: [[TMP54:%.*]] = insertelement <16 x i16> [[TMP53]], i16 [[TMP38]], i64 3
-; CHECK-MAXBW-NEXT: [[TMP55:%.*]] = insertelement <16 x i16> [[TMP54]], i16 [[TMP39]], i64 4
-; CHECK-MAXBW-NEXT: [[TMP56:%.*]] = insertelement <16 x i16> [[TMP55]], i16 [[TMP40]], i64 5
-; CHECK-MAXBW-NEXT: [[TMP57:%.*]] = insertelement <16 x i16> [[TMP56]], i16 [[TMP41]], i64 6
-; CHECK-MAXBW-NEXT: [[TMP58:%.*]] = insertelement <16 x i16> [[TMP57]], i16 [[TMP42]], i64 7
-; CHECK-MAXBW-NEXT: [[TMP59:%.*]] = insertelement <16 x i16> [[TMP58]], i16 [[TMP43]], i64 8
-; CHECK-MAXBW-NEXT: [[TMP60:%.*]] = insertelement <16 x i16> [[TMP59]], i16 [[TMP44]], i64 9
-; CHECK-MAXBW-NEXT: [[TMP61:%.*]] = insertelement <16 x i16> [[TMP60]], i16 [[TMP45]], i64 10
-; CHECK-MAXBW-NEXT: [[TMP62:%.*]] = insertelement <16 x i16> [[TMP61]], i16 [[TMP46]], i64 11
-; CHECK-MAXBW-NEXT: [[TMP63:%.*]] = insertelement <16 x i16> [[TMP62]], i16 [[TMP47]], i64 12
-; CHECK-MAXBW-NEXT: [[TMP64:%.*]] = insertelement <16 x i16> [[TMP63]], i16 [[TMP48]], i64 13
-; CHECK-MAXBW-NEXT: [[TMP65:%.*]] = insertelement <16 x i16> [[TMP64]], i16 [[TMP49]], i64 14
-; CHECK-MAXBW-NEXT: [[TMP66:%.*]] = insertelement <16 x i16> [[TMP65]], i16 [[TMP50]], i64 15
+; CHECK-MAXBW-NEXT: [[TMP51:%.*]] = insertelement <16 x i16> poison, i16 [[TMP35]], i32 0
+; CHECK-MAXBW-NEXT: [[TMP52:%.*]] = insertelement <16 x i16> [[TMP51]], i16 [[TMP36]], i32 1
+; CHECK-MAXBW-NEXT: [[TMP53:%.*]] = insertelement <16 x i16> [[TMP52]], i16 [[TMP37]], i32 2
+; CHECK-MAXBW-NEXT: [[TMP54:%.*]] = insertelement <16 x i16> [[TMP53]], i16 [[TMP38]], i32 3
+; CHECK-MAXBW-NEXT: [[TMP55:%.*]] = insertelement <16 x i16> [[TMP54]], i16 [[TMP39]], i32 4
+; CHECK-MAXBW-NEXT: [[TMP56:%.*]] = insertelement <16 x i16> [[TMP55]], i16 [[TMP40]], i32 5
+; CHECK-MAXBW-NEXT: [[TMP57:%.*]] = insertelement <16 x i16> [[TMP56]], i16 [[TMP41]], i32 6
+; CHECK-MAXBW-NEXT: [[TMP58:%.*]] = insertelement <16 x i16> [[TMP57]], i16 [[TMP42]], i32 7
+; CHECK-MAXBW-NEXT: [[TMP59:%.*]] = insertelement <16 x i16> [[TMP58]], i16 [[TMP43]], i32 8
+; CHECK-MAXBW-NEXT: [[TMP60:%.*]] = insertelement <16 x i16> [[TMP59]], i16 [[TMP44]], i32 9
+; CHECK-MAXBW-NEXT: [[TMP61:%.*]] = insertelement <16 x i16> [[TMP60]], i16 [[TMP45]], i32 10
+; CHECK-MAXBW-NEXT: [[TMP62:%.*]] = insertelement <16 x i16> [[TMP61]], i16 [[TMP46]], i32 11
+; CHECK-MAXBW-NEXT: [[TMP63:%.*]] = insertelement <16 x i16> [[TMP62]], i16 [[TMP47]], i32 12
+; CHECK-MAXBW-NEXT: [[TMP64:%.*]] = insertelement <16 x i16> [[TMP63]], i16 [[TMP48]], i32 13
+; CHECK-MAXBW-NEXT: [[TMP65:%.*]] = insertelement <16 x i16> [[TMP64]], i16 [[TMP49]], i32 14
+; CHECK-MAXBW-NEXT: [[TMP66:%.*]] = insertelement <16 x i16> [[TMP65]], i16 [[TMP50]], i32 15
; CHECK-MAXBW-NEXT: [[TMP67:%.*]] = zext <16 x i16> [[TMP66]] to <16 x i32>
; CHECK-MAXBW-NEXT: [[TMP68:%.*]] = mul <16 x i32> [[TMP67]], [[TMP18]]
; CHECK-MAXBW-NEXT: [[TMP69]] = add <16 x i32> [[TMP68]], [[VEC_PHI]]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product.ll b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product.ll
index a9e8233615783..6bdc6c972c5b4 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product.ll
@@ -453,22 +453,22 @@ define i32 @not_dotp_different_types(ptr %a, ptr %b) #0 {
; CHECK-INTERLEAVE1-NEXT: [[TMP46:%.*]] = load i16, ptr [[TMP30]], align 2
; CHECK-INTERLEAVE1-NEXT: [[TMP47:%.*]] = load i16, ptr [[TMP31]], align 2
; CHECK-INTERLEAVE1-NEXT: [[TMP48:%.*]] = load i16, ptr [[TMP32]], align 2
-; CHECK-INTERLEAVE1-NEXT: [[TMP49:%.*]] = insertelement <16 x i16> poison, i16 [[TMP33]], i64 0
-; CHECK-INTERLEAVE1-NEXT: [[TMP50:%.*]] = insertelement <16 x i16> [[TMP49]], i16 [[TMP34]], i64 1
-; CHECK-INTERLEAVE1-NEXT: [[TMP51:%.*]] = insertelement <16 x i16> [[TMP50]], i16 [[TMP35]], i64 2
-; CHECK-INTERLEAVE1-NEXT: [[TMP52:%.*]] = insertelement <16 x i16> [[TMP51]], i16 [[TMP36]], i64 3
-; CHECK-INTERLEAVE1-NEXT: [[TMP53:%.*]] = insertelement <16 x i16> [[TMP52]], i16 [[TMP37]], i64 4
-; CHECK-INTERLEAVE1-NEXT: [[TMP54:%.*]] = insertelement <16 x i16> [[TMP53]], i16 [[TMP38]], i64 5
-; CHECK-INTERLEAVE1-NEXT: [[TMP55:%.*]] = insertelement <16 x i16> [[TMP54]], i16 [[TMP39]], i64 6
-; CHECK-INTERLEAVE1-NEXT: [[TMP56:%.*]] = insertelement <16 x i16> [[TMP55]], i16 [[TMP40]], i64 7
-; CHECK-INTERLEAVE1-NEXT: [[TMP57:%.*]] = insertelement <16 x i16> [[TMP56]], i16 [[TMP41]], i64 8
-; CHECK-INTERLEAVE1-NEXT: [[TMP58:%.*]] = insertelement <16 x i16> [[TMP57]], i16 [[TMP42]], i64 9
-; CHECK-INTERLEAVE1-NEXT: [[TMP59:%.*]] = insertelement <16 x i16> [[TMP58]], i16 [[TMP43]], i64 10
-; CHECK-INTERLEAVE1-NEXT: [[TMP60:%.*]] = insertelement <16 x i16> [[TMP59]], i16 [[TMP44]], i64 11
-; CHECK-INTERLEAVE1-NEXT: [[TMP61:%.*]] = insertelement <16 x i16> [[TMP60]], i16 [[TMP45]], i64 12
-; CHECK-INTERLEAVE1-NEXT: [[TMP62:%.*]] = insertelement <16 x i16> [[TMP61]], i16 [[TMP46]], i64 13
-; CHECK-INTERLEAVE1-NEXT: [[TMP63:%.*]] = insertelement <16 x i16> [[TMP62]], i16 [[TMP47]], i64 14
-; CHECK-INTERLEAVE1-NEXT: [[TMP64:%.*]] = insertelement <16 x i16> [[TMP63]], i16 [[TMP48]], i64 15
+; CHECK-INTERLEAVE1-NEXT: [[TMP49:%.*]] = insertelement <16 x i16> poison, i16 [[TMP33]], i32 0
+; CHECK-INTERLEAVE1-NEXT: [[TMP50:%.*]] = insertelement <16 x i16> [[TMP49]], i16 [[TMP34]], i32 1
+; CHECK-INTERLEAVE1-NEXT: [[TMP51:%.*]] = insertelement <16 x i16> [[TMP50]], i16 [[TMP35]], i32 2
+; CHECK-INTERLEAVE1-NEXT: [[TMP52:%.*]] = insertelement <16 x i16> [[TMP51]], i16 [[TMP36]], i32 3
+; CHECK-INTERLEAVE1-NEXT: [[TMP53:%.*]] = insertelement <16 x i16> [[TMP52]], i16 [[TMP37]], i32 4
+; CHECK-INTERLEAVE1-NEXT: [[TMP54:%.*]] = insertelement <16 x i16> [[TMP53]], i16 [[TMP38]], i32 5
+; CHECK-INTERLEAVE1-NEXT: [[TMP55:%.*]] = insertelement <16 x i16> [[TMP54]], i16 [[TMP39]], i32 6
+; CHECK-INTERLEAVE1-NEXT: [[TMP56:%.*]] = insertelement <16 x i16> [[TMP55]], i16 [[TMP40]], i32 7
+; CHECK-INTERLEAVE1-NEXT: [[TMP57:%.*]] = insertelement <16 x i16> [[TMP56]], i16 [[TMP41]], i32 8
+; CHECK-INTERLEAVE1-NEXT: [[TMP58:%.*]] = insertelement <16 x i16> [[TMP57]], i16 [[TMP42]], i32 9
+; CHECK-INTERLEAVE1-NEXT: [[TMP59:%.*]] = insertelement <16 x i16> [[TMP58]], i16 [[TMP43]], i32 10
+; CHECK-INTERLEAVE1-NEXT: [[TMP60:%.*]] = insertelement <16 x i16> [[TMP59]], i16 [[TMP44]], i32 11
+; CHECK-INTERLEAVE1-NEXT: [[TMP61:%.*]] = insertelement <16 x i16> [[TMP60]], i16 [[TMP45]], i32 12
+; CHECK-INTERLEAVE1-NEXT: [[TMP62:%.*]] = insertelement <16 x i16> [[TMP61]], i16 [[TMP46]], i32 13
+; CHECK-INTERLEAVE1-NEXT: [[TMP63:%.*]] = insertelement <16 x i16> [[TMP62]], i16 [[TMP47]], i32 14
+; CHECK-INTERLEAVE1-NEXT: [[TMP64:%.*]] = insertelement <16 x i16> [[TMP63]], i16 [[TMP48]], i32 15
; CHECK-INTERLEAVE1-NEXT: [[TMP65:%.*]] = zext <16 x i16> [[TMP64]] to <16 x i32>
; CHECK-INTERLEAVE1-NEXT: [[TMP66:%.*]] = mul <16 x i32> [[TMP65]], [[TMP16]]
; CHECK-INTERLEAVE1-NEXT: [[TMP67]] = add <16 x i32> [[TMP66]], [[VEC_PHI]]
@@ -576,22 +576,22 @@ define i32 @not_dotp_different_types(ptr %a, ptr %b) #0 {
; CHECK-INTERLEAVED-NEXT: [[TMP80:%.*]] = load i16, ptr [[TMP48]], align 2
; CHECK-INTERLEAVED-NEXT: [[TMP81:%.*]] = load i16, ptr [[TMP49]], align 2
; CHECK-INTERLEAVED-NEXT: [[TMP82:%.*]] = load i16, ptr [[TMP50]], align 2
-; CHECK-INTERLEAVED-NEXT: [[TMP83:%.*]] = insertelement <16 x i16> poison, i16 [[TMP67]], i64 0
-; CHECK-INTERLEAVED-NEXT: [[TMP84:%.*]] = insertelement <16 x i16> [[TMP83]], i16 [[TMP68]], i64 1
-; CHECK-INTERLEAVED-NEXT: [[TMP85:%.*]] = insertelement <16 x i16> [[TMP84]], i16 [[TMP69]], i64 2
-; CHECK-INTERLEAVED-NEXT: [[TMP86:%.*]] = insertelement <16 x i16> [[TMP85]], i16 [[TMP70]], i64 3
-; CHECK-INTERLEAVED-NEXT: [[TMP87:%.*]] = insertelement <16 x i16> [[TMP86]], i16 [[TMP71]], i64 4
-; CHECK-INTERLEAVED-NEXT: [[TMP88:%.*]] = insertelement <16 x i16> [[TMP87]], i16 [[TMP72]], i64 5
-; CHECK-INTERLEAVED-NEXT: [[TMP89:%.*]] = insertelement <16 x i16> [[TMP88]], i16 [[TMP73]], i64 6
-; CHECK-INTERLEAVED-NEXT: [[TMP90:%.*]] = insertelement <16 x i16> [[TMP89]], i16 [[TMP74]], i64 7
-; CHECK-INTERLEAVED-NEXT: [[TMP91:%.*]] = insertelement <16 x i16> [[TMP90]], i16 [[TMP75]], i64 8
-; CHECK-INTERLEAVED-NEXT: [[TMP92:%.*]] = insertelement <16 x i16> [[TMP91]], i16 [[TMP76]], i64 9
-; CHECK-INTERLEAVED-NEXT: [[TMP93:%.*]] = insertelement <16 x i16> [[TMP92]], i16 [[TMP77]], i64 10
-; CHECK-INTERLEAVED-NEXT: [[TMP94:%.*]] = insertelement <16 x i16> [[TMP93]], i16 [[TMP78]], i64 11
-; CHECK-INTERLEAVED-NEXT: [[TMP95:%.*]] = insertelement <16 x i16> [[TMP94]], i16 [[TMP79]], i64 12
-; CHECK-INTERLEAVED-NEXT: [[TMP96:%.*]] = insertelement <16 x i16> [[TMP95]], i16 [[TMP80]], i64 13
-; CHECK-INTERLEAVED-NEXT: [[TMP97:%.*]] = insertelement <16 x i16> [[TMP96]], i16 [[TMP81]], i64 14
-; CHECK-INTERLEAVED-NEXT: [[TMP98:%.*]] = insertelement <16 x i16> [[TMP97]], i16 [[TMP82]], i64 15
+; CHECK-INTERLEAVED-NEXT: [[TMP83:%.*]] = insertelement <16 x i16> poison, i16 [[TMP67]], i32 0
+; CHECK-INTERLEAVED-NEXT: [[TMP84:%.*]] = insertelement <16 x i16> [[TMP83]], i16 [[TMP68]], i32 1
+; CHECK-INTERLEAVED-NEXT: [[TMP85:%.*]] = insertelement <16 x i16> [[TMP84]], i16 [[TMP69]], i32 2
+; CHECK-INTERLEAVED-NEXT: [[TMP86:%.*]] = insertelement <16 x i16> [[TMP85]], i16 [[TMP70]], i32 3
+; CHECK-INTERLEAVED-NEXT: [[TMP87:%.*]] = insertelement <16 x i16> [[TMP86]], i16 [[TMP71]], i32 4
+; CHECK-INTERLEAVED-NEXT: [[TMP88:%.*]] = insertelement <16 x i16> [[TMP87]], i16 [[TMP72]], i32 5
+; CHECK-INTERLEAVED-NEXT: [[TMP89:%.*]] = insertelement <16 x i16> [[TMP88]], i16 [[TMP73]], i32 6
+; CHECK-INTERLEAVED-NEXT: [[TMP90:%.*]] = insertelement <16 x i16> [[TMP89]], i16 [[TMP74]], i32 7
+; CHECK-INTERLEAVED-NEXT: [[TMP91:%.*]] = insertelement <16 x i16> [[TMP90]], i16 [[TMP75]], i32 8
+; CHECK-INTERLEAVED-NEXT: [[TMP92:%.*]] = insertelement <16 x i16> [[TMP91]], i16 [[TMP76]], i32 9
+; CHECK-INTERLEAVED-NEXT: [[TMP93:%.*]] = insertelement <16 x i16> [[TMP92]], i16 [[TMP77]], i32 10
+; CHECK-INTERLEAVED-NEXT: [[TMP94:%.*]] = insertelement <16 x i16> [[TMP93]], i16 [[TMP78]], i32 11
+; CHECK-INTERLEAVED-NEXT: [[TMP95:%.*]] = insertelement <16 x i16> [[TMP94]], i16 [[TMP79]], i32 12
+; CHECK-INTERLEAVED-NEXT: [[TMP96:%.*]] = insertelement <16 x i16> [[TMP95]], i16 [[TMP80]], i32 13
+; CHECK-INTERLEAVED-NEXT: [[TMP97:%.*]] = insertelement <16 x i16> [[TMP96]], i16 [[TMP81]], i32 14
+; CHECK-INTERLEAVED-NEXT: [[TMP98:%.*]] = insertelement <16 x i16> [[TMP97]], i16 [[TMP82]], i32 15
; CHECK-INTERLEAVED-NEXT: [[TMP99:%.*]] = load i16, ptr [[TMP51]], align 2
; CHECK-INTERLEAVED-NEXT: [[TMP100:%.*]] = load i16, ptr [[TMP52]], align 2
; CHECK-INTERLEAVED-NEXT: [[TMP101:%.*]] = load i16, ptr [[TMP53]], align 2
@@ -608,22 +608,22 @@ define i32 @not_dotp_different_types(ptr %a, ptr %b) #0 {
; CHECK-INTERLEAVED-NEXT: [[TMP112:%.*]] = load i16, ptr [[TMP64]], align 2
; CHECK-INTERLEAVED-NEXT: [[TMP113:%.*]] = load i16, ptr [[TMP65]], align 2
; CHECK-INTERLEAVED-NEXT: [[TMP114:%.*]] = load i16, ptr [[TMP66]], align 2
-; CHECK-INTERLEAVED-NEXT: [[TMP115:%.*]] = insertelement <16 x i16> poison, i16 [[TMP99]], i64 0
-; CHECK-INTERLEAVED-NEXT: [[TMP116:%.*]] = insertelement <16 x i16> [[TMP115]], i16 [[TMP100]], i64 1
-; CHECK-INTERLEAVED-NEXT: [[TMP117:%.*]] = insertelement <16 x i16> [[TMP116]], i16 [[TMP101]], i64 2
-; CHECK-INTERLEAVED-NEXT: [[TMP118:%.*]] = insertelement <16 x i16> [[TMP117]], i16 [[TMP102]], i64 3
-; CHECK-INTERLEAVED-NEXT: [[TMP119:%.*]] = insertelement <16 x i16> [[TMP118]], i16 [[TMP103]], i64 4
-; CHECK-INTERLEAVED-NEXT: [[TMP120:%.*]] = insertelement <16 x i16> [[TMP119]], i16 [[TMP104]], i64 5
-; CHECK-INTERLEAVED-NEXT: [[TMP121:%.*]] = insertelement <16 x i16> [[TMP120]], i16 [[TMP105]], i64 6
-; CHECK-INTERLEAVED-NEXT: [[TMP122:%.*]] = insertelement <16 x i16> [[TMP121]], i16 [[TMP106]], i64 7
-; CHECK-INTERLEAVED-NEXT: [[TMP123:%.*]] = insertelement <16 x i16> [[TMP122]], i16 [[TMP107]], i64 8
-; CHECK-INTERLEAVED-NEXT: [[TMP124:%.*]] = insertelement <16 x i16> [[TMP123]], i16 [[TMP108]], i64 9
-; CHECK-INTERLEAVED-NEXT: [[TMP125:%.*]] = insertelement <16 x i16> [[TMP124]], i16 [[TMP109]], i64 10
-; CHECK-INTERLEAVED-NEXT: [[TMP126:%.*]] = insertelement <16 x i16> [[TMP125]], i16 [[TMP110]], i64 11
-; CHECK-INTERLEAVED-NEXT: [[TMP127:%.*]] = insertelement <16 x i16> [[TMP126]], i16 [[TMP111]], i64 12
-; CHECK-INTERLEAVED-NEXT: [[TMP128:%.*]] = insertelement <16 x i16> [[TMP127]], i16 [[TMP112]], i64 13
-; CHECK-INTERLEAVED-NEXT: [[TMP129:%.*]] = insertelement <16 x i16> [[TMP128]], i16 [[TMP113]], i64 14
-; CHECK-INTERLEAVED-NEXT: [[TMP130:%.*]] = insertelement <16 x i16> [[TMP129]], i16 [[TMP114]], i64 15
+; CHECK-INTERLEAVED-NEXT: [[TMP115:%.*]] = insertelement <16 x i16> poison, i16 [[TMP99]], i32 0
+; CHECK-INTERLEAVED-NEXT: [[TMP116:%.*]] = insertelement <16 x i16> [[TMP115]], i16 [[TMP100]], i32 1
+; CHECK-INTERLEAVED-NEXT: [[TMP117:%.*]] = insertelement <16 x i16> [[TMP116]], i16 [[TMP101]], i32 2
+; CHECK-INTERLEAVED-NEXT: [[TMP118:%.*]] = insertelement <16 x i16> [[TMP117]], i16 [[TMP102]], i32 3
+; CHECK-INTERLEAVED-NEXT: [[TMP119:%.*]] = insertelement <16 x i16> [[TMP118]], i16 [[TMP103]], i32 4
+; CHECK-INTERLEAVED-NEXT: [[TMP120:%.*]] = insertelement <16 x i16> [[TMP119]], i16 [[TMP104]], i32 5
+; CHECK-INTERLEAVED-NEXT: [[TMP121:%.*]] = insertelement <16 x i16> [[TMP120]], i16 [[TMP105]], i32 6
+; CHECK-INTERLEAVED-NEXT: [[TMP122:%.*]] = insertelement <16 x i16> [[TMP121]], i16 [[TMP106]], i32 7
+; CHECK-INTERLEAVED-NEXT: [[TMP123:%.*]] = insertelement <16 x i16> [[TMP122]], i16 [[TMP107]], i32 8
+; CHECK-INTERLEAVED-NEXT: [[TMP124:%.*]] = insertelement <16 x i16> [[TMP123]], i16 [[TMP108]], i32 9
+; CHECK-INTERLEAVED-NEXT: [[TMP125:%.*]] = insertelement <16 x i16> [[TMP124]], i16 [[TMP109]], i32 10
+; CHECK-INTERLEAVED-NEXT: [[TMP126:%.*]] = insertelement <16 x i16> [[TMP125]], i16 [[TMP110]], i32 11
+; CHECK-INTERLEAVED-NEXT: [[TMP127:%.*]] = insertelement <16 x i16> [[TMP126]], i16 [[TMP111]], i32 12
+; CHECK-INTERLEAVED-NEXT: [[TMP128:%.*]] = insertelement <16 x i16> [[TMP127]], i16 [[TMP112]], i32 13
+; CHECK-INTERLEAVED-NEXT: [[TMP129:%.*]] = insertelement <16 x i16> [[TMP128]], i16 [[TMP113]], i32 14
+; CHECK-INTERLEAVED-NEXT: [[TMP130:%.*]] = insertelement <16 x i16> [[TMP129]], i16 [[TMP114]], i32 15
; CHECK-INTERLEAVED-NEXT: [[TMP131:%.*]] = zext <16 x i16> [[TMP98]] to <16 x i32>
; CHECK-INTERLEAVED-NEXT: [[TMP132:%.*]] = zext <16 x i16> [[TMP130]] to <16 x i32>
; CHECK-INTERLEAVED-NEXT: [[TMP133:%.*]] = mul <16 x i32> [[TMP131]], [[TMP33]]
@@ -699,22 +699,22 @@ define i32 @not_dotp_different_types(ptr %a, ptr %b) #0 {
; CHECK-MAXBW-NEXT: [[TMP46:%.*]] = load i16, ptr [[TMP30]], align 2
; CHECK-MAXBW-NEXT: [[TMP47:%.*]] = load i16, ptr [[TMP31]], align 2
; CHECK-MAXBW-NEXT: [[TMP48:%.*]] = load i16, ptr [[TMP32]], align 2
-; CHECK-MAXBW-NEXT: [[TMP49:%.*]] = insertelement <16 x i16> poison, i16 [[TMP33]], i64 0
-; CHECK-MAXBW-NEXT: [[TMP50:%.*]] = insertelement <16 x i16> [[TMP49]], i16 [[TMP34]], i64 1
-; CHECK-MAXBW-NEXT: [[TMP51:%.*]] = insertelement <16 x i16> [[TMP50]], i16 [[TMP35]], i64 2
-; CHECK-MAXBW-NEXT: [[TMP52:%.*]] = insertelement <16 x i16> [[TMP51]], i16 [[TMP36]], i64 3
-; CHECK-MAXBW-NEXT: [[TMP53:%.*]] = insertelement <16 x i16> [[TMP52]], i16 [[TMP37]], i64 4
-; CHECK-MAXBW-NEXT: [[TMP54:%.*]] = insertelement <16 x i16> [[TMP53]], i16 [[TMP38]], i64 5
-; CHECK-MAXBW-NEXT: [[TMP55:%.*]] = insertelement <16 x i16> [[TMP54]], i16 [[TMP39]], i64 6
-; CHECK-MAXBW-NEXT: [[TMP56:%.*]] = insertelement <16 x i16> [[TMP55]], i16 [[TMP40]], i64 7
-; CHECK-MAXBW-NEXT: [[TMP57:%.*]] = insertelement <16 x i16> [[TMP56]], i16 [[TMP41]], i64 8
-; CHECK-MAXBW-NEXT: [[TMP58:%.*]] = insertelement <16 x i16> [[TMP57]], i16 [[TMP42]], i64 9
-; CHECK-MAXBW-NEXT: [[TMP59:%.*]] = insertelement <16 x i16> [[TMP58]], i16 [[TMP43]], i64 10
-; CHECK-MAXBW-NEXT: [[TMP60:%.*]] = insertelement <16 x i16> [[TMP59]], i16 [[TMP44]], i64 11
-; CHECK-MAXBW-NEXT: [[TMP61:%.*]] = insertelement <16 x i16> [[TMP60]], i16 [[TMP45]], i64 12
-; CHECK-MAXBW-NEXT: [[TMP62:%.*]] = insertelement <16 x i16> [[TMP61]], i16 [[TMP46]], i64 13
-; CHECK-MAXBW-NEXT: [[TMP63:%.*]] = insertelement <16 x i16> [[TMP62]], i16 [[TMP47]], i64 14
-; CHECK-MAXBW-NEXT: [[TMP64:%.*]] = insertelement <16 x i16> [[TMP63]], i16 [[TMP48]], i64 15
+; CHECK-MAXBW-NEXT: [[TMP49:%.*]] = insertelement <16 x i16> poison, i16 [[TMP33]], i32 0
+; CHECK-MAXBW-NEXT: [[TMP50:%.*]] = insertelement <16 x i16> [[TMP49]], i16 [[TMP34]], i32 1
+; CHECK-MAXBW-NEXT: [[TMP51:%.*]] = insertelement <16 x i16> [[TMP50]], i16 [[TMP35]], i32 2
+; CHECK-MAXBW-NEXT: [[TMP52:%.*]] = insertelement <16 x i16> [[TMP51]], i16 [[TMP36]], i32 3
+; CHECK-MAXBW-NEXT: [[TMP53:%.*]] = insertelement <16 x i16> [[TMP52]], i16 [[TMP37]], i32 4
+; CHECK-MAXBW-NEXT: [[TMP54:%.*]] = insertelement <16 x i16> [[TMP53]], i16 [[TMP38]], i32 5
+; CHECK-MAXBW-NEXT: [[TMP55:%.*]] = insertelement <16 x i16> [[TMP54]], i16 [[TMP39]], i32 6
+; CHECK-MAXBW-NEXT: [[TMP56:%.*]] = insertelement <16 x i16> [[TMP55]], i16 [[TMP40]], i32 7
+; CHECK-MAXBW-NEXT: [[TMP57:%.*]] = insertelement <16 x i16> [[TMP56]], i16 [[TMP41]], i32 8
+; CHECK-MAXBW-NEXT: [[TMP58:%.*]] = insertelement <16 x i16> [[TMP57]], i16 [[TMP42]], i32 9
+; CHECK-MAXBW-NEXT: [[TMP59:%.*]] = insertelement <16 x i16> [[TMP58]], i16 [[TMP43]], i32 10
+; CHECK-MAXBW-NEXT: [[TMP60:%.*]] = insertelement <16 x i16> [[TMP59]], i16 [[TMP44]], i32 11
+; CHECK-MAXBW-NEXT: [[TMP61:%.*]] = insertelement <16 x i16> [[TMP60]], i16 [[TMP45]], i32 12
+; CHECK-MAXBW-NEXT: [[TMP62:%.*]] = insertelement <16 x i16> [[TMP61]], i16 [[TMP46]], i32 13
+; CHECK-MAXBW-NEXT: [[TMP63:%.*]] = insertelement <16 x i16> [[TMP62]], i16 [[TMP47]], i32 14
+; CHECK-MAXBW-NEXT: [[TMP64:%.*]] = insertelement <16 x i16> [[TMP63]], i16 [[TMP48]], i32 15
; CHECK-MAXBW-NEXT: [[TMP65:%.*]] = zext <16 x i16> [[TMP64]] to <16 x i32>
; CHECK-MAXBW-NEXT: [[TMP66:%.*]] = mul <16 x i32> [[TMP65]], [[TMP16]]
; CHECK-MAXBW-NEXT: [[TMP67]] = add <16 x i32> [[TMP66]], [[VEC_PHI]]
@@ -2136,7 +2136,7 @@ define i32 @not_dotp_vscale1(ptr %a, ptr %b, i32 %n, i64 %cost) #0 {
; CHECK-INTERLEAVE1-NEXT: [[TMP4:%.*]] = trunc i64 [[N_VEC]] to i32
; CHECK-INTERLEAVE1-NEXT: [[TMP5:%.*]] = getelementptr i8, ptr [[A]], i64 [[N_VEC]]
; CHECK-INTERLEAVE1-NEXT: [[TMP6:%.*]] = getelementptr i8, ptr [[B]], i64 [[N_VEC]]
-; CHECK-INTERLEAVE1-NEXT: [[TMP7:%.*]] = insertelement <vscale x 2 x i64> zeroinitializer, i64 [[COST]], i64 0
+; CHECK-INTERLEAVE1-NEXT: [[TMP7:%.*]] = insertelement <vscale x 2 x i64> zeroinitializer, i64 [[COST]], i32 0
; CHECK-INTERLEAVE1-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-INTERLEAVE1: [[VECTOR_BODY]]:
; CHECK-INTERLEAVE1-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -2177,7 +2177,7 @@ define i32 @not_dotp_vscale1(ptr %a, ptr %b, i32 %n, i64 %cost) #0 {
; CHECK-INTERLEAVED-NEXT: [[TMP5:%.*]] = trunc i64 [[N_VEC]] to i32
; CHECK-INTERLEAVED-NEXT: [[TMP6:%.*]] = getelementptr i8, ptr [[A]], i64 [[N_VEC]]
; CHECK-INTERLEAVED-NEXT: [[TMP7:%.*]] = getelementptr i8, ptr [[B]], i64 [[N_VEC]]
-; CHECK-INTERLEAVED-NEXT: [[TMP8:%.*]] = insertelement <vscale x 2 x i64> zeroinitializer, i64 [[COST]], i64 0
+; CHECK-INTERLEAVED-NEXT: [[TMP8:%.*]] = insertelement <vscale x 2 x i64> zeroinitializer, i64 [[COST]], i32 0
; CHECK-INTERLEAVED-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-INTERLEAVED: [[VECTOR_BODY]]:
; CHECK-INTERLEAVED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -2227,7 +2227,7 @@ define i32 @not_dotp_vscale1(ptr %a, ptr %b, i32 %n, i64 %cost) #0 {
; CHECK-MAXBW-NEXT: [[TMP4:%.*]] = trunc i64 [[N_VEC]] to i32
; CHECK-MAXBW-NEXT: [[TMP5:%.*]] = getelementptr i8, ptr [[A]], i64 [[N_VEC]]
; CHECK-MAXBW-NEXT: [[TMP6:%.*]] = getelementptr i8, ptr [[B]], i64 [[N_VEC]]
-; CHECK-MAXBW-NEXT: [[TMP7:%.*]] = insertelement <vscale x 2 x i64> zeroinitializer, i64 [[COST]], i64 0
+; CHECK-MAXBW-NEXT: [[TMP7:%.*]] = insertelement <vscale x 2 x i64> zeroinitializer, i64 [[COST]], i32 0
; CHECK-MAXBW-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-MAXBW: [[VECTOR_BODY]]:
; CHECK-MAXBW-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -2305,14 +2305,14 @@ define void @not_dotp_high_register_pressure(ptr %a, ptr %b, ptr %sum, i32 %n) #
; CHECK-INTERLEAVE1: [[VECTOR_PH]]:
; CHECK-INTERLEAVE1-NEXT: [[N_MOD_VF:%.*]] = and i64 [[WIDE_TRIP_COUNT]], 15
; CHECK-INTERLEAVE1-NEXT: [[N_VEC:%.*]] = sub i64 [[WIDE_TRIP_COUNT]], [[N_MOD_VF]]
-; CHECK-INTERLEAVE1-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX67_PROMOTED]], i64 0
-; CHECK-INTERLEAVE1-NEXT: [[TMP1:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX58_PROMOTED]], i64 0
-; CHECK-INTERLEAVE1-NEXT: [[TMP2:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX49_PROMOTED]], i64 0
-; CHECK-INTERLEAVE1-NEXT: [[TMP3:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX40_PROMOTED]], i64 0
-; CHECK-INTERLEAVE1-NEXT: [[TMP4:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX31_PROMOTED]], i64 0
-; CHECK-INTERLEAVE1-NEXT: [[TMP5:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[GEP_B_12_PROMOTED]], i64 0
-; CHECK-INTERLEAVE1-NEXT: [[TMP6:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX13_PROMOTED]], i64 0
-; CHECK-INTERLEAVE1-NEXT: [[TMP7:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[SUM_PROMOTED]], i64 0
+; CHECK-INTERLEAVE1-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX67_PROMOTED]], i32 0
+; CHECK-INTERLEAVE1-NEXT: [[TMP1:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX58_PROMOTED]], i32 0
+; CHECK-INTERLEAVE1-NEXT: [[TMP2:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX49_PROMOTED]], i32 0
+; CHECK-INTERLEAVE1-NEXT: [[TMP3:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX40_PROMOTED]], i32 0
+; CHECK-INTERLEAVE1-NEXT: [[TMP4:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX31_PROMOTED]], i32 0
+; CHECK-INTERLEAVE1-NEXT: [[TMP5:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[GEP_B_12_PROMOTED]], i32 0
+; CHECK-INTERLEAVE1-NEXT: [[TMP6:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX13_PROMOTED]], i32 0
+; CHECK-INTERLEAVE1-NEXT: [[TMP7:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[SUM_PROMOTED]], i32 0
; CHECK-INTERLEAVE1-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-INTERLEAVE1: [[VECTOR_BODY]]:
; CHECK-INTERLEAVE1-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -2405,14 +2405,14 @@ define void @not_dotp_high_register_pressure(ptr %a, ptr %b, ptr %sum, i32 %n) #
; CHECK-INTERLEAVED: [[VECTOR_PH]]:
; CHECK-INTERLEAVED-NEXT: [[N_MOD_VF:%.*]] = and i64 [[WIDE_TRIP_COUNT]], 15
; CHECK-INTERLEAVED-NEXT: [[N_VEC:%.*]] = sub i64 [[WIDE_TRIP_COUNT]], [[N_MOD_VF]]
-; CHECK-INTERLEAVED-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX67_PROMOTED]], i64 0
-; CHECK-INTERLEAVED-NEXT: [[TMP1:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX58_PROMOTED]], i64 0
-; CHECK-INTERLEAVED-NEXT: [[TMP2:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX49_PROMOTED]], i64 0
-; CHECK-INTERLEAVED-NEXT: [[TMP3:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX40_PROMOTED]], i64 0
-; CHECK-INTERLEAVED-NEXT: [[TMP4:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX31_PROMOTED]], i64 0
-; CHECK-INTERLEAVED-NEXT: [[TMP5:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[GEP_B_12_PROMOTED]], i64 0
-; CHECK-INTERLEAVED-NEXT: [[TMP6:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX13_PROMOTED]], i64 0
-; CHECK-INTERLEAVED-NEXT: [[TMP7:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[SUM_PROMOTED]], i64 0
+; CHECK-INTERLEAVED-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX67_PROMOTED]], i32 0
+; CHECK-INTERLEAVED-NEXT: [[TMP1:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX58_PROMOTED]], i32 0
+; CHECK-INTERLEAVED-NEXT: [[TMP2:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX49_PROMOTED]], i32 0
+; CHECK-INTERLEAVED-NEXT: [[TMP3:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX40_PROMOTED]], i32 0
+; CHECK-INTERLEAVED-NEXT: [[TMP4:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX31_PROMOTED]], i32 0
+; CHECK-INTERLEAVED-NEXT: [[TMP5:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[GEP_B_12_PROMOTED]], i32 0
+; CHECK-INTERLEAVED-NEXT: [[TMP6:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX13_PROMOTED]], i32 0
+; CHECK-INTERLEAVED-NEXT: [[TMP7:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[SUM_PROMOTED]], i32 0
; CHECK-INTERLEAVED-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-INTERLEAVED: [[VECTOR_BODY]]:
; CHECK-INTERLEAVED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -2505,14 +2505,14 @@ define void @not_dotp_high_register_pressure(ptr %a, ptr %b, ptr %sum, i32 %n) #
; CHECK-MAXBW: [[VECTOR_PH]]:
; CHECK-MAXBW-NEXT: [[N_MOD_VF:%.*]] = and i64 [[WIDE_TRIP_COUNT]], 15
; CHECK-MAXBW-NEXT: [[N_VEC:%.*]] = sub i64 [[WIDE_TRIP_COUNT]], [[N_MOD_VF]]
-; CHECK-MAXBW-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX67_PROMOTED]], i64 0
-; CHECK-MAXBW-NEXT: [[TMP1:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX58_PROMOTED]], i64 0
-; CHECK-MAXBW-NEXT: [[TMP2:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX49_PROMOTED]], i64 0
-; CHECK-MAXBW-NEXT: [[TMP3:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX40_PROMOTED]], i64 0
-; CHECK-MAXBW-NEXT: [[TMP4:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX31_PROMOTED]], i64 0
-; CHECK-MAXBW-NEXT: [[TMP5:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[GEP_B_12_PROMOTED]], i64 0
-; CHECK-MAXBW-NEXT: [[TMP6:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX13_PROMOTED]], i64 0
-; CHECK-MAXBW-NEXT: [[TMP7:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[SUM_PROMOTED]], i64 0
+; CHECK-MAXBW-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX67_PROMOTED]], i32 0
+; CHECK-MAXBW-NEXT: [[TMP1:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX58_PROMOTED]], i32 0
+; CHECK-MAXBW-NEXT: [[TMP2:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX49_PROMOTED]], i32 0
+; CHECK-MAXBW-NEXT: [[TMP3:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX40_PROMOTED]], i32 0
+; CHECK-MAXBW-NEXT: [[TMP4:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX31_PROMOTED]], i32 0
+; CHECK-MAXBW-NEXT: [[TMP5:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[GEP_B_12_PROMOTED]], i32 0
+; CHECK-MAXBW-NEXT: [[TMP6:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX13_PROMOTED]], i32 0
+; CHECK-MAXBW-NEXT: [[TMP7:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[SUM_PROMOTED]], i32 0
; CHECK-MAXBW-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-MAXBW: [[VECTOR_BODY]]:
; CHECK-MAXBW-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-fdot-product.ll b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-fdot-product.ll
index 583eef1caa1dc..da356e3a4eef7 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-fdot-product.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-fdot-product.ll
@@ -20,8 +20,8 @@ define float @fdot_f16_f32(ptr %a, ptr %b) #0 {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE5:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE5:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP4:%.*]] = getelementptr half, ptr [[A]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP7:%.*]] = getelementptr half, ptr [[TMP4]], i64 [[TMP6]]
; CHECK-NEXT: [[WIDE_LOAD:%.*]] = load <vscale x 8 x half>, ptr [[TMP4]], align 1
@@ -86,7 +86,7 @@ define double @fdot_f16_f64(ptr %a, ptr %b) #0 {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x double> [ insertelement (<vscale x 8 x double> splat (double -0.000000e+00), double 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP19:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x double> [ insertelement (<vscale x 8 x double> splat (double -0.000000e+00), double 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP19:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 8 x double> [ splat (double -0.000000e+00), %[[VECTOR_PH]] ], [ [[TMP20:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP4:%.*]] = getelementptr half, ptr [[A]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP7:%.*]] = getelementptr half, ptr [[TMP4]], i64 [[TMP6]]
@@ -152,7 +152,7 @@ define double @fdot_f32_f64(ptr %a, ptr %b) #0 {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x double> [ insertelement (<vscale x 4 x double> splat (double -0.000000e+00), double 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP17:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x double> [ insertelement (<vscale x 4 x double> splat (double -0.000000e+00), double 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP17:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x double> [ splat (double -0.000000e+00), %[[VECTOR_PH]] ], [ [[TMP16:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[VEC_PHI2:%.*]] = phi <vscale x 4 x double> [ splat (double -0.000000e+00), %[[VECTOR_PH]] ], [ [[TMP28:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[VEC_PHI3:%.*]] = phi <vscale x 4 x double> [ splat (double -0.000000e+00), %[[VECTOR_PH]] ], [ [[TMP29:%.*]], %[[VECTOR_BODY]] ]
@@ -240,8 +240,8 @@ define float @fdot_f16_f32_interleave2(ptr %a, ptr %b) #0 {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE5:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE5:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP5:%.*]] = getelementptr half, ptr [[A]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr half, ptr [[TMP5]], i64 [[TMP3]]
; CHECK-NEXT: [[WIDE_LOAD:%.*]] = load <vscale x 8 x half>, ptr [[TMP5]], align 1
@@ -296,7 +296,7 @@ define fp128 @not_fdot_f64_f128(ptr %a, ptr %b, fp128 %zero) #0 {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: br label %[[VECTOR_PH:.*]]
; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x fp128> splat (fp128 -0.000000e+00), fp128 [[ZERO]], i64 0
+; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x fp128> splat (fp128 -0.000000e+00), fp128 [[ZERO]], i32 0
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -444,7 +444,7 @@ define fp128 @not_fdot_f64_f128_nosve(ptr %a, ptr %b, fp128 %zero) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: br label %[[VECTOR_PH:.*]]
; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x fp128> splat (fp128 -0.000000e+00), fp128 [[ZERO]], i64 0
+; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x fp128> splat (fp128 -0.000000e+00), fp128 [[ZERO]], i32 0
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -559,7 +559,7 @@ define float @not_fdot_f32_f32(ptr %a, ptr %b) #0 {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP15:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP15:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP4:%.*]] = getelementptr float, ptr [[A]], i64 [[INDEX]]
; CHECK-NEXT: [[WIDE_LOAD2:%.*]] = load <vscale x 4 x float>, ptr [[TMP4]], align 1
; CHECK-NEXT: [[TMP8:%.*]] = getelementptr float, ptr [[B]], i64 [[INDEX]]
@@ -610,7 +610,7 @@ define double @not_fdot_different_types(ptr %a, ptr %b) #0 {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 8 x double> [ insertelement (<vscale x 8 x double> splat (double -0.000000e+00), double 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP19:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 8 x double> [ insertelement (<vscale x 8 x double> splat (double -0.000000e+00), double 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP19:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP4:%.*]] = getelementptr half, ptr [[A]], i64 [[INDEX]]
; CHECK-NEXT: [[WIDE_LOAD2:%.*]] = load <vscale x 8 x half>, ptr [[TMP4]], align 1
; CHECK-NEXT: [[TMP9:%.*]] = fpext <vscale x 8 x half> [[WIDE_LOAD2]] to <vscale x 8 x double>
@@ -672,7 +672,7 @@ define float @not_fdot_ext_outside_plan(ptr %a, half %b, i64 %n) #0 {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 8 x float> [ insertelement (<vscale x 8 x float> splat (float -0.000000e+00), float 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP13:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 8 x float> [ insertelement (<vscale x 8 x float> splat (float -0.000000e+00), float 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP13:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds half, ptr [[A]], i64 [[INDEX]]
; CHECK-NEXT: [[WIDE_LOAD2:%.*]] = load <vscale x 8 x half>, ptr [[TMP4]], align 2
; CHECK-NEXT: [[TMP9:%.*]] = fpext <vscale x 8 x half> [[WIDE_LOAD2]] to <vscale x 8 x float>
@@ -723,7 +723,7 @@ define float @fdot_f16_f32_nocontract(ptr %a, ptr %b) #0 {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 8 x float> [ insertelement (<vscale x 8 x float> splat (float -0.000000e+00), float 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP19:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 8 x float> [ insertelement (<vscale x 8 x float> splat (float -0.000000e+00), float 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP19:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP4:%.*]] = getelementptr half, ptr [[A]], i64 [[INDEX]]
; CHECK-NEXT: [[WIDE_LOAD2:%.*]] = load <vscale x 8 x half>, ptr [[TMP4]], align 1
; CHECK-NEXT: [[TMP9:%.*]] = fpext <vscale x 8 x half> [[WIDE_LOAD2]] to <vscale x 8 x float>
@@ -778,7 +778,7 @@ define float @extended_reduce_fadd(ptr %a) #0 {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE3:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE3:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP5:%.*]] = getelementptr half, ptr [[A]], i64 [[INDEX]]
; CHECK-NEXT: [[WIDE_LOAD2:%.*]] = load <vscale x 8 x half>, ptr [[TMP5]], align 1
; CHECK-NEXT: [[TMP8:%.*]] = fpext <vscale x 8 x half> [[WIDE_LOAD2]] to <vscale x 8 x float>
@@ -874,7 +874,7 @@ define float @not_extended_reduce_fadd_fpext_outside_loop(half %a, i64 %n) #0 {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP4:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP4:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP4]] = fadd reassoc contract <vscale x 4 x float> [[BROADCAST_SPLAT]], [[VEC_PHI]]
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], [[TMP3]]
; CHECK-NEXT: [[TMP5:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
@@ -1026,7 +1026,7 @@ define float @fadd_fsub_chain_f16_f32(ptr %a, ptr %b, ptr %c) #0 {
; CHECK-NEXT: br label %[[FOR_BODY:.*]]
; CHECK: [[FOR_BODY]]:
; CHECK-NEXT: [[IV:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[FOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE9:%.*]], %[[FOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE9:%.*]], %[[FOR_BODY]] ]
; CHECK-NEXT: [[GEP_A:%.*]] = getelementptr half, ptr [[A]], i64 [[IV]]
; CHECK-NEXT: [[WIDE_LOAD2:%.*]] = load <vscale x 8 x half>, ptr [[GEP_A]], align 1
; CHECK-NEXT: [[GEP_B:%.*]] = getelementptr half, ptr [[B]], i64 [[IV]]
@@ -1092,8 +1092,8 @@ define float @reduce_fsub_fadd_chain_without_mul(ptr %a, ptr noalias %b) #0 {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE6:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE7:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE6:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[PARTIAL_REDUCE7:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP4:%.*]] = getelementptr half, ptr [[A]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP5:%.*]] = getelementptr half, ptr [[TMP4]], i64 [[TMP2]]
; CHECK-NEXT: [[WIDE_LOAD:%.*]] = load <vscale x 8 x half>, ptr [[TMP4]], align 1
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-interleave.ll b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-interleave.ll
index a21e799fe02fe..46922757700ec 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-interleave.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-interleave.ll
@@ -13,7 +13,7 @@ define i32 @partial_reduce_with_non_constant_start_value(ptr %src, i32 %rdx.star
; IC2: [[VECTOR_PH]]:
; IC2-NEXT: [[N_MOD_VF:%.*]] = and i64 [[N]], 31
; IC2-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; IC2-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[RDX_START]], i64 0
+; IC2-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[RDX_START]], i32 0
; IC2-NEXT: br label %[[VECTOR_BODY:.*]]
; IC2: [[VECTOR_BODY]]:
; IC2-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -64,7 +64,7 @@ define i32 @partial_reduce_with_non_constant_start_value(ptr %src, i32 %rdx.star
; IC4: [[VECTOR_PH]]:
; IC4-NEXT: [[N_MOD_VF:%.*]] = and i64 [[N]], 63
; IC4-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; IC4-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[RDX_START]], i64 0
+; IC4-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[RDX_START]], i32 0
; IC4-NEXT: br label %[[VECTOR_BODY:.*]]
; IC4: [[VECTOR_BODY]]:
; IC4-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-sub-epilogue-vec.ll b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-sub-epilogue-vec.ll
index bfba32a781787..c6a7709c7379d 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-sub-epilogue-vec.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-sub-epilogue-vec.ll
@@ -43,7 +43,7 @@ define i32 @sub_reduction(i32 %startval, ptr %src1, ptr %src2) #0 {
; CHECK-EPI: [[VEC_EPILOG_PH]]:
; CHECK-EPI-NEXT: [[VEC_EPILOG_RESUME_VAL:%.*]] = phi i32 [ [[N_VEC]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-EPI-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP10]], %[[VEC_EPILOG_ITER_CHECK]] ], [ [[STARTVAL]], %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
-; CHECK-EPI-NEXT: [[TMP11:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-EPI-NEXT: [[TMP11:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-EPI-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK-EPI: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-EPI-NEXT: [[INDEX2:%.*]] = phi i32 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT6:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-sub.ll b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-sub.ll
index 83e50bb32136e..61f4e4098a8bf 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-sub.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-sub.ll
@@ -283,7 +283,7 @@ define float @fdotp_fsub(ptr %a, ptr %b, ptr %c) #2 {
; CHECK-INTERLEAVE1-NEXT: br label [[VECTOR_BODY:%.*]]
; CHECK-INTERLEAVE1: vector.body:
; CHECK-INTERLEAVE1-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
-; CHECK-INTERLEAVE1-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i64 0), [[VECTOR_PH]] ], [ [[PARTIAL_REDUCE3:%.*]], [[VECTOR_BODY]] ]
+; CHECK-INTERLEAVE1-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i32 0), [[VECTOR_PH]] ], [ [[PARTIAL_REDUCE3:%.*]], [[VECTOR_BODY]] ]
; CHECK-INTERLEAVE1-NEXT: [[TMP0:%.*]] = getelementptr half, ptr [[A]], i64 [[INDEX]]
; CHECK-INTERLEAVE1-NEXT: [[WIDE_LOAD:%.*]] = load <vscale x 8 x half>, ptr [[TMP0]], align 2
; CHECK-INTERLEAVE1-NEXT: [[TMP1:%.*]] = getelementptr half, ptr [[B]], i64 [[INDEX]]
@@ -318,8 +318,8 @@ define float @fdotp_fsub(ptr %a, ptr %b, ptr %c) #2 {
; CHECK-INTERLEAVED-NEXT: br label [[VECTOR_BODY:%.*]]
; CHECK-INTERLEAVED: vector.body:
; CHECK-INTERLEAVED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
-; CHECK-INTERLEAVED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i64 0), [[VECTOR_PH]] ], [ [[PARTIAL_REDUCE8:%.*]], [[VECTOR_BODY]] ]
-; CHECK-INTERLEAVED-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i64 0), [[VECTOR_PH]] ], [ [[PARTIAL_REDUCE9:%.*]], [[VECTOR_BODY]] ]
+; CHECK-INTERLEAVED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i32 0), [[VECTOR_PH]] ], [ [[PARTIAL_REDUCE8:%.*]], [[VECTOR_BODY]] ]
+; CHECK-INTERLEAVED-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i32 0), [[VECTOR_PH]] ], [ [[PARTIAL_REDUCE9:%.*]], [[VECTOR_BODY]] ]
; CHECK-INTERLEAVED-NEXT: [[TMP0:%.*]] = getelementptr half, ptr [[A]], i64 [[INDEX]]
; CHECK-INTERLEAVED-NEXT: [[TMP4:%.*]] = getelementptr half, ptr [[TMP0]], i64 [[TMP1]]
; CHECK-INTERLEAVED-NEXT: [[WIDE_LOAD:%.*]] = load <vscale x 8 x half>, ptr [[TMP0]], align 2
@@ -367,7 +367,7 @@ define float @fdotp_fsub(ptr %a, ptr %b, ptr %c) #2 {
; CHECK-MAXBW-NEXT: br label [[VECTOR_BODY:%.*]]
; CHECK-MAXBW: vector.body:
; CHECK-MAXBW-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
-; CHECK-MAXBW-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i64 0), [[VECTOR_PH]] ], [ [[PARTIAL_REDUCE3:%.*]], [[VECTOR_BODY]] ]
+; CHECK-MAXBW-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float -0.000000e+00, i32 0), [[VECTOR_PH]] ], [ [[PARTIAL_REDUCE3:%.*]], [[VECTOR_BODY]] ]
; CHECK-MAXBW-NEXT: [[TMP0:%.*]] = getelementptr half, ptr [[A]], i64 [[INDEX]]
; CHECK-MAXBW-NEXT: [[WIDE_LOAD:%.*]] = load <vscale x 8 x half>, ptr [[TMP0]], align 2
; CHECK-MAXBW-NEXT: [[TMP1:%.*]] = getelementptr half, ptr [[B]], i64 [[INDEX]]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-with-predicate-epilogue.ll b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-with-predicate-epilogue.ll
index b3c1be420215e..dd45d329ec7b4 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-with-predicate-epilogue.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-with-predicate-epilogue.ll
@@ -46,7 +46,7 @@ define i32 @pred_reduction(ptr %src, ptr %cond, i64 %N) #0 {
; CHECK-EPI-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP9]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-EPI-NEXT: [[N_MOD_VF2:%.*]] = and i64 [[N]], 3
; CHECK-EPI-NEXT: [[N_VEC3:%.*]] = sub i64 [[N]], [[N_MOD_VF2]]
-; CHECK-EPI-NEXT: [[TMP10:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-EPI-NEXT: [[TMP10:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-EPI-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK-EPI: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-EPI-NEXT: [[INDEX4:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT8:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
@@ -133,7 +133,7 @@ define i32 @pred_reduction(ptr %src, ptr %cond, i64 %N) #0 {
; CHECK-PARTIAL-RED-EPI-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP9]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-PARTIAL-RED-EPI-NEXT: [[N_MOD_VF2:%.*]] = and i64 [[N]], 7
; CHECK-PARTIAL-RED-EPI-NEXT: [[N_VEC3:%.*]] = sub i64 [[N]], [[N_MOD_VF2]]
-; CHECK-PARTIAL-RED-EPI-NEXT: [[TMP10:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-PARTIAL-RED-EPI-NEXT: [[TMP10:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-PARTIAL-RED-EPI-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK-PARTIAL-RED-EPI: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-PARTIAL-RED-EPI-NEXT: [[INDEX4:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT9:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce.ll b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce.ll
index 9e2fc09caf0ec..d5fb5cdfab47b 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce.ll
@@ -925,7 +925,7 @@ define i32 @add_of_zext_outside_loop(i32 %a, ptr noalias %b, i8 %c, i32 %d) #0 {
; CHECK-INTERLEAVE1-NEXT: [[N_MOD_VF:%.*]] = urem i32 [[TMP0]], [[TMP4]]
; CHECK-INTERLEAVE1-NEXT: [[N_VEC:%.*]] = sub i32 [[TMP0]], [[N_MOD_VF]]
; CHECK-INTERLEAVE1-NEXT: [[TMP1:%.*]] = add i32 [[D]], [[N_VEC]]
-; CHECK-INTERLEAVE1-NEXT: [[TMP9:%.*]] = insertelement <vscale x 16 x i32> zeroinitializer, i32 [[A]], i64 0
+; CHECK-INTERLEAVE1-NEXT: [[TMP9:%.*]] = insertelement <vscale x 16 x i32> zeroinitializer, i32 [[A]], i32 0
; CHECK-INTERLEAVE1-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <vscale x 16 x i32> poison, i32 [[CONV1]], i64 0
; CHECK-INTERLEAVE1-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <vscale x 16 x i32> [[BROADCAST_SPLATINSERT]], <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
; CHECK-INTERLEAVE1-NEXT: br label [[FOR_BODY:%.*]]
@@ -960,7 +960,7 @@ define i32 @add_of_zext_outside_loop(i32 %a, ptr noalias %b, i8 %c, i32 %d) #0 {
; CHECK-INTERLEAVED-NEXT: [[N_MOD_VF:%.*]] = urem i32 [[TMP2]], [[TMP4]]
; CHECK-INTERLEAVED-NEXT: [[N_VEC:%.*]] = sub i32 [[TMP2]], [[N_MOD_VF]]
; CHECK-INTERLEAVED-NEXT: [[TMP1:%.*]] = add i32 [[D]], [[N_VEC]]
-; CHECK-INTERLEAVED-NEXT: [[TMP6:%.*]] = insertelement <vscale x 16 x i32> zeroinitializer, i32 [[A]], i64 0
+; CHECK-INTERLEAVED-NEXT: [[TMP6:%.*]] = insertelement <vscale x 16 x i32> zeroinitializer, i32 [[A]], i32 0
; CHECK-INTERLEAVED-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <vscale x 16 x i32> poison, i32 [[CONV1]], i64 0
; CHECK-INTERLEAVED-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <vscale x 16 x i32> [[BROADCAST_SPLATINSERT]], <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
; CHECK-INTERLEAVED-NEXT: br label [[VECTOR_BODY:%.*]]
@@ -1000,7 +1000,7 @@ define i32 @add_of_zext_outside_loop(i32 %a, ptr noalias %b, i8 %c, i32 %d) #0 {
; CHECK-MAXBW-NEXT: [[N_MOD_VF:%.*]] = urem i32 [[TMP0]], [[TMP4]]
; CHECK-MAXBW-NEXT: [[N_VEC:%.*]] = sub i32 [[TMP0]], [[N_MOD_VF]]
; CHECK-MAXBW-NEXT: [[TMP7:%.*]] = add i32 [[D]], [[N_VEC]]
-; CHECK-MAXBW-NEXT: [[TMP8:%.*]] = insertelement <vscale x 16 x i32> zeroinitializer, i32 [[A]], i64 0
+; CHECK-MAXBW-NEXT: [[TMP8:%.*]] = insertelement <vscale x 16 x i32> zeroinitializer, i32 [[A]], i32 0
; CHECK-MAXBW-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <vscale x 16 x i32> poison, i32 [[CONV1]], i64 0
; CHECK-MAXBW-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <vscale x 16 x i32> [[BROADCAST_SPLATINSERT]], <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
; CHECK-MAXBW-NEXT: br label [[FOR_BODY:%.*]]
@@ -1053,7 +1053,7 @@ define i32 @add_of_loop_invariant_zext(i32 %a, ptr %b, i8 %c, i32 %d) #0 {
; CHECK-INTERLEAVE1-NEXT: [[N_MOD_VF:%.*]] = urem i32 [[TMP0]], [[TMP9]]
; CHECK-INTERLEAVE1-NEXT: [[N_VEC:%.*]] = sub i32 [[TMP0]], [[N_MOD_VF]]
; CHECK-INTERLEAVE1-NEXT: [[TMP1:%.*]] = add i32 [[D]], [[N_VEC]]
-; CHECK-INTERLEAVE1-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[A]], i64 0
+; CHECK-INTERLEAVE1-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[A]], i32 0
; CHECK-INTERLEAVE1-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[C]], i64 0
; CHECK-INTERLEAVE1-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[BROADCAST_SPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
; CHECK-INTERLEAVE1-NEXT: br label [[FOR_BODY:%.*]]
@@ -1088,7 +1088,7 @@ define i32 @add_of_loop_invariant_zext(i32 %a, ptr %b, i8 %c, i32 %d) #0 {
; CHECK-INTERLEAVED-NEXT: [[N_MOD_VF:%.*]] = urem i32 [[TMP2]], [[TMP12]]
; CHECK-INTERLEAVED-NEXT: [[N_VEC:%.*]] = sub i32 [[TMP2]], [[N_MOD_VF]]
; CHECK-INTERLEAVED-NEXT: [[TMP1:%.*]] = add i32 [[D]], [[N_VEC]]
-; CHECK-INTERLEAVED-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[A]], i64 0
+; CHECK-INTERLEAVED-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[A]], i32 0
; CHECK-INTERLEAVED-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[C]], i64 0
; CHECK-INTERLEAVED-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[BROADCAST_SPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
; CHECK-INTERLEAVED-NEXT: br label [[VECTOR_BODY:%.*]]
@@ -1128,7 +1128,7 @@ define i32 @add_of_loop_invariant_zext(i32 %a, ptr %b, i8 %c, i32 %d) #0 {
; CHECK-MAXBW-NEXT: [[N_MOD_VF:%.*]] = urem i32 [[TMP0]], [[TMP4]]
; CHECK-MAXBW-NEXT: [[N_VEC:%.*]] = sub i32 [[TMP0]], [[N_MOD_VF]]
; CHECK-MAXBW-NEXT: [[TMP7:%.*]] = add i32 [[D]], [[N_VEC]]
-; CHECK-MAXBW-NEXT: [[TMP8:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[A]], i64 0
+; CHECK-MAXBW-NEXT: [[TMP8:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[A]], i32 0
; CHECK-MAXBW-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[C]], i64 0
; CHECK-MAXBW-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[BROADCAST_SPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
; CHECK-MAXBW-NEXT: br label [[FOR_BODY:%.*]]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/pr60831-sve-inv-store-crash.ll b/llvm/test/Transforms/LoopVectorize/AArch64/pr60831-sve-inv-store-crash.ll
index 4fc67222708ee..980d501954124 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/pr60831-sve-inv-store-crash.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/pr60831-sve-inv-store-crash.ll
@@ -380,22 +380,22 @@ define void @test_loop2(i64 %n, ptr %dst) {
; CHECK-NEXT: [[TMP29:%.*]] = sub nsw i64 [[N]], [[TMP13]]
; CHECK-NEXT: [[TMP30:%.*]] = sub nsw i64 [[N]], [[TMP14]]
; CHECK-NEXT: [[TMP31:%.*]] = sub nsw i64 [[N]], [[TMP15]]
-; CHECK-NEXT: [[TMP32:%.*]] = insertelement <16 x i64> poison, i64 [[TMP16]], i64 0
-; CHECK-NEXT: [[TMP33:%.*]] = insertelement <16 x i64> [[TMP32]], i64 [[TMP17]], i64 1
-; CHECK-NEXT: [[TMP34:%.*]] = insertelement <16 x i64> [[TMP33]], i64 [[TMP18]], i64 2
-; CHECK-NEXT: [[TMP35:%.*]] = insertelement <16 x i64> [[TMP34]], i64 [[TMP19]], i64 3
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <16 x i64> [[TMP35]], i64 [[TMP20]], i64 4
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <16 x i64> [[TMP36]], i64 [[TMP21]], i64 5
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <16 x i64> [[TMP37]], i64 [[TMP22]], i64 6
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <16 x i64> [[TMP38]], i64 [[TMP23]], i64 7
-; CHECK-NEXT: [[TMP40:%.*]] = insertelement <16 x i64> [[TMP39]], i64 [[TMP24]], i64 8
-; CHECK-NEXT: [[TMP41:%.*]] = insertelement <16 x i64> [[TMP40]], i64 [[TMP25]], i64 9
-; CHECK-NEXT: [[TMP42:%.*]] = insertelement <16 x i64> [[TMP41]], i64 [[TMP26]], i64 10
-; CHECK-NEXT: [[TMP43:%.*]] = insertelement <16 x i64> [[TMP42]], i64 [[TMP27]], i64 11
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <16 x i64> [[TMP43]], i64 [[TMP28]], i64 12
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <16 x i64> [[TMP44]], i64 [[TMP29]], i64 13
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <16 x i64> [[TMP45]], i64 [[TMP30]], i64 14
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <16 x i64> [[TMP46]], i64 [[TMP31]], i64 15
+; CHECK-NEXT: [[TMP32:%.*]] = insertelement <16 x i64> poison, i64 [[TMP16]], i32 0
+; CHECK-NEXT: [[TMP33:%.*]] = insertelement <16 x i64> [[TMP32]], i64 [[TMP17]], i32 1
+; CHECK-NEXT: [[TMP34:%.*]] = insertelement <16 x i64> [[TMP33]], i64 [[TMP18]], i32 2
+; CHECK-NEXT: [[TMP35:%.*]] = insertelement <16 x i64> [[TMP34]], i64 [[TMP19]], i32 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <16 x i64> [[TMP35]], i64 [[TMP20]], i32 4
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <16 x i64> [[TMP36]], i64 [[TMP21]], i32 5
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <16 x i64> [[TMP37]], i64 [[TMP22]], i32 6
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <16 x i64> [[TMP38]], i64 [[TMP23]], i32 7
+; CHECK-NEXT: [[TMP40:%.*]] = insertelement <16 x i64> [[TMP39]], i64 [[TMP24]], i32 8
+; CHECK-NEXT: [[TMP41:%.*]] = insertelement <16 x i64> [[TMP40]], i64 [[TMP25]], i32 9
+; CHECK-NEXT: [[TMP42:%.*]] = insertelement <16 x i64> [[TMP41]], i64 [[TMP26]], i32 10
+; CHECK-NEXT: [[TMP43:%.*]] = insertelement <16 x i64> [[TMP42]], i64 [[TMP27]], i32 11
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <16 x i64> [[TMP43]], i64 [[TMP28]], i32 12
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <16 x i64> [[TMP44]], i64 [[TMP29]], i32 13
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <16 x i64> [[TMP45]], i64 [[TMP30]], i32 14
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <16 x i64> [[TMP46]], i64 [[TMP31]], i32 15
; CHECK-NEXT: [[TMP48:%.*]] = trunc <16 x i64> [[TMP47]] to <16 x i8>
; CHECK-NEXT: [[TMP49:%.*]] = add i64 [[INDEX]], [[TMP16]]
; CHECK-NEXT: [[TMP50:%.*]] = getelementptr i8, ptr [[DST:%.*]], i64 [[TMP49]]
@@ -428,14 +428,14 @@ define void @test_loop2(i64 %n, ptr %dst) {
; CHECK-NEXT: [[TMP66:%.*]] = sub nsw i64 [[N]], [[TMP58]]
; CHECK-NEXT: [[TMP67:%.*]] = sub nsw i64 [[N]], [[TMP59]]
; CHECK-NEXT: [[TMP68:%.*]] = sub nsw i64 [[N]], [[TMP60]]
-; CHECK-NEXT: [[TMP69:%.*]] = insertelement <8 x i64> poison, i64 [[TMP61]], i64 0
-; CHECK-NEXT: [[TMP70:%.*]] = insertelement <8 x i64> [[TMP69]], i64 [[TMP62]], i64 1
-; CHECK-NEXT: [[TMP71:%.*]] = insertelement <8 x i64> [[TMP70]], i64 [[TMP63]], i64 2
-; CHECK-NEXT: [[TMP72:%.*]] = insertelement <8 x i64> [[TMP71]], i64 [[TMP64]], i64 3
-; CHECK-NEXT: [[TMP73:%.*]] = insertelement <8 x i64> [[TMP72]], i64 [[TMP65]], i64 4
-; CHECK-NEXT: [[TMP74:%.*]] = insertelement <8 x i64> [[TMP73]], i64 [[TMP66]], i64 5
-; CHECK-NEXT: [[TMP75:%.*]] = insertelement <8 x i64> [[TMP74]], i64 [[TMP67]], i64 6
-; CHECK-NEXT: [[TMP76:%.*]] = insertelement <8 x i64> [[TMP75]], i64 [[TMP68]], i64 7
+; CHECK-NEXT: [[TMP69:%.*]] = insertelement <8 x i64> poison, i64 [[TMP61]], i32 0
+; CHECK-NEXT: [[TMP70:%.*]] = insertelement <8 x i64> [[TMP69]], i64 [[TMP62]], i32 1
+; CHECK-NEXT: [[TMP71:%.*]] = insertelement <8 x i64> [[TMP70]], i64 [[TMP63]], i32 2
+; CHECK-NEXT: [[TMP72:%.*]] = insertelement <8 x i64> [[TMP71]], i64 [[TMP64]], i32 3
+; CHECK-NEXT: [[TMP73:%.*]] = insertelement <8 x i64> [[TMP72]], i64 [[TMP65]], i32 4
+; CHECK-NEXT: [[TMP74:%.*]] = insertelement <8 x i64> [[TMP73]], i64 [[TMP66]], i32 5
+; CHECK-NEXT: [[TMP75:%.*]] = insertelement <8 x i64> [[TMP74]], i64 [[TMP67]], i32 6
+; CHECK-NEXT: [[TMP76:%.*]] = insertelement <8 x i64> [[TMP75]], i64 [[TMP68]], i32 7
; CHECK-NEXT: [[TMP77:%.*]] = trunc <8 x i64> [[TMP76]] to <8 x i8>
; CHECK-NEXT: [[TMP78:%.*]] = add i64 [[INDEX2]], [[TMP61]]
; CHECK-NEXT: [[TMP79:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP78]]
@@ -518,22 +518,22 @@ define void @test_loop2(i64 %n, ptr %dst) {
; IC2-NEXT: [[TMP45:%.*]] = sub nsw i64 [[N]], [[TMP13]]
; IC2-NEXT: [[TMP46:%.*]] = sub nsw i64 [[N]], [[TMP14]]
; IC2-NEXT: [[TMP47:%.*]] = sub nsw i64 [[N]], [[TMP15]]
-; IC2-NEXT: [[TMP48:%.*]] = insertelement <16 x i64> poison, i64 [[TMP32]], i64 0
-; IC2-NEXT: [[TMP49:%.*]] = insertelement <16 x i64> [[TMP48]], i64 [[TMP33]], i64 1
-; IC2-NEXT: [[TMP50:%.*]] = insertelement <16 x i64> [[TMP49]], i64 [[TMP34]], i64 2
-; IC2-NEXT: [[TMP51:%.*]] = insertelement <16 x i64> [[TMP50]], i64 [[TMP35]], i64 3
-; IC2-NEXT: [[TMP52:%.*]] = insertelement <16 x i64> [[TMP51]], i64 [[TMP36]], i64 4
-; IC2-NEXT: [[TMP53:%.*]] = insertelement <16 x i64> [[TMP52]], i64 [[TMP37]], i64 5
-; IC2-NEXT: [[TMP54:%.*]] = insertelement <16 x i64> [[TMP53]], i64 [[TMP38]], i64 6
-; IC2-NEXT: [[TMP55:%.*]] = insertelement <16 x i64> [[TMP54]], i64 [[TMP39]], i64 7
-; IC2-NEXT: [[TMP56:%.*]] = insertelement <16 x i64> [[TMP55]], i64 [[TMP40]], i64 8
-; IC2-NEXT: [[TMP57:%.*]] = insertelement <16 x i64> [[TMP56]], i64 [[TMP41]], i64 9
-; IC2-NEXT: [[TMP58:%.*]] = insertelement <16 x i64> [[TMP57]], i64 [[TMP42]], i64 10
-; IC2-NEXT: [[TMP59:%.*]] = insertelement <16 x i64> [[TMP58]], i64 [[TMP43]], i64 11
-; IC2-NEXT: [[TMP60:%.*]] = insertelement <16 x i64> [[TMP59]], i64 [[TMP44]], i64 12
-; IC2-NEXT: [[TMP61:%.*]] = insertelement <16 x i64> [[TMP60]], i64 [[TMP45]], i64 13
-; IC2-NEXT: [[TMP62:%.*]] = insertelement <16 x i64> [[TMP61]], i64 [[TMP46]], i64 14
-; IC2-NEXT: [[TMP63:%.*]] = insertelement <16 x i64> [[TMP62]], i64 [[TMP47]], i64 15
+; IC2-NEXT: [[TMP48:%.*]] = insertelement <16 x i64> poison, i64 [[TMP32]], i32 0
+; IC2-NEXT: [[TMP49:%.*]] = insertelement <16 x i64> [[TMP48]], i64 [[TMP33]], i32 1
+; IC2-NEXT: [[TMP50:%.*]] = insertelement <16 x i64> [[TMP49]], i64 [[TMP34]], i32 2
+; IC2-NEXT: [[TMP51:%.*]] = insertelement <16 x i64> [[TMP50]], i64 [[TMP35]], i32 3
+; IC2-NEXT: [[TMP52:%.*]] = insertelement <16 x i64> [[TMP51]], i64 [[TMP36]], i32 4
+; IC2-NEXT: [[TMP53:%.*]] = insertelement <16 x i64> [[TMP52]], i64 [[TMP37]], i32 5
+; IC2-NEXT: [[TMP54:%.*]] = insertelement <16 x i64> [[TMP53]], i64 [[TMP38]], i32 6
+; IC2-NEXT: [[TMP55:%.*]] = insertelement <16 x i64> [[TMP54]], i64 [[TMP39]], i32 7
+; IC2-NEXT: [[TMP56:%.*]] = insertelement <16 x i64> [[TMP55]], i64 [[TMP40]], i32 8
+; IC2-NEXT: [[TMP57:%.*]] = insertelement <16 x i64> [[TMP56]], i64 [[TMP41]], i32 9
+; IC2-NEXT: [[TMP58:%.*]] = insertelement <16 x i64> [[TMP57]], i64 [[TMP42]], i32 10
+; IC2-NEXT: [[TMP59:%.*]] = insertelement <16 x i64> [[TMP58]], i64 [[TMP43]], i32 11
+; IC2-NEXT: [[TMP60:%.*]] = insertelement <16 x i64> [[TMP59]], i64 [[TMP44]], i32 12
+; IC2-NEXT: [[TMP61:%.*]] = insertelement <16 x i64> [[TMP60]], i64 [[TMP45]], i32 13
+; IC2-NEXT: [[TMP62:%.*]] = insertelement <16 x i64> [[TMP61]], i64 [[TMP46]], i32 14
+; IC2-NEXT: [[TMP63:%.*]] = insertelement <16 x i64> [[TMP62]], i64 [[TMP47]], i32 15
; IC2-NEXT: [[TMP64:%.*]] = sub nsw i64 [[N]], [[TMP16]]
; IC2-NEXT: [[TMP65:%.*]] = sub nsw i64 [[N]], [[TMP17]]
; IC2-NEXT: [[TMP66:%.*]] = sub nsw i64 [[N]], [[TMP18]]
@@ -550,22 +550,22 @@ define void @test_loop2(i64 %n, ptr %dst) {
; IC2-NEXT: [[TMP77:%.*]] = sub nsw i64 [[N]], [[TMP29]]
; IC2-NEXT: [[TMP78:%.*]] = sub nsw i64 [[N]], [[TMP30]]
; IC2-NEXT: [[TMP79:%.*]] = sub nsw i64 [[N]], [[TMP31]]
-; IC2-NEXT: [[TMP80:%.*]] = insertelement <16 x i64> poison, i64 [[TMP64]], i64 0
-; IC2-NEXT: [[TMP81:%.*]] = insertelement <16 x i64> [[TMP80]], i64 [[TMP65]], i64 1
-; IC2-NEXT: [[TMP82:%.*]] = insertelement <16 x i64> [[TMP81]], i64 [[TMP66]], i64 2
-; IC2-NEXT: [[TMP83:%.*]] = insertelement <16 x i64> [[TMP82]], i64 [[TMP67]], i64 3
-; IC2-NEXT: [[TMP84:%.*]] = insertelement <16 x i64> [[TMP83]], i64 [[TMP68]], i64 4
-; IC2-NEXT: [[TMP85:%.*]] = insertelement <16 x i64> [[TMP84]], i64 [[TMP69]], i64 5
-; IC2-NEXT: [[TMP86:%.*]] = insertelement <16 x i64> [[TMP85]], i64 [[TMP70]], i64 6
-; IC2-NEXT: [[TMP87:%.*]] = insertelement <16 x i64> [[TMP86]], i64 [[TMP71]], i64 7
-; IC2-NEXT: [[TMP88:%.*]] = insertelement <16 x i64> [[TMP87]], i64 [[TMP72]], i64 8
-; IC2-NEXT: [[TMP89:%.*]] = insertelement <16 x i64> [[TMP88]], i64 [[TMP73]], i64 9
-; IC2-NEXT: [[TMP90:%.*]] = insertelement <16 x i64> [[TMP89]], i64 [[TMP74]], i64 10
-; IC2-NEXT: [[TMP91:%.*]] = insertelement <16 x i64> [[TMP90]], i64 [[TMP75]], i64 11
-; IC2-NEXT: [[TMP92:%.*]] = insertelement <16 x i64> [[TMP91]], i64 [[TMP76]], i64 12
-; IC2-NEXT: [[TMP93:%.*]] = insertelement <16 x i64> [[TMP92]], i64 [[TMP77]], i64 13
-; IC2-NEXT: [[TMP94:%.*]] = insertelement <16 x i64> [[TMP93]], i64 [[TMP78]], i64 14
-; IC2-NEXT: [[TMP95:%.*]] = insertelement <16 x i64> [[TMP94]], i64 [[TMP79]], i64 15
+; IC2-NEXT: [[TMP80:%.*]] = insertelement <16 x i64> poison, i64 [[TMP64]], i32 0
+; IC2-NEXT: [[TMP81:%.*]] = insertelement <16 x i64> [[TMP80]], i64 [[TMP65]], i32 1
+; IC2-NEXT: [[TMP82:%.*]] = insertelement <16 x i64> [[TMP81]], i64 [[TMP66]], i32 2
+; IC2-NEXT: [[TMP83:%.*]] = insertelement <16 x i64> [[TMP82]], i64 [[TMP67]], i32 3
+; IC2-NEXT: [[TMP84:%.*]] = insertelement <16 x i64> [[TMP83]], i64 [[TMP68]], i32 4
+; IC2-NEXT: [[TMP85:%.*]] = insertelement <16 x i64> [[TMP84]], i64 [[TMP69]], i32 5
+; IC2-NEXT: [[TMP86:%.*]] = insertelement <16 x i64> [[TMP85]], i64 [[TMP70]], i32 6
+; IC2-NEXT: [[TMP87:%.*]] = insertelement <16 x i64> [[TMP86]], i64 [[TMP71]], i32 7
+; IC2-NEXT: [[TMP88:%.*]] = insertelement <16 x i64> [[TMP87]], i64 [[TMP72]], i32 8
+; IC2-NEXT: [[TMP89:%.*]] = insertelement <16 x i64> [[TMP88]], i64 [[TMP73]], i32 9
+; IC2-NEXT: [[TMP90:%.*]] = insertelement <16 x i64> [[TMP89]], i64 [[TMP74]], i32 10
+; IC2-NEXT: [[TMP91:%.*]] = insertelement <16 x i64> [[TMP90]], i64 [[TMP75]], i32 11
+; IC2-NEXT: [[TMP92:%.*]] = insertelement <16 x i64> [[TMP91]], i64 [[TMP76]], i32 12
+; IC2-NEXT: [[TMP93:%.*]] = insertelement <16 x i64> [[TMP92]], i64 [[TMP77]], i32 13
+; IC2-NEXT: [[TMP94:%.*]] = insertelement <16 x i64> [[TMP93]], i64 [[TMP78]], i32 14
+; IC2-NEXT: [[TMP95:%.*]] = insertelement <16 x i64> [[TMP94]], i64 [[TMP79]], i32 15
; IC2-NEXT: [[TMP96:%.*]] = trunc <16 x i64> [[TMP63]] to <16 x i8>
; IC2-NEXT: [[TMP97:%.*]] = trunc <16 x i64> [[TMP95]] to <16 x i8>
; IC2-NEXT: [[TMP98:%.*]] = add i64 [[INDEX]], [[TMP32]]
@@ -603,14 +603,14 @@ define void @test_loop2(i64 %n, ptr %dst) {
; IC2-NEXT: [[TMP118:%.*]] = sub nsw i64 [[N]], [[TMP110]]
; IC2-NEXT: [[TMP119:%.*]] = sub nsw i64 [[N]], [[TMP111]]
; IC2-NEXT: [[TMP120:%.*]] = sub nsw i64 [[N]], [[TMP112]]
-; IC2-NEXT: [[TMP121:%.*]] = insertelement <8 x i64> poison, i64 [[TMP113]], i64 0
-; IC2-NEXT: [[TMP122:%.*]] = insertelement <8 x i64> [[TMP121]], i64 [[TMP114]], i64 1
-; IC2-NEXT: [[TMP123:%.*]] = insertelement <8 x i64> [[TMP122]], i64 [[TMP115]], i64 2
-; IC2-NEXT: [[TMP124:%.*]] = insertelement <8 x i64> [[TMP123]], i64 [[TMP116]], i64 3
-; IC2-NEXT: [[TMP125:%.*]] = insertelement <8 x i64> [[TMP124]], i64 [[TMP117]], i64 4
-; IC2-NEXT: [[TMP126:%.*]] = insertelement <8 x i64> [[TMP125]], i64 [[TMP118]], i64 5
-; IC2-NEXT: [[TMP127:%.*]] = insertelement <8 x i64> [[TMP126]], i64 [[TMP119]], i64 6
-; IC2-NEXT: [[TMP128:%.*]] = insertelement <8 x i64> [[TMP127]], i64 [[TMP120]], i64 7
+; IC2-NEXT: [[TMP121:%.*]] = insertelement <8 x i64> poison, i64 [[TMP113]], i32 0
+; IC2-NEXT: [[TMP122:%.*]] = insertelement <8 x i64> [[TMP121]], i64 [[TMP114]], i32 1
+; IC2-NEXT: [[TMP123:%.*]] = insertelement <8 x i64> [[TMP122]], i64 [[TMP115]], i32 2
+; IC2-NEXT: [[TMP124:%.*]] = insertelement <8 x i64> [[TMP123]], i64 [[TMP116]], i32 3
+; IC2-NEXT: [[TMP125:%.*]] = insertelement <8 x i64> [[TMP124]], i64 [[TMP117]], i32 4
+; IC2-NEXT: [[TMP126:%.*]] = insertelement <8 x i64> [[TMP125]], i64 [[TMP118]], i32 5
+; IC2-NEXT: [[TMP127:%.*]] = insertelement <8 x i64> [[TMP126]], i64 [[TMP119]], i32 6
+; IC2-NEXT: [[TMP128:%.*]] = insertelement <8 x i64> [[TMP127]], i64 [[TMP120]], i32 7
; IC2-NEXT: [[TMP129:%.*]] = trunc <8 x i64> [[TMP128]] to <8 x i8>
; IC2-NEXT: [[TMP130:%.*]] = add i64 [[INDEX1]], [[TMP113]]
; IC2-NEXT: [[TMP131:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP130]]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/reduction-cost.ll b/llvm/test/Transforms/LoopVectorize/AArch64/reduction-cost.ll
index 32eeca5c60b88..b34460a427cdb 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/reduction-cost.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/reduction-cost.ll
@@ -36,7 +36,7 @@ define i64 @reduction(i64 %arg) #0 {
; CHECK: [[VEC_EPILOG_PH]]:
; CHECK-NEXT: [[VEC_EPILOG_RESUME_VAL:%.*]] = phi i64 [ 96, %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_PH]] ]
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP7]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_PH]] ]
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[SCALAR_PH:.*]]
; CHECK: [[SCALAR_PH]]:
; CHECK-NEXT: [[INDEX10:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT13:%.*]], %[[SCALAR_PH]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/reduction-recurrence-costs-sve.ll b/llvm/test/Transforms/LoopVectorize/AArch64/reduction-recurrence-costs-sve.ll
index a77306354358c..0e2626538c876 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/reduction-recurrence-costs-sve.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/reduction-recurrence-costs-sve.ll
@@ -44,10 +44,10 @@ define i32 @chained_recurrences(i32 %x, i64 %y, ptr %src.1, i32 %z, ptr %src.2)
; DEFAULT-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP14]], align 4
; DEFAULT-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP16]], align 4
; DEFAULT-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP18]], align 4
-; DEFAULT-NEXT: [[TMP23:%.*]] = insertelement <4 x i32> poison, i32 [[TMP19]], i64 0
-; DEFAULT-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> [[TMP23]], i32 [[TMP20]], i64 1
-; DEFAULT-NEXT: [[TMP25:%.*]] = insertelement <4 x i32> [[TMP24]], i32 [[TMP21]], i64 2
-; DEFAULT-NEXT: [[TMP26:%.*]] = insertelement <4 x i32> [[TMP25]], i32 [[TMP22]], i64 3
+; DEFAULT-NEXT: [[TMP23:%.*]] = insertelement <4 x i32> poison, i32 [[TMP19]], i32 0
+; DEFAULT-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> [[TMP23]], i32 [[TMP20]], i32 1
+; DEFAULT-NEXT: [[TMP25:%.*]] = insertelement <4 x i32> [[TMP24]], i32 [[TMP21]], i32 2
+; DEFAULT-NEXT: [[TMP26:%.*]] = insertelement <4 x i32> [[TMP25]], i32 [[TMP22]], i32 3
; DEFAULT-NEXT: br label %[[LOOP:.*]]
; DEFAULT: [[LOOP]]:
; DEFAULT-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[LOOP]] ]
@@ -111,34 +111,34 @@ define i32 @chained_recurrences(i32 %x, i64 %y, ptr %src.1, i32 %z, ptr %src.2)
; DEFAULT-NEXT: [[TMP78:%.*]] = load i32, ptr [[TMP56]], align 4
; DEFAULT-NEXT: [[TMP79:%.*]] = load i32, ptr [[TMP58]], align 4
; DEFAULT-NEXT: [[TMP80:%.*]] = load i32, ptr [[TMP60]], align 4
-; DEFAULT-NEXT: [[TMP81:%.*]] = insertelement <4 x i32> poison, i32 [[TMP77]], i64 0
-; DEFAULT-NEXT: [[TMP82:%.*]] = insertelement <4 x i32> [[TMP81]], i32 [[TMP78]], i64 1
-; DEFAULT-NEXT: [[TMP83:%.*]] = insertelement <4 x i32> [[TMP82]], i32 [[TMP79]], i64 2
-; DEFAULT-NEXT: [[TMP84:%.*]] = insertelement <4 x i32> [[TMP83]], i32 [[TMP80]], i64 3
+; DEFAULT-NEXT: [[TMP81:%.*]] = insertelement <4 x i32> poison, i32 [[TMP77]], i32 0
+; DEFAULT-NEXT: [[TMP82:%.*]] = insertelement <4 x i32> [[TMP81]], i32 [[TMP78]], i32 1
+; DEFAULT-NEXT: [[TMP83:%.*]] = insertelement <4 x i32> [[TMP82]], i32 [[TMP79]], i32 2
+; DEFAULT-NEXT: [[TMP84:%.*]] = insertelement <4 x i32> [[TMP83]], i32 [[TMP80]], i32 3
; DEFAULT-NEXT: [[TMP85:%.*]] = load i32, ptr [[TMP62]], align 4
; DEFAULT-NEXT: [[TMP86:%.*]] = load i32, ptr [[TMP64]], align 4
; DEFAULT-NEXT: [[TMP87:%.*]] = load i32, ptr [[TMP66]], align 4
; DEFAULT-NEXT: [[TMP88:%.*]] = load i32, ptr [[TMP121]], align 4
-; DEFAULT-NEXT: [[TMP89:%.*]] = insertelement <4 x i32> poison, i32 [[TMP85]], i64 0
-; DEFAULT-NEXT: [[TMP90:%.*]] = insertelement <4 x i32> [[TMP89]], i32 [[TMP86]], i64 1
-; DEFAULT-NEXT: [[TMP91:%.*]] = insertelement <4 x i32> [[TMP90]], i32 [[TMP87]], i64 2
-; DEFAULT-NEXT: [[TMP92:%.*]] = insertelement <4 x i32> [[TMP91]], i32 [[TMP88]], i64 3
+; DEFAULT-NEXT: [[TMP89:%.*]] = insertelement <4 x i32> poison, i32 [[TMP85]], i32 0
+; DEFAULT-NEXT: [[TMP90:%.*]] = insertelement <4 x i32> [[TMP89]], i32 [[TMP86]], i32 1
+; DEFAULT-NEXT: [[TMP91:%.*]] = insertelement <4 x i32> [[TMP90]], i32 [[TMP87]], i32 2
+; DEFAULT-NEXT: [[TMP92:%.*]] = insertelement <4 x i32> [[TMP91]], i32 [[TMP88]], i32 3
; DEFAULT-NEXT: [[TMP93:%.*]] = load i32, ptr [[TMP123]], align 4
; DEFAULT-NEXT: [[TMP94:%.*]] = load i32, ptr [[TMP125]], align 4
; DEFAULT-NEXT: [[TMP95:%.*]] = load i32, ptr [[TMP127]], align 4
; DEFAULT-NEXT: [[TMP96:%.*]] = load i32, ptr [[TMP76]], align 4
-; DEFAULT-NEXT: [[TMP97:%.*]] = insertelement <4 x i32> poison, i32 [[TMP93]], i64 0
-; DEFAULT-NEXT: [[TMP98:%.*]] = insertelement <4 x i32> [[TMP97]], i32 [[TMP94]], i64 1
-; DEFAULT-NEXT: [[TMP99:%.*]] = insertelement <4 x i32> [[TMP98]], i32 [[TMP95]], i64 2
-; DEFAULT-NEXT: [[TMP100:%.*]] = insertelement <4 x i32> [[TMP99]], i32 [[TMP96]], i64 3
+; DEFAULT-NEXT: [[TMP97:%.*]] = insertelement <4 x i32> poison, i32 [[TMP93]], i32 0
+; DEFAULT-NEXT: [[TMP98:%.*]] = insertelement <4 x i32> [[TMP97]], i32 [[TMP94]], i32 1
+; DEFAULT-NEXT: [[TMP99:%.*]] = insertelement <4 x i32> [[TMP98]], i32 [[TMP95]], i32 2
+; DEFAULT-NEXT: [[TMP100:%.*]] = insertelement <4 x i32> [[TMP99]], i32 [[TMP96]], i32 3
; DEFAULT-NEXT: [[TMP101:%.*]] = load i32, ptr [[TMP123]], align 4
; DEFAULT-NEXT: [[TMP102:%.*]] = load i32, ptr [[TMP125]], align 4
; DEFAULT-NEXT: [[TMP103:%.*]] = load i32, ptr [[TMP127]], align 4
; DEFAULT-NEXT: [[TMP104:%.*]] = load i32, ptr [[TMP76]], align 4
-; DEFAULT-NEXT: [[TMP105:%.*]] = insertelement <4 x i32> poison, i32 [[TMP101]], i64 0
-; DEFAULT-NEXT: [[TMP106:%.*]] = insertelement <4 x i32> [[TMP105]], i32 [[TMP102]], i64 1
-; DEFAULT-NEXT: [[TMP107:%.*]] = insertelement <4 x i32> [[TMP106]], i32 [[TMP103]], i64 2
-; DEFAULT-NEXT: [[TMP108:%.*]] = insertelement <4 x i32> [[TMP107]], i32 [[TMP104]], i64 3
+; DEFAULT-NEXT: [[TMP105:%.*]] = insertelement <4 x i32> poison, i32 [[TMP101]], i32 0
+; DEFAULT-NEXT: [[TMP106:%.*]] = insertelement <4 x i32> [[TMP105]], i32 [[TMP102]], i32 1
+; DEFAULT-NEXT: [[TMP107:%.*]] = insertelement <4 x i32> [[TMP106]], i32 [[TMP103]], i32 2
+; DEFAULT-NEXT: [[TMP108:%.*]] = insertelement <4 x i32> [[TMP107]], i32 [[TMP104]], i32 3
; DEFAULT-NEXT: [[TMP109:%.*]] = or <4 x i32> [[TMP26]], [[VEC_PHI]]
; DEFAULT-NEXT: [[TMP110:%.*]] = or <4 x i32> [[TMP26]], [[VEC_PHI4]]
; DEFAULT-NEXT: [[TMP111:%.*]] = or <4 x i32> [[TMP26]], [[VEC_PHI5]]
@@ -236,10 +236,10 @@ define i32 @chained_recurrences(i32 %x, i64 %y, ptr %src.1, i32 %z, ptr %src.2)
; VSCALEFORTUNING2-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP14]], align 4
; VSCALEFORTUNING2-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP120]], align 4
; VSCALEFORTUNING2-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP18]], align 4
-; VSCALEFORTUNING2-NEXT: [[TMP23:%.*]] = insertelement <4 x i32> poison, i32 [[TMP19]], i64 0
-; VSCALEFORTUNING2-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> [[TMP23]], i32 [[TMP20]], i64 1
-; VSCALEFORTUNING2-NEXT: [[TMP25:%.*]] = insertelement <4 x i32> [[TMP24]], i32 [[TMP21]], i64 2
-; VSCALEFORTUNING2-NEXT: [[TMP26:%.*]] = insertelement <4 x i32> [[TMP25]], i32 [[TMP22]], i64 3
+; VSCALEFORTUNING2-NEXT: [[TMP23:%.*]] = insertelement <4 x i32> poison, i32 [[TMP19]], i32 0
+; VSCALEFORTUNING2-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> [[TMP23]], i32 [[TMP20]], i32 1
+; VSCALEFORTUNING2-NEXT: [[TMP25:%.*]] = insertelement <4 x i32> [[TMP24]], i32 [[TMP21]], i32 2
+; VSCALEFORTUNING2-NEXT: [[TMP26:%.*]] = insertelement <4 x i32> [[TMP25]], i32 [[TMP22]], i32 3
; VSCALEFORTUNING2-NEXT: br label %[[VECTOR_BODY:.*]]
; VSCALEFORTUNING2: [[VECTOR_BODY]]:
; VSCALEFORTUNING2-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -303,34 +303,34 @@ define i32 @chained_recurrences(i32 %x, i64 %y, ptr %src.1, i32 %z, ptr %src.2)
; VSCALEFORTUNING2-NEXT: [[TMP78:%.*]] = load i32, ptr [[TMP123]], align 4
; VSCALEFORTUNING2-NEXT: [[TMP79:%.*]] = load i32, ptr [[TMP125]], align 4
; VSCALEFORTUNING2-NEXT: [[TMP80:%.*]] = load i32, ptr [[TMP127]], align 4
-; VSCALEFORTUNING2-NEXT: [[TMP81:%.*]] = insertelement <4 x i32> poison, i32 [[TMP77]], i64 0
-; VSCALEFORTUNING2-NEXT: [[TMP82:%.*]] = insertelement <4 x i32> [[TMP81]], i32 [[TMP78]], i64 1
-; VSCALEFORTUNING2-NEXT: [[TMP83:%.*]] = insertelement <4 x i32> [[TMP82]], i32 [[TMP79]], i64 2
-; VSCALEFORTUNING2-NEXT: [[TMP84:%.*]] = insertelement <4 x i32> [[TMP83]], i32 [[TMP80]], i64 3
+; VSCALEFORTUNING2-NEXT: [[TMP81:%.*]] = insertelement <4 x i32> poison, i32 [[TMP77]], i32 0
+; VSCALEFORTUNING2-NEXT: [[TMP82:%.*]] = insertelement <4 x i32> [[TMP81]], i32 [[TMP78]], i32 1
+; VSCALEFORTUNING2-NEXT: [[TMP83:%.*]] = insertelement <4 x i32> [[TMP82]], i32 [[TMP79]], i32 2
+; VSCALEFORTUNING2-NEXT: [[TMP84:%.*]] = insertelement <4 x i32> [[TMP83]], i32 [[TMP80]], i32 3
; VSCALEFORTUNING2-NEXT: [[TMP85:%.*]] = load i32, ptr [[TMP129]], align 4
; VSCALEFORTUNING2-NEXT: [[TMP86:%.*]] = load i32, ptr [[TMP131]], align 4
; VSCALEFORTUNING2-NEXT: [[TMP87:%.*]] = load i32, ptr [[TMP66]], align 4
; VSCALEFORTUNING2-NEXT: [[TMP88:%.*]] = load i32, ptr [[TMP68]], align 4
-; VSCALEFORTUNING2-NEXT: [[TMP89:%.*]] = insertelement <4 x i32> poison, i32 [[TMP85]], i64 0
-; VSCALEFORTUNING2-NEXT: [[TMP90:%.*]] = insertelement <4 x i32> [[TMP89]], i32 [[TMP86]], i64 1
-; VSCALEFORTUNING2-NEXT: [[TMP91:%.*]] = insertelement <4 x i32> [[TMP90]], i32 [[TMP87]], i64 2
-; VSCALEFORTUNING2-NEXT: [[TMP92:%.*]] = insertelement <4 x i32> [[TMP91]], i32 [[TMP88]], i64 3
+; VSCALEFORTUNING2-NEXT: [[TMP89:%.*]] = insertelement <4 x i32> poison, i32 [[TMP85]], i32 0
+; VSCALEFORTUNING2-NEXT: [[TMP90:%.*]] = insertelement <4 x i32> [[TMP89]], i32 [[TMP86]], i32 1
+; VSCALEFORTUNING2-NEXT: [[TMP91:%.*]] = insertelement <4 x i32> [[TMP90]], i32 [[TMP87]], i32 2
+; VSCALEFORTUNING2-NEXT: [[TMP92:%.*]] = insertelement <4 x i32> [[TMP91]], i32 [[TMP88]], i32 3
; VSCALEFORTUNING2-NEXT: [[TMP93:%.*]] = load i32, ptr [[TMP70]], align 4
; VSCALEFORTUNING2-NEXT: [[TMP94:%.*]] = load i32, ptr [[TMP72]], align 4
; VSCALEFORTUNING2-NEXT: [[TMP95:%.*]] = load i32, ptr [[TMP74]], align 4
; VSCALEFORTUNING2-NEXT: [[TMP96:%.*]] = load i32, ptr [[TMP76]], align 4
-; VSCALEFORTUNING2-NEXT: [[TMP97:%.*]] = insertelement <4 x i32> poison, i32 [[TMP93]], i64 0
-; VSCALEFORTUNING2-NEXT: [[TMP98:%.*]] = insertelement <4 x i32> [[TMP97]], i32 [[TMP94]], i64 1
-; VSCALEFORTUNING2-NEXT: [[TMP99:%.*]] = insertelement <4 x i32> [[TMP98]], i32 [[TMP95]], i64 2
-; VSCALEFORTUNING2-NEXT: [[TMP100:%.*]] = insertelement <4 x i32> [[TMP99]], i32 [[TMP96]], i64 3
+; VSCALEFORTUNING2-NEXT: [[TMP97:%.*]] = insertelement <4 x i32> poison, i32 [[TMP93]], i32 0
+; VSCALEFORTUNING2-NEXT: [[TMP98:%.*]] = insertelement <4 x i32> [[TMP97]], i32 [[TMP94]], i32 1
+; VSCALEFORTUNING2-NEXT: [[TMP99:%.*]] = insertelement <4 x i32> [[TMP98]], i32 [[TMP95]], i32 2
+; VSCALEFORTUNING2-NEXT: [[TMP100:%.*]] = insertelement <4 x i32> [[TMP99]], i32 [[TMP96]], i32 3
; VSCALEFORTUNING2-NEXT: [[TMP101:%.*]] = load i32, ptr [[TMP70]], align 4
; VSCALEFORTUNING2-NEXT: [[TMP102:%.*]] = load i32, ptr [[TMP72]], align 4
; VSCALEFORTUNING2-NEXT: [[TMP103:%.*]] = load i32, ptr [[TMP74]], align 4
; VSCALEFORTUNING2-NEXT: [[TMP104:%.*]] = load i32, ptr [[TMP76]], align 4
-; VSCALEFORTUNING2-NEXT: [[TMP105:%.*]] = insertelement <4 x i32> poison, i32 [[TMP101]], i64 0
-; VSCALEFORTUNING2-NEXT: [[TMP106:%.*]] = insertelement <4 x i32> [[TMP105]], i32 [[TMP102]], i64 1
-; VSCALEFORTUNING2-NEXT: [[TMP107:%.*]] = insertelement <4 x i32> [[TMP106]], i32 [[TMP103]], i64 2
-; VSCALEFORTUNING2-NEXT: [[TMP108:%.*]] = insertelement <4 x i32> [[TMP107]], i32 [[TMP104]], i64 3
+; VSCALEFORTUNING2-NEXT: [[TMP105:%.*]] = insertelement <4 x i32> poison, i32 [[TMP101]], i32 0
+; VSCALEFORTUNING2-NEXT: [[TMP106:%.*]] = insertelement <4 x i32> [[TMP105]], i32 [[TMP102]], i32 1
+; VSCALEFORTUNING2-NEXT: [[TMP107:%.*]] = insertelement <4 x i32> [[TMP106]], i32 [[TMP103]], i32 2
+; VSCALEFORTUNING2-NEXT: [[TMP108:%.*]] = insertelement <4 x i32> [[TMP107]], i32 [[TMP104]], i32 3
; VSCALEFORTUNING2-NEXT: [[TMP109:%.*]] = or <4 x i32> [[TMP26]], [[VEC_PHI]]
; VSCALEFORTUNING2-NEXT: [[TMP110:%.*]] = or <4 x i32> [[TMP26]], [[VEC_PHI4]]
; VSCALEFORTUNING2-NEXT: [[TMP111:%.*]] = or <4 x i32> [[TMP26]], [[VEC_PHI5]]
@@ -564,7 +564,7 @@ define i16 @reduce_udiv(ptr %src, i16 %x, i64 %N) #0 {
; DEFAULT-NEXT: [[TMP25:%.*]] = shl nuw i64 [[TMP24]], 2
; DEFAULT-NEXT: [[N_MOD_VF10:%.*]] = urem i64 [[TMP0]], [[TMP25]]
; DEFAULT-NEXT: [[N_VEC11:%.*]] = sub i64 [[TMP0]], [[N_MOD_VF10]]
-; DEFAULT-NEXT: [[TMP26:%.*]] = insertelement <vscale x 4 x i16> zeroinitializer, i16 [[BC_MERGE_RDX]], i64 0
+; DEFAULT-NEXT: [[TMP26:%.*]] = insertelement <vscale x 4 x i16> zeroinitializer, i16 [[BC_MERGE_RDX]], i32 0
; DEFAULT-NEXT: [[BROADCAST_SPLATINSERT12:%.*]] = insertelement <vscale x 4 x i16> poison, i16 [[X]], i64 0
; DEFAULT-NEXT: [[BROADCAST_SPLAT13:%.*]] = shufflevector <vscale x 4 x i16> [[BROADCAST_SPLATINSERT12]], <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
; DEFAULT-NEXT: br label %[[LOOP:.*]]
@@ -666,7 +666,7 @@ define i16 @reduce_udiv(ptr %src, i16 %x, i64 %N) #0 {
; VSCALEFORTUNING2-NEXT: [[TMP20:%.*]] = shl nuw i64 [[TMP19]], 2
; VSCALEFORTUNING2-NEXT: [[N_MOD_VF4:%.*]] = urem i64 [[TMP0]], [[TMP20]]
; VSCALEFORTUNING2-NEXT: [[N_VEC5:%.*]] = sub i64 [[TMP0]], [[N_MOD_VF4]]
-; VSCALEFORTUNING2-NEXT: [[TMP26:%.*]] = insertelement <vscale x 4 x i16> zeroinitializer, i16 [[BC_MERGE_RDX]], i64 0
+; VSCALEFORTUNING2-NEXT: [[TMP26:%.*]] = insertelement <vscale x 4 x i16> zeroinitializer, i16 [[BC_MERGE_RDX]], i32 0
; VSCALEFORTUNING2-NEXT: [[BROADCAST_SPLATINSERT6:%.*]] = insertelement <vscale x 4 x i16> poison, i16 [[X]], i64 0
; VSCALEFORTUNING2-NEXT: [[BROADCAST_SPLAT7:%.*]] = shufflevector <vscale x 4 x i16> [[BROADCAST_SPLATINSERT6]], <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
; VSCALEFORTUNING2-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/reduction-small-size.ll b/llvm/test/Transforms/LoopVectorize/AArch64/reduction-small-size.ll
index cac42867e313d..7d7bb893694df 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/reduction-small-size.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/reduction-small-size.ll
@@ -59,7 +59,7 @@ define i8 @reduction_i8(ptr nocapture readonly %a, ptr nocapture readonly %b, i3
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP7]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF3:%.*]] = and i64 [[TMP0]], 3
; CHECK-NEXT: [[N_VEC4:%.*]] = sub i64 [[TMP0]], [[N_MOD_VF3]]
-; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX5:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT9:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
@@ -254,7 +254,7 @@ define i16 @reduction_i16_2(ptr nocapture readonly %a, ptr nocapture readonly %b
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP9]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF3:%.*]] = and i64 [[TMP0]], 3
; CHECK-NEXT: [[N_VEC4:%.*]] = sub i64 [[TMP0]], [[N_MOD_VF3]]
-; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX5:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT9:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/replicating-load-store-costs-apple.ll b/llvm/test/Transforms/LoopVectorize/AArch64/replicating-load-store-costs-apple.ll
index c62f6ef0acc4d..a9dddc62631f7 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/replicating-load-store-costs-apple.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/replicating-load-store-costs-apple.ll
@@ -586,8 +586,8 @@ define double @test_scalarization_cost_for_load_of_address(ptr %src.0, ptr %src.
; CHECK-NEXT: [[TMP15:%.*]] = load ptr, ptr [[TMP13]], align 8
; CHECK-NEXT: [[LV:%.*]] = load double, ptr [[L_P_2]], align 8
; CHECK-NEXT: [[TMP17:%.*]] = load double, ptr [[TMP15]], align 8
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <2 x double> poison, double [[LV]], i64 0
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <2 x double> [[TMP18]], double [[TMP17]], i64 1
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <2 x double> poison, double [[LV]], i32 0
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <2 x double> [[TMP18]], double [[TMP17]], i32 1
; CHECK-NEXT: [[TMP20:%.*]] = fmul <2 x double> [[TMP9]], [[TMP19]]
; CHECK-NEXT: [[TMP21:%.*]] = call double @llvm.vector.reduce.fadd.v2f64(double 3.000000e+00, <2 x double> [[TMP20]])
; CHECK-NEXT: br label %[[MIDDLE_BLOCK:.*]]
@@ -729,22 +729,22 @@ define i32 @test_or_reduction_with_stride_2(i32 %scale, ptr %src) {
; CHECK-NEXT: [[TMP70:%.*]] = load i8, ptr [[TMP33]], align 1
; CHECK-NEXT: [[TMP71:%.*]] = load i8, ptr [[TMP34]], align 1
; CHECK-NEXT: [[TMP72:%.*]] = load i8, ptr [[TMP35]], align 1
-; CHECK-NEXT: [[TMP48:%.*]] = insertelement <16 x i8> poison, i8 [[TMP44]], i64 0
-; CHECK-NEXT: [[TMP49:%.*]] = insertelement <16 x i8> [[TMP48]], i8 [[TMP45]], i64 1
-; CHECK-NEXT: [[TMP50:%.*]] = insertelement <16 x i8> [[TMP49]], i8 [[TMP46]], i64 2
-; CHECK-NEXT: [[TMP51:%.*]] = insertelement <16 x i8> [[TMP50]], i8 [[TMP47]], i64 3
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <16 x i8> [[TMP51]], i8 [[TMP36]], i64 4
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <16 x i8> [[TMP52]], i8 [[TMP37]], i64 5
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <16 x i8> [[TMP53]], i8 [[TMP38]], i64 6
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <16 x i8> [[TMP54]], i8 [[TMP39]], i64 7
-; CHECK-NEXT: [[TMP56:%.*]] = insertelement <16 x i8> [[TMP55]], i8 [[TMP40]], i64 8
-; CHECK-NEXT: [[TMP57:%.*]] = insertelement <16 x i8> [[TMP56]], i8 [[TMP41]], i64 9
-; CHECK-NEXT: [[TMP58:%.*]] = insertelement <16 x i8> [[TMP57]], i8 [[TMP42]], i64 10
-; CHECK-NEXT: [[TMP59:%.*]] = insertelement <16 x i8> [[TMP58]], i8 [[TMP43]], i64 11
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <16 x i8> [[TMP59]], i8 [[TMP69]], i64 12
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <16 x i8> [[TMP60]], i8 [[TMP70]], i64 13
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <16 x i8> [[TMP61]], i8 [[TMP71]], i64 14
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <16 x i8> [[TMP62]], i8 [[TMP72]], i64 15
+; CHECK-NEXT: [[TMP48:%.*]] = insertelement <16 x i8> poison, i8 [[TMP44]], i32 0
+; CHECK-NEXT: [[TMP49:%.*]] = insertelement <16 x i8> [[TMP48]], i8 [[TMP45]], i32 1
+; CHECK-NEXT: [[TMP50:%.*]] = insertelement <16 x i8> [[TMP49]], i8 [[TMP46]], i32 2
+; CHECK-NEXT: [[TMP51:%.*]] = insertelement <16 x i8> [[TMP50]], i8 [[TMP47]], i32 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <16 x i8> [[TMP51]], i8 [[TMP36]], i32 4
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <16 x i8> [[TMP52]], i8 [[TMP37]], i32 5
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <16 x i8> [[TMP53]], i8 [[TMP38]], i32 6
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <16 x i8> [[TMP54]], i8 [[TMP39]], i32 7
+; CHECK-NEXT: [[TMP56:%.*]] = insertelement <16 x i8> [[TMP55]], i8 [[TMP40]], i32 8
+; CHECK-NEXT: [[TMP57:%.*]] = insertelement <16 x i8> [[TMP56]], i8 [[TMP41]], i32 9
+; CHECK-NEXT: [[TMP58:%.*]] = insertelement <16 x i8> [[TMP57]], i8 [[TMP42]], i32 10
+; CHECK-NEXT: [[TMP59:%.*]] = insertelement <16 x i8> [[TMP58]], i8 [[TMP43]], i32 11
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <16 x i8> [[TMP59]], i8 [[TMP69]], i32 12
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <16 x i8> [[TMP60]], i8 [[TMP70]], i32 13
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <16 x i8> [[TMP61]], i8 [[TMP71]], i32 14
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <16 x i8> [[TMP62]], i8 [[TMP72]], i32 15
; CHECK-NEXT: [[TMP64:%.*]] = sext <16 x i8> [[TMP63]] to <16 x i32>
; CHECK-NEXT: [[TMP65:%.*]] = mul <16 x i32> [[BROADCAST_SPLAT]], [[TMP64]]
; CHECK-NEXT: [[TMP66]] = or <16 x i32> [[TMP65]], [[VEC_PHI]]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/replicating-load-store-costs.ll b/llvm/test/Transforms/LoopVectorize/AArch64/replicating-load-store-costs.ll
index 325c3ffe4eac7..674d54d592f37 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/replicating-load-store-costs.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/replicating-load-store-costs.ll
@@ -582,8 +582,8 @@ define double @test_scalarization_cost_for_load_of_address(ptr %src.0, ptr %src.
; CHECK-NEXT: [[TMP10:%.*]] = load ptr, ptr [[TMP8]], align 8
; CHECK-NEXT: [[LV:%.*]] = load double, ptr [[TMP13]], align 8
; CHECK-NEXT: [[TMP17:%.*]] = load double, ptr [[TMP10]], align 8
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <2 x double> poison, double [[LV]], i64 0
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <2 x double> [[TMP18]], double [[TMP17]], i64 1
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <2 x double> poison, double [[LV]], i32 0
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <2 x double> [[TMP18]], double [[TMP17]], i32 1
; CHECK-NEXT: [[TMP20:%.*]] = fmul <2 x double> [[TMP9]], [[TMP19]]
; CHECK-NEXT: [[TMP21:%.*]] = call double @llvm.vector.reduce.fadd.v2f64(double 3.000000e+00, <2 x double> [[TMP20]])
; CHECK-NEXT: br label %[[MIDDLE_BLOCK:.*]]
@@ -725,22 +725,22 @@ define i32 @test_or_reduction_with_stride_2(i32 %scale, ptr %src) {
; CHECK-NEXT: [[TMP45:%.*]] = load i8, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP46:%.*]] = load i8, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP47:%.*]] = load i8, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP48:%.*]] = insertelement <16 x i8> poison, i8 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP49:%.*]] = insertelement <16 x i8> [[TMP48]], i8 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP50:%.*]] = insertelement <16 x i8> [[TMP49]], i8 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP51:%.*]] = insertelement <16 x i8> [[TMP50]], i8 [[TMP35]], i64 3
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <16 x i8> [[TMP51]], i8 [[TMP36]], i64 4
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <16 x i8> [[TMP52]], i8 [[TMP37]], i64 5
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <16 x i8> [[TMP53]], i8 [[TMP38]], i64 6
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <16 x i8> [[TMP54]], i8 [[TMP39]], i64 7
-; CHECK-NEXT: [[TMP56:%.*]] = insertelement <16 x i8> [[TMP55]], i8 [[TMP40]], i64 8
-; CHECK-NEXT: [[TMP57:%.*]] = insertelement <16 x i8> [[TMP56]], i8 [[TMP41]], i64 9
-; CHECK-NEXT: [[TMP58:%.*]] = insertelement <16 x i8> [[TMP57]], i8 [[TMP42]], i64 10
-; CHECK-NEXT: [[TMP59:%.*]] = insertelement <16 x i8> [[TMP58]], i8 [[TMP43]], i64 11
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <16 x i8> [[TMP59]], i8 [[TMP44]], i64 12
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <16 x i8> [[TMP60]], i8 [[TMP45]], i64 13
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <16 x i8> [[TMP61]], i8 [[TMP46]], i64 14
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <16 x i8> [[TMP62]], i8 [[TMP47]], i64 15
+; CHECK-NEXT: [[TMP48:%.*]] = insertelement <16 x i8> poison, i8 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP49:%.*]] = insertelement <16 x i8> [[TMP48]], i8 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP50:%.*]] = insertelement <16 x i8> [[TMP49]], i8 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP51:%.*]] = insertelement <16 x i8> [[TMP50]], i8 [[TMP35]], i32 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <16 x i8> [[TMP51]], i8 [[TMP36]], i32 4
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <16 x i8> [[TMP52]], i8 [[TMP37]], i32 5
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <16 x i8> [[TMP53]], i8 [[TMP38]], i32 6
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <16 x i8> [[TMP54]], i8 [[TMP39]], i32 7
+; CHECK-NEXT: [[TMP56:%.*]] = insertelement <16 x i8> [[TMP55]], i8 [[TMP40]], i32 8
+; CHECK-NEXT: [[TMP57:%.*]] = insertelement <16 x i8> [[TMP56]], i8 [[TMP41]], i32 9
+; CHECK-NEXT: [[TMP58:%.*]] = insertelement <16 x i8> [[TMP57]], i8 [[TMP42]], i32 10
+; CHECK-NEXT: [[TMP59:%.*]] = insertelement <16 x i8> [[TMP58]], i8 [[TMP43]], i32 11
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <16 x i8> [[TMP59]], i8 [[TMP44]], i32 12
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <16 x i8> [[TMP60]], i8 [[TMP45]], i32 13
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <16 x i8> [[TMP61]], i8 [[TMP46]], i32 14
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <16 x i8> [[TMP62]], i8 [[TMP47]], i32 15
; CHECK-NEXT: [[TMP64:%.*]] = sext <16 x i8> [[TMP63]] to <16 x i32>
; CHECK-NEXT: [[TMP65:%.*]] = mul <16 x i32> [[BROADCAST_SPLAT]], [[TMP64]]
; CHECK-NEXT: [[TMP66]] = or <16 x i32> [[TMP65]], [[VEC_PHI]]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/scalable-strict-fadd.ll b/llvm/test/Transforms/LoopVectorize/AArch64/scalable-strict-fadd.ll
index 18a555cbc3735..cd5eb39c68666 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/scalable-strict-fadd.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/scalable-strict-fadd.ll
@@ -44,7 +44,7 @@ define float @fadd_strict(ptr noalias nocapture readonly %a, i64 %n) #0 {
; CHECK-UNORDERED-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-UNORDERED: [[VECTOR_BODY]]:
; CHECK-UNORDERED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-UNORDERED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x float> [ insertelement (<vscale x 8 x float> splat (float -0.000000e+00), float 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP4:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-UNORDERED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x float> [ insertelement (<vscale x 8 x float> splat (float -0.000000e+00), float 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP4:%.*]], %[[VECTOR_BODY]] ]
; CHECK-UNORDERED-NEXT: [[TMP3:%.*]] = getelementptr inbounds float, ptr [[A]], i64 [[INDEX]]
; CHECK-UNORDERED-NEXT: [[WIDE_LOAD:%.*]] = load <vscale x 8 x float>, ptr [[TMP3]], align 4
; CHECK-UNORDERED-NEXT: [[TMP4]] = fadd <vscale x 8 x float> [[WIDE_LOAD]], [[VEC_PHI]]
@@ -194,7 +194,7 @@ define float @fadd_strict_unroll(ptr noalias nocapture readonly %a, i64 %n) #0 {
; CHECK-UNORDERED-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-UNORDERED: [[VECTOR_BODY]]:
; CHECK-UNORDERED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-UNORDERED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x float> [ insertelement (<vscale x 8 x float> splat (float -0.000000e+00), float 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP10:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-UNORDERED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x float> [ insertelement (<vscale x 8 x float> splat (float -0.000000e+00), float 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP10:%.*]], %[[VECTOR_BODY]] ]
; CHECK-UNORDERED-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 8 x float> [ splat (float -0.000000e+00), %[[VECTOR_PH]] ], [ [[TMP11:%.*]], %[[VECTOR_BODY]] ]
; CHECK-UNORDERED-NEXT: [[VEC_PHI2:%.*]] = phi <vscale x 8 x float> [ splat (float -0.000000e+00), %[[VECTOR_PH]] ], [ [[TMP12:%.*]], %[[VECTOR_BODY]] ]
; CHECK-UNORDERED-NEXT: [[VEC_PHI3:%.*]] = phi <vscale x 8 x float> [ splat (float -0.000000e+00), %[[VECTOR_PH]] ], [ [[TMP13:%.*]], %[[VECTOR_BODY]] ]
@@ -414,8 +414,8 @@ define void @fadd_strict_interleave(ptr noalias nocapture readonly %a, ptr noali
; CHECK-UNORDERED-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[TMP2]], [[TMP5]]
; CHECK-UNORDERED-NEXT: [[N_VEC:%.*]] = sub i64 [[TMP2]], [[N_MOD_VF]]
; CHECK-UNORDERED-NEXT: [[TMP6:%.*]] = shl i64 [[N_VEC]], 1
-; CHECK-UNORDERED-NEXT: [[TMP7:%.*]] = insertelement <vscale x 4 x float> splat (float -0.000000e+00), float [[A2]], i64 0
-; CHECK-UNORDERED-NEXT: [[TMP8:%.*]] = insertelement <vscale x 4 x float> splat (float -0.000000e+00), float [[A1]], i64 0
+; CHECK-UNORDERED-NEXT: [[TMP7:%.*]] = insertelement <vscale x 4 x float> splat (float -0.000000e+00), float [[A2]], i32 0
+; CHECK-UNORDERED-NEXT: [[TMP8:%.*]] = insertelement <vscale x 4 x float> splat (float -0.000000e+00), float [[A1]], i32 0
; CHECK-UNORDERED-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-UNORDERED: [[VECTOR_BODY]]:
; CHECK-UNORDERED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -648,7 +648,7 @@ define float @fadd_of_sum(ptr noalias nocapture readonly %a, ptr noalias nocaptu
; CHECK-UNORDERED-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-UNORDERED: [[VECTOR_BODY]]:
; CHECK-UNORDERED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-UNORDERED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP7:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-UNORDERED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP7:%.*]], %[[VECTOR_BODY]] ]
; CHECK-UNORDERED-NEXT: [[TMP4:%.*]] = getelementptr inbounds float, ptr [[A]], i64 [[INDEX]]
; CHECK-UNORDERED-NEXT: [[WIDE_LOAD:%.*]] = load <vscale x 4 x float>, ptr [[TMP4]], align 4
; CHECK-UNORDERED-NEXT: [[TMP5:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[INDEX]]
@@ -846,7 +846,7 @@ define float @fadd_conditional(ptr noalias nocapture readonly %a, ptr noalias no
; CHECK-UNORDERED-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-UNORDERED: [[VECTOR_BODY]]:
; CHECK-UNORDERED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-UNORDERED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 1.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP6:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-UNORDERED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 1.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP6:%.*]], %[[VECTOR_BODY]] ]
; CHECK-UNORDERED-NEXT: [[TMP3:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[INDEX]]
; CHECK-UNORDERED-NEXT: [[WIDE_LOAD:%.*]] = load <vscale x 4 x float>, ptr [[TMP3]], align 4
; CHECK-UNORDERED-NEXT: [[TMP4:%.*]] = fcmp une <vscale x 4 x float> [[WIDE_LOAD]], zeroinitializer
@@ -1039,7 +1039,7 @@ define float @fadd_multiple(ptr noalias nocapture %a, ptr noalias nocapture %b,
; CHECK-UNORDERED-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-UNORDERED: [[VECTOR_BODY]]:
; CHECK-UNORDERED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-UNORDERED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x float> [ insertelement (<vscale x 8 x float> splat (float -0.000000e+00), float -0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP6:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-UNORDERED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x float> [ insertelement (<vscale x 8 x float> splat (float -0.000000e+00), float -0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP6:%.*]], %[[VECTOR_BODY]] ]
; CHECK-UNORDERED-NEXT: [[TMP3:%.*]] = getelementptr inbounds float, ptr [[A]], i64 [[INDEX]]
; CHECK-UNORDERED-NEXT: [[WIDE_LOAD:%.*]] = load <vscale x 8 x float>, ptr [[TMP3]], align 4
; CHECK-UNORDERED-NEXT: [[TMP4:%.*]] = fadd <vscale x 8 x float> [[VEC_PHI]], [[WIDE_LOAD]]
@@ -1174,7 +1174,7 @@ define float @fmuladd_strict(ptr %a, ptr %b, i64 %n) #0 {
; CHECK-UNORDERED-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-UNORDERED: [[VECTOR_BODY]]:
; CHECK-UNORDERED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-UNORDERED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x float> [ insertelement (<vscale x 8 x float> splat (float -0.000000e+00), float 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP14:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-UNORDERED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x float> [ insertelement (<vscale x 8 x float> splat (float -0.000000e+00), float 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP14:%.*]], %[[VECTOR_BODY]] ]
; CHECK-UNORDERED-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 8 x float> [ splat (float -0.000000e+00), %[[VECTOR_PH]] ], [ [[TMP15:%.*]], %[[VECTOR_BODY]] ]
; CHECK-UNORDERED-NEXT: [[VEC_PHI2:%.*]] = phi <vscale x 8 x float> [ splat (float -0.000000e+00), %[[VECTOR_PH]] ], [ [[TMP16:%.*]], %[[VECTOR_BODY]] ]
; CHECK-UNORDERED-NEXT: [[VEC_PHI3:%.*]] = phi <vscale x 8 x float> [ splat (float -0.000000e+00), %[[VECTOR_PH]] ], [ [[TMP17:%.*]], %[[VECTOR_BODY]] ]
@@ -1421,7 +1421,7 @@ define float @fmuladd_strict_fmf(ptr %a, ptr %b, i64 %n) #0 {
; CHECK-UNORDERED-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-UNORDERED: [[VECTOR_BODY]]:
; CHECK-UNORDERED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-UNORDERED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x float> [ insertelement (<vscale x 8 x float> splat (float -0.000000e+00), float 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP14:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-UNORDERED-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x float> [ insertelement (<vscale x 8 x float> splat (float -0.000000e+00), float 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP14:%.*]], %[[VECTOR_BODY]] ]
; CHECK-UNORDERED-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 8 x float> [ splat (float -0.000000e+00), %[[VECTOR_PH]] ], [ [[TMP15:%.*]], %[[VECTOR_BODY]] ]
; CHECK-UNORDERED-NEXT: [[VEC_PHI2:%.*]] = phi <vscale x 8 x float> [ splat (float -0.000000e+00), %[[VECTOR_PH]] ], [ [[TMP16:%.*]], %[[VECTOR_BODY]] ]
; CHECK-UNORDERED-NEXT: [[VEC_PHI3:%.*]] = phi <vscale x 8 x float> [ splat (float -0.000000e+00), %[[VECTOR_PH]] ], [ [[TMP17:%.*]], %[[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/strict-fadd.ll b/llvm/test/Transforms/LoopVectorize/AArch64/strict-fadd.ll
index 6ca7c01bdf73b..f475e3561e01c 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/strict-fadd.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/strict-fadd.ll
@@ -273,8 +273,8 @@ define void @fadd_strict_interleave(ptr noalias nocapture readonly %a, ptr noali
; CHECK-UNORDERED: %[[LOADA1:.*]] = load float, ptr %a
; CHECK-UNORDERED: %[[LOADA2:.*]] = load float, ptr %[[ARRAYIDX]]
; CHECK-UNORDERED: vector.ph
-; CHECK-UNORDERED: %[[INS2:.*]] = insertelement <4 x float> splat (float -0.000000e+00), float %[[LOADA2]], i64 0
-; CHECK-UNORDERED: %[[INS1:.*]] = insertelement <4 x float> splat (float -0.000000e+00), float %[[LOADA1]], i64 0
+; CHECK-UNORDERED: %[[INS2:.*]] = insertelement <4 x float> splat (float -0.000000e+00), float %[[LOADA2]], i32 0
+; CHECK-UNORDERED: %[[INS1:.*]] = insertelement <4 x float> splat (float -0.000000e+00), float %[[LOADA1]], i32 0
; CHECK-UNORDERED: vector.body
; CHECK-UNORDERED: %[[VEC_PHI2:.*]] = phi <4 x float> [ %[[INS2]], %vector.ph ], [ %[[VEC_FADD2:.*]], %vector.body ]
; CHECK-UNORDERED: %[[VEC_PHI1:.*]] = phi <4 x float> [ %[[INS1]], %vector.ph ], [ %[[VEC_FADD1:.*]], %vector.body ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/sve-epilog-vect-reductions.ll b/llvm/test/Transforms/LoopVectorize/AArch64/sve-epilog-vect-reductions.ll
index c889db1241e47..ccd7b341dc5f7 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/sve-epilog-vect-reductions.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/sve-epilog-vect-reductions.ll
@@ -22,7 +22,7 @@ define i64 @int_reduction_add(ptr %a, i64 %N) {
; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]
; CHECK: vector.body:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 2 x i64> [ insertelement (<vscale x 2 x i64> zeroinitializer, i64 5, i64 0), [[VECTOR_PH]] ], [ [[TMP16:%.*]], [[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 2 x i64> [ insertelement (<vscale x 2 x i64> zeroinitializer, i64 5, i32 0), [[VECTOR_PH]] ], [ [[TMP16:%.*]], [[VECTOR_BODY]] ]
; CHECK-NEXT: [[VEC_PHI2:%.*]] = phi <vscale x 2 x i64> [ zeroinitializer, [[VECTOR_PH]] ], [ [[TMP17:%.*]], [[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds i64, ptr [[A:%.*]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP15:%.*]] = getelementptr inbounds i64, ptr [[TMP10]], i64 [[TMP4]]
@@ -46,7 +46,7 @@ define i64 @int_reduction_add(ptr %a, i64 %N) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i64 [ [[TMP21]], [[VEC_EPILOG_ITER_CHECK]] ], [ 5, [[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF4:%.*]] = and i64 [[N]], 1
; CHECK-NEXT: [[N_VEC5:%.*]] = sub i64 [[N]], [[N_MOD_VF4]]
-; CHECK-NEXT: [[TMP22:%.*]] = insertelement <2 x i64> zeroinitializer, i64 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP22:%.*]] = insertelement <2 x i64> zeroinitializer, i64 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label [[VEC_EPILOG_VECTOR_BODY:%.*]]
; CHECK: vec.epilog.vector.body:
; CHECK-NEXT: [[INDEX7:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], [[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT10:%.*]], [[VEC_EPILOG_VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding-reductions.ll b/llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding-reductions.ll
index e0f73ee4cc8a3..583dba9e4a129 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding-reductions.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding-reductions.ll
@@ -164,7 +164,7 @@ define i32 @cond_xor_reduction(ptr noalias %a, ptr noalias %cond, i64 %N) #0 {
; CHECK: vector.body:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
; CHECK-NEXT: [[ACTIVE_LANE_MASK:%.*]] = phi <vscale x 4 x i1> [ [[ACTIVE_LANE_MASK_ENTRY]], [[VECTOR_PH]] ], [ [[ACTIVE_LANE_MASK_NEXT:%.*]], [[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x i32> [ insertelement (<vscale x 4 x i32> zeroinitializer, i32 7, i64 0), [[VECTOR_PH]] ], [ [[TMP20:%.*]], [[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x i32> [ insertelement (<vscale x 4 x i32> zeroinitializer, i32 7, i32 0), [[VECTOR_PH]] ], [ [[TMP20:%.*]], [[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds i32, ptr [[COND:%.*]], i64 [[INDEX]]
; CHECK-NEXT: [[WIDE_MASKED_LOAD:%.*]] = call <vscale x 4 x i32> @llvm.masked.load.nxv4i32.p0(ptr align 4 [[TMP11]], <vscale x 4 x i1> [[ACTIVE_LANE_MASK]], <vscale x 4 x i32> poison)
; CHECK-NEXT: [[TMP13:%.*]] = icmp eq <vscale x 4 x i32> [[WIDE_MASKED_LOAD]], splat (i32 5)
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-constant-ops.ll b/llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-constant-ops.ll
index 4904f26de1558..2171066fb5e45 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-constant-ops.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-constant-ops.ll
@@ -332,8 +332,8 @@ define void @test_add_double_different_var_args_1(ptr %res, ptr noalias %A, ptr
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: br label %[[VECTOR_PH:.*]]
; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x double> poison, double [[X]], i64 0
-; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x double> [[TMP0]], double [[Y]], i64 1
+; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x double> poison, double [[X]], i32 0
+; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x double> [[TMP0]], double [[Y]], i32 1
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -385,8 +385,8 @@ define void @test_add_double_different_var_args_2(ptr %res, ptr noalias %A, ptr
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: br label %[[VECTOR_PH:.*]]
; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP3:%.*]] = insertelement <2 x double> poison, double [[Y]], i64 0
-; CHECK-NEXT: [[BROADCAST_SPLAT3:%.*]] = insertelement <2 x double> [[TMP3]], double [[X]], i64 1
+; CHECK-NEXT: [[TMP3:%.*]] = insertelement <2 x double> poison, double [[Y]], i32 0
+; CHECK-NEXT: [[BROADCAST_SPLAT3:%.*]] = insertelement <2 x double> [[TMP3]], double [[X]], i32 1
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -442,8 +442,8 @@ define void @test_add_double_different_invariant_recipe_args(ptr %res, ptr noali
; CHECK: [[VECTOR_PH]]:
; CHECK-NEXT: [[TMP0:%.*]] = fmul double [[X]], [[Z]]
; CHECK-NEXT: [[TMP1:%.*]] = fmul double [[Y]], [[Z]]
-; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x double> poison, double [[TMP0]], i64 0
-; CHECK-NEXT: [[BROADCAST_SPLAT6:%.*]] = insertelement <2 x double> [[TMP2]], double [[TMP1]], i64 1
+; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x double> poison, double [[TMP0]], i32 0
+; CHECK-NEXT: [[BROADCAST_SPLAT6:%.*]] = insertelement <2 x double> [[TMP2]], double [[TMP1]], i32 1
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-with-wide-ops-and-casts.ll b/llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-with-wide-ops-and-casts.ll
index da6198034970d..5dd44bf04ca1a 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-with-wide-ops-and-casts.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-with-wide-ops-and-casts.ll
@@ -802,8 +802,8 @@ define void @test_2xdouble_mismatching_sitofp_operand_types(ptr noalias %dst, pt
; VF2-NEXT: [[TMP9:%.*]] = getelementptr inbounds i16, ptr [[SRC]], i64 [[TMP7]]
; VF2-NEXT: [[TMP10:%.*]] = load i16, ptr [[TMP8]], align 8
; VF2-NEXT: [[TMP11:%.*]] = load i16, ptr [[TMP9]], align 8
-; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i16> poison, i16 [[TMP10]], i64 0
-; VF2-NEXT: [[TMP13:%.*]] = insertelement <2 x i16> [[TMP12]], i16 [[TMP11]], i64 1
+; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i16> poison, i16 [[TMP10]], i32 0
+; VF2-NEXT: [[TMP13:%.*]] = insertelement <2 x i16> [[TMP12]], i16 [[TMP11]], i32 1
; VF2-NEXT: [[TMP14:%.*]] = sitofp <2 x i16> [[TMP13]] to <2 x double>
; VF2-NEXT: [[TMP15:%.*]] = shufflevector <2 x double> [[TMP4]], <2 x double> [[TMP14]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
; VF2-NEXT: [[INTERLEAVED_VEC:%.*]] = shufflevector <4 x double> [[TMP15]], <4 x double> poison, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-with-wide-ops-chained.ll b/llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-with-wide-ops-chained.ll
index 60b13e460d8c9..469b801961cd9 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-with-wide-ops-chained.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-with-wide-ops-chained.ll
@@ -658,8 +658,8 @@ define void @narrow_with_select_and_invariant_cond(ptr noalias %dst, ptr noalias
; VF2-NEXT: [[C1:%.*]] = icmp sgt i64 [[C3_P]], 0
; VF2-NEXT: br label %[[VECTOR_PH:.*]]
; VF2: [[VECTOR_PH]]:
-; VF2-NEXT: [[TMP0:%.*]] = insertelement <2 x i1> poison, i1 [[C0]], i64 0
-; VF2-NEXT: [[TMP1:%.*]] = insertelement <2 x i1> [[TMP0]], i1 [[C1]], i64 1
+; VF2-NEXT: [[TMP0:%.*]] = insertelement <2 x i1> poison, i1 [[C0]], i32 0
+; VF2-NEXT: [[TMP1:%.*]] = insertelement <2 x i1> [[TMP0]], i1 [[C1]], i32 1
; VF2-NEXT: br label %[[VECTOR_BODY:.*]]
; VF2: [[VECTOR_BODY]]:
; VF2-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/vector-reverse.ll b/llvm/test/Transforms/LoopVectorize/AArch64/vector-reverse.ll
index e756076f27fd2..731f74597532a 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/vector-reverse.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/vector-reverse.ll
@@ -214,7 +214,7 @@ define i32 @reverse_store_with_partial_reduction(ptr noalias %dst, ptr noalias %
; CHECK-NEXT: [[N_MOD_VF10:%.*]] = urem i64 [[TMP0]], [[TMP33]]
; CHECK-NEXT: [[N_VEC11:%.*]] = sub i64 [[TMP0]], [[N_MOD_VF10]]
; CHECK-NEXT: [[TMP32:%.*]] = sub i64 [[N]], [[N_VEC11]]
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX12:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT18:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/ARM/gather-cost.ll b/llvm/test/Transforms/LoopVectorize/ARM/gather-cost.ll
index 45dbb5fe864a8..57a2aa21b9f96 100644
--- a/llvm/test/Transforms/LoopVectorize/ARM/gather-cost.ll
+++ b/llvm/test/Transforms/LoopVectorize/ARM/gather-cost.ll
@@ -43,10 +43,10 @@ define float @_Z4testmm(i64 %size, i64 %offset) {
; CHECK-NEXT: [[TMP11:%.*]] = load float, ptr [[TMP7]], align 4
; CHECK-NEXT: [[TMP12:%.*]] = load float, ptr [[TMP8]], align 4
; CHECK-NEXT: [[TMP13:%.*]] = load float, ptr [[TMP9]], align 4
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x float> poison, float [[TMP10]], i64 0
-; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x float> [[TMP14]], float [[TMP11]], i64 1
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x float> [[TMP15]], float [[TMP12]], i64 2
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x float> [[TMP16]], float [[TMP13]], i64 3
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x float> poison, float [[TMP10]], i32 0
+; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x float> [[TMP14]], float [[TMP11]], i32 1
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x float> [[TMP15]], float [[TMP12]], i32 2
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x float> [[TMP16]], float [[TMP13]], i32 3
; CHECK-NEXT: [[TMP18:%.*]] = getelementptr inbounds [512 x float], ptr @kernel, i64 0, i64 [[INDEX]]
; CHECK-NEXT: [[WIDE_LOAD:%.*]] = load <4 x float>, ptr [[TMP18]], align 4
; CHECK-NEXT: [[TMP19:%.*]] = fmul fast <4 x float> [[TMP17]], [[WIDE_LOAD]]
@@ -73,10 +73,10 @@ define float @_Z4testmm(i64 %size, i64 %offset) {
; CHECK-NEXT: [[TMP37:%.*]] = load float, ptr [[TMP33]], align 4
; CHECK-NEXT: [[TMP38:%.*]] = load float, ptr [[TMP34]], align 4
; CHECK-NEXT: [[TMP39:%.*]] = load float, ptr [[TMP35]], align 4
-; CHECK-NEXT: [[TMP40:%.*]] = insertelement <4 x float> poison, float [[TMP36]], i64 0
-; CHECK-NEXT: [[TMP41:%.*]] = insertelement <4 x float> [[TMP40]], float [[TMP37]], i64 1
-; CHECK-NEXT: [[TMP42:%.*]] = insertelement <4 x float> [[TMP41]], float [[TMP38]], i64 2
-; CHECK-NEXT: [[TMP43:%.*]] = insertelement <4 x float> [[TMP42]], float [[TMP39]], i64 3
+; CHECK-NEXT: [[TMP40:%.*]] = insertelement <4 x float> poison, float [[TMP36]], i32 0
+; CHECK-NEXT: [[TMP41:%.*]] = insertelement <4 x float> [[TMP40]], float [[TMP37]], i32 1
+; CHECK-NEXT: [[TMP42:%.*]] = insertelement <4 x float> [[TMP41]], float [[TMP38]], i32 2
+; CHECK-NEXT: [[TMP43:%.*]] = insertelement <4 x float> [[TMP42]], float [[TMP39]], i32 3
; CHECK-NEXT: [[TMP44:%.*]] = fmul fast <4 x float> [[WIDE_LOAD]], [[TMP43]]
; CHECK-NEXT: [[TMP45:%.*]] = fmul fast <4 x float> [[WIDE_LOAD3]], [[TMP44]]
; CHECK-NEXT: [[TMP46:%.*]] = fmul fast <4 x float> [[WIDE_LOAD4]], [[TMP45]]
@@ -95,10 +95,10 @@ define float @_Z4testmm(i64 %size, i64 %offset) {
; CHECK-NEXT: [[TMP59:%.*]] = load float, ptr [[TMP55]], align 4
; CHECK-NEXT: [[TMP60:%.*]] = load float, ptr [[TMP56]], align 4
; CHECK-NEXT: [[TMP61:%.*]] = load float, ptr [[TMP57]], align 4
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x float> poison, float [[TMP58]], i64 0
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x float> [[TMP62]], float [[TMP59]], i64 1
-; CHECK-NEXT: [[TMP64:%.*]] = insertelement <4 x float> [[TMP63]], float [[TMP60]], i64 2
-; CHECK-NEXT: [[TMP65:%.*]] = insertelement <4 x float> [[TMP64]], float [[TMP61]], i64 3
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x float> poison, float [[TMP58]], i32 0
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x float> [[TMP62]], float [[TMP59]], i32 1
+; CHECK-NEXT: [[TMP64:%.*]] = insertelement <4 x float> [[TMP63]], float [[TMP60]], i32 2
+; CHECK-NEXT: [[TMP65:%.*]] = insertelement <4 x float> [[TMP64]], float [[TMP61]], i32 3
; CHECK-NEXT: [[TMP66:%.*]] = fmul fast <4 x float> [[WIDE_LOAD]], [[TMP65]]
; CHECK-NEXT: [[TMP67:%.*]] = fmul fast <4 x float> [[WIDE_LOAD3]], [[TMP66]]
; CHECK-NEXT: [[TMP68:%.*]] = fmul fast <4 x float> [[WIDE_LOAD4]], [[TMP67]]
diff --git a/llvm/test/Transforms/LoopVectorize/ARM/sphinx.ll b/llvm/test/Transforms/LoopVectorize/ARM/sphinx.ll
index e3a4aeb619e49..489f01ff499ae 100644
--- a/llvm/test/Transforms/LoopVectorize/ARM/sphinx.ll
+++ b/llvm/test/Transforms/LoopVectorize/ARM/sphinx.ll
@@ -39,7 +39,7 @@ define i32 @test(ptr nocapture readonly %x) {
; CHECK: vector.ph:
; CHECK-NEXT: [[N_MOD_VF:%.*]] = and i32 [[T]], 1
; CHECK-NEXT: [[N_VEC:%.*]] = sub i32 [[T]], [[N_MOD_VF]]
-; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x double> zeroinitializer, double [[CONV114]], i64 0
+; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x double> zeroinitializer, double [[CONV114]], i32 0
; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]
; CHECK: vector.body:
; CHECK-NEXT: [[INDEX:%.*]] = phi i32 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/PowerPC/exit-branch-cost.ll b/llvm/test/Transforms/LoopVectorize/PowerPC/exit-branch-cost.ll
index 296cf633c5823..935388b227e36 100644
--- a/llvm/test/Transforms/LoopVectorize/PowerPC/exit-branch-cost.ll
+++ b/llvm/test/Transforms/LoopVectorize/PowerPC/exit-branch-cost.ll
@@ -151,7 +151,7 @@ define i1 @select_exit_cond(ptr %start, ptr %end, i64 %N) {
; CHECK-NEXT: [[TMP65:%.*]] = and i64 [[TMP2]], 1
; CHECK-NEXT: [[N_VEC36:%.*]] = sub i64 [[TMP2]], [[TMP65]]
; CHECK-NEXT: [[TMP66:%.*]] = getelementptr i8, ptr [[START]], i64 [[N_VEC36]]
-; CHECK-NEXT: [[TMP67:%.*]] = insertelement <2 x i64> zeroinitializer, i64 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP67:%.*]] = insertelement <2 x i64> zeroinitializer, i64 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <2 x i64> poison, i64 [[VEC_EPILOG_RESUME_VAL]], i64 0
; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <2 x i64> [[BROADCAST_SPLATINSERT]], <2 x i64> poison, <2 x i32> zeroinitializer
; CHECK-NEXT: [[INDUCTION:%.*]] = add <2 x i64> [[BROADCAST_SPLAT]], <i64 0, i64 1>
diff --git a/llvm/test/Transforms/LoopVectorize/PowerPC/large-loop-rdx.ll b/llvm/test/Transforms/LoopVectorize/PowerPC/large-loop-rdx.ll
index 7c9622aadb8f2..85c0279e58be2 100644
--- a/llvm/test/Transforms/LoopVectorize/PowerPC/large-loop-rdx.ll
+++ b/llvm/test/Transforms/LoopVectorize/PowerPC/large-loop-rdx.ll
@@ -245,7 +245,7 @@ define void @QLA_F3_r_veq_norm2_V(ptr noalias %r, ptr noalias %a, i32 %n) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi double [ [[TMP158]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0.000000e+00, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF69:%.*]] = and i64 [[TMP0]], 1
; CHECK-NEXT: [[N_VEC70:%.*]] = sub i64 [[TMP0]], [[N_MOD_VF69]]
-; CHECK-NEXT: [[TMP138:%.*]] = insertelement <2 x double> zeroinitializer, double [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP138:%.*]] = insertelement <2 x double> zeroinitializer, double [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT80:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/PowerPC/small-loop-rdx.ll b/llvm/test/Transforms/LoopVectorize/PowerPC/small-loop-rdx.ll
index ab0005d44c6ad..746193587a41c 100644
--- a/llvm/test/Transforms/LoopVectorize/PowerPC/small-loop-rdx.ll
+++ b/llvm/test/Transforms/LoopVectorize/PowerPC/small-loop-rdx.ll
@@ -79,7 +79,7 @@ define void @test(ptr %arr, i32 %len) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi double [ [[TMP21]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0.000000e+00, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF22:%.*]] = and i64 [[TMP1]], 1
; CHECK-NEXT: [[N_VEC23:%.*]] = sub i64 [[TMP1]], [[N_MOD_VF22]]
-; CHECK-NEXT: [[TMP22:%.*]] = insertelement <2 x double> zeroinitializer, double [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP22:%.*]] = insertelement <2 x double> zeroinitializer, double [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[TMP23:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT27:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/RISCV/reductions.ll b/llvm/test/Transforms/LoopVectorize/RISCV/reductions.ll
index 38ff50a579e61..e0723dd207907 100644
--- a/llvm/test/Transforms/LoopVectorize/RISCV/reductions.ll
+++ b/llvm/test/Transforms/LoopVectorize/RISCV/reductions.ll
@@ -14,7 +14,7 @@ define i32 @add(ptr nocapture %a, ptr nocapture readonly %b, i64 %n) {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x i32> [ insertelement (<vscale x 4 x i32> zeroinitializer, i32 2, i64 0), %[[VECTOR_PH]] ], [ [[TMP8:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x i32> [ insertelement (<vscale x 4 x i32> zeroinitializer, i32 2, i32 0), %[[VECTOR_PH]] ], [ [[TMP8:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[AVL:%.*]] = phi i64 [ [[N]], %[[VECTOR_PH]] ], [ [[AVL_NEXT:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP13:%.*]] = call i32 @llvm.experimental.get.vector.length.i64(i64 [[AVL]], i32 4, i1 true)
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, ptr [[A]], i64 [[INDEX]]
@@ -58,7 +58,7 @@ define i32 @sub(ptr %a, i64 %n) {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x i32> [ insertelement (<vscale x 4 x i32> zeroinitializer, i32 1024, i64 0), %[[VECTOR_PH]] ], [ [[TMP3:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x i32> [ insertelement (<vscale x 4 x i32> zeroinitializer, i32 1024, i32 0), %[[VECTOR_PH]] ], [ [[TMP3:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[AVL:%.*]] = phi i64 [ [[N]], %[[VECTOR_PH]] ], [ [[AVL_NEXT:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.experimental.get.vector.length.i64(i64 [[AVL]], i32 4, i1 true)
; CHECK-NEXT: [[TMP0:%.*]] = getelementptr i32, ptr [[A]], i64 [[INDEX]]
@@ -155,7 +155,7 @@ define i32 @or(ptr nocapture %a, ptr nocapture readonly %b, i64 %n) {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x i32> [ insertelement (<vscale x 4 x i32> zeroinitializer, i32 2, i64 0), %[[VECTOR_PH]] ], [ [[TMP8:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x i32> [ insertelement (<vscale x 4 x i32> zeroinitializer, i32 2, i32 0), %[[VECTOR_PH]] ], [ [[TMP8:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[AVL:%.*]] = phi i64 [ [[N]], %[[VECTOR_PH]] ], [ [[AVL_NEXT:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP13:%.*]] = call i32 @llvm.experimental.get.vector.length.i64(i64 [[AVL]], i32 4, i1 true)
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, ptr [[A]], i64 [[INDEX]]
@@ -201,7 +201,7 @@ define i32 @and(ptr nocapture %a, ptr nocapture readonly %b, i64 %n) {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x i32> [ insertelement (<vscale x 4 x i32> splat (i32 -1), i32 2, i64 0), %[[VECTOR_PH]] ], [ [[TMP8:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x i32> [ insertelement (<vscale x 4 x i32> splat (i32 -1), i32 2, i32 0), %[[VECTOR_PH]] ], [ [[TMP8:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[AVL:%.*]] = phi i64 [ [[N]], %[[VECTOR_PH]] ], [ [[AVL_NEXT:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP13:%.*]] = call i32 @llvm.experimental.get.vector.length.i64(i64 [[AVL]], i32 4, i1 true)
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, ptr [[A]], i64 [[INDEX]]
@@ -247,7 +247,7 @@ define i32 @xor(ptr nocapture %a, ptr nocapture readonly %b, i64 %n) {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x i32> [ insertelement (<vscale x 4 x i32> zeroinitializer, i32 2, i64 0), %[[VECTOR_PH]] ], [ [[TMP8:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x i32> [ insertelement (<vscale x 4 x i32> zeroinitializer, i32 2, i32 0), %[[VECTOR_PH]] ], [ [[TMP8:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[AVL:%.*]] = phi i64 [ [[N]], %[[VECTOR_PH]] ], [ [[AVL_NEXT:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP13:%.*]] = call i32 @llvm.experimental.get.vector.length.i64(i64 [[AVL]], i32 4, i1 true)
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, ptr [[A]], i64 [[INDEX]]
@@ -426,7 +426,7 @@ define float @fsub_fast(ptr %a, float %start, i64 %n) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: br label %[[VECTOR_PH:.*]]
; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP0:%.*]] = insertelement <vscale x 4 x float> zeroinitializer, float [[START]], i64 0
+; CHECK-NEXT: [[TMP0:%.*]] = insertelement <vscale x 4 x float> zeroinitializer, float [[START]], i32 0
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[CURRENT_ITERATION_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -1058,7 +1058,7 @@ define float @fmuladd(ptr %a, ptr %b, i64 %n) {
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP9:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 4 x float> [ insertelement (<vscale x 4 x float> splat (float -0.000000e+00), float 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP9:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[AVL:%.*]] = phi i64 [ [[N]], %[[VECTOR_PH]] ], [ [[AVL_NEXT:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP14:%.*]] = call i32 @llvm.experimental.get.vector.length.i64(i64 [[AVL]], i32 4, i1 true)
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds float, ptr [[A]], i64 [[INDEX]]
@@ -1106,7 +1106,7 @@ define half @fmuladd_f16_zvfh(ptr %a, ptr %b, i64 %n) "target-features"="+zvfh"
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x half> [ insertelement (<vscale x 8 x half> splat (half -0.000000e+00), half 0.000000e+00, i64 0), %[[VECTOR_PH]] ], [ [[TMP9:%.*]], %[[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x half> [ insertelement (<vscale x 8 x half> splat (half -0.000000e+00), half 0.000000e+00, i32 0), %[[VECTOR_PH]] ], [ [[TMP9:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[AVL:%.*]] = phi i64 [ [[N]], %[[VECTOR_PH]] ], [ [[AVL_NEXT:%.*]], %[[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP14:%.*]] = call i32 @llvm.experimental.get.vector.length.i64(i64 [[AVL]], i32 8, i1 true)
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds half, ptr [[A]], i64 [[INDEX]]
diff --git a/llvm/test/Transforms/LoopVectorize/RISCV/riscv-vector-reverse.ll b/llvm/test/Transforms/LoopVectorize/RISCV/riscv-vector-reverse.ll
index 8982804f476de..b395e69868507 100644
--- a/llvm/test/Transforms/LoopVectorize/RISCV/riscv-vector-reverse.ll
+++ b/llvm/test/Transforms/LoopVectorize/RISCV/riscv-vector-reverse.ll
@@ -722,10 +722,10 @@ define void @vector_reverse_irregular_type(ptr noalias %A, ptr noalias %B) {
; RV64-NEXT: [[TMP13:%.*]] = load i7, ptr [[TMP9]], align 1
; RV64-NEXT: [[TMP14:%.*]] = load i7, ptr [[TMP10]], align 1
; RV64-NEXT: [[TMP15:%.*]] = load i7, ptr [[TMP11]], align 1
-; RV64-NEXT: [[TMP16:%.*]] = insertelement <4 x i7> poison, i7 [[TMP12]], i64 0
-; RV64-NEXT: [[TMP17:%.*]] = insertelement <4 x i7> [[TMP16]], i7 [[TMP13]], i64 1
-; RV64-NEXT: [[TMP18:%.*]] = insertelement <4 x i7> [[TMP17]], i7 [[TMP14]], i64 2
-; RV64-NEXT: [[TMP19:%.*]] = insertelement <4 x i7> [[TMP18]], i7 [[TMP15]], i64 3
+; RV64-NEXT: [[TMP16:%.*]] = insertelement <4 x i7> poison, i7 [[TMP12]], i32 0
+; RV64-NEXT: [[TMP17:%.*]] = insertelement <4 x i7> [[TMP16]], i7 [[TMP13]], i32 1
+; RV64-NEXT: [[TMP18:%.*]] = insertelement <4 x i7> [[TMP17]], i7 [[TMP14]], i32 2
+; RV64-NEXT: [[TMP19:%.*]] = insertelement <4 x i7> [[TMP18]], i7 [[TMP15]], i32 3
; RV64-NEXT: [[TMP20:%.*]] = add <4 x i7> [[TMP19]], splat (i7 1)
; RV64-NEXT: [[TMP21:%.*]] = getelementptr inbounds i7, ptr [[A]], i64 [[TMP4]]
; RV64-NEXT: [[TMP22:%.*]] = getelementptr inbounds i7, ptr [[A]], i64 [[TMP5]]
@@ -772,10 +772,10 @@ define void @vector_reverse_irregular_type(ptr noalias %A, ptr noalias %B) {
; RV32-NEXT: [[TMP13:%.*]] = load i7, ptr [[TMP9]], align 1
; RV32-NEXT: [[TMP14:%.*]] = load i7, ptr [[TMP10]], align 1
; RV32-NEXT: [[TMP15:%.*]] = load i7, ptr [[TMP11]], align 1
-; RV32-NEXT: [[TMP16:%.*]] = insertelement <4 x i7> poison, i7 [[TMP12]], i64 0
-; RV32-NEXT: [[TMP17:%.*]] = insertelement <4 x i7> [[TMP16]], i7 [[TMP13]], i64 1
-; RV32-NEXT: [[TMP18:%.*]] = insertelement <4 x i7> [[TMP17]], i7 [[TMP14]], i64 2
-; RV32-NEXT: [[TMP19:%.*]] = insertelement <4 x i7> [[TMP18]], i7 [[TMP15]], i64 3
+; RV32-NEXT: [[TMP16:%.*]] = insertelement <4 x i7> poison, i7 [[TMP12]], i32 0
+; RV32-NEXT: [[TMP17:%.*]] = insertelement <4 x i7> [[TMP16]], i7 [[TMP13]], i32 1
+; RV32-NEXT: [[TMP18:%.*]] = insertelement <4 x i7> [[TMP17]], i7 [[TMP14]], i32 2
+; RV32-NEXT: [[TMP19:%.*]] = insertelement <4 x i7> [[TMP18]], i7 [[TMP15]], i32 3
; RV32-NEXT: [[TMP20:%.*]] = add <4 x i7> [[TMP19]], splat (i7 1)
; RV32-NEXT: [[TMP21:%.*]] = getelementptr inbounds i7, ptr [[A]], i64 [[TMP4]]
; RV32-NEXT: [[TMP22:%.*]] = getelementptr inbounds i7, ptr [[A]], i64 [[TMP5]]
@@ -834,18 +834,18 @@ define void @vector_reverse_irregular_type(ptr noalias %A, ptr noalias %B) {
; RV64-UF2-NEXT: [[TMP25:%.*]] = load i7, ptr [[TMP17]], align 1
; RV64-UF2-NEXT: [[TMP26:%.*]] = load i7, ptr [[TMP18]], align 1
; RV64-UF2-NEXT: [[TMP27:%.*]] = load i7, ptr [[TMP19]], align 1
-; RV64-UF2-NEXT: [[TMP28:%.*]] = insertelement <4 x i7> poison, i7 [[TMP24]], i64 0
-; RV64-UF2-NEXT: [[TMP29:%.*]] = insertelement <4 x i7> [[TMP28]], i7 [[TMP25]], i64 1
-; RV64-UF2-NEXT: [[TMP30:%.*]] = insertelement <4 x i7> [[TMP29]], i7 [[TMP26]], i64 2
-; RV64-UF2-NEXT: [[TMP31:%.*]] = insertelement <4 x i7> [[TMP30]], i7 [[TMP27]], i64 3
+; RV64-UF2-NEXT: [[TMP28:%.*]] = insertelement <4 x i7> poison, i7 [[TMP24]], i32 0
+; RV64-UF2-NEXT: [[TMP29:%.*]] = insertelement <4 x i7> [[TMP28]], i7 [[TMP25]], i32 1
+; RV64-UF2-NEXT: [[TMP30:%.*]] = insertelement <4 x i7> [[TMP29]], i7 [[TMP26]], i32 2
+; RV64-UF2-NEXT: [[TMP31:%.*]] = insertelement <4 x i7> [[TMP30]], i7 [[TMP27]], i32 3
; RV64-UF2-NEXT: [[TMP32:%.*]] = load i7, ptr [[TMP20]], align 1
; RV64-UF2-NEXT: [[TMP33:%.*]] = load i7, ptr [[TMP21]], align 1
; RV64-UF2-NEXT: [[TMP34:%.*]] = load i7, ptr [[TMP22]], align 1
; RV64-UF2-NEXT: [[TMP35:%.*]] = load i7, ptr [[TMP23]], align 1
-; RV64-UF2-NEXT: [[TMP36:%.*]] = insertelement <4 x i7> poison, i7 [[TMP32]], i64 0
-; RV64-UF2-NEXT: [[TMP37:%.*]] = insertelement <4 x i7> [[TMP36]], i7 [[TMP33]], i64 1
-; RV64-UF2-NEXT: [[TMP38:%.*]] = insertelement <4 x i7> [[TMP37]], i7 [[TMP34]], i64 2
-; RV64-UF2-NEXT: [[TMP39:%.*]] = insertelement <4 x i7> [[TMP38]], i7 [[TMP35]], i64 3
+; RV64-UF2-NEXT: [[TMP36:%.*]] = insertelement <4 x i7> poison, i7 [[TMP32]], i32 0
+; RV64-UF2-NEXT: [[TMP37:%.*]] = insertelement <4 x i7> [[TMP36]], i7 [[TMP33]], i32 1
+; RV64-UF2-NEXT: [[TMP38:%.*]] = insertelement <4 x i7> [[TMP37]], i7 [[TMP34]], i32 2
+; RV64-UF2-NEXT: [[TMP39:%.*]] = insertelement <4 x i7> [[TMP38]], i7 [[TMP35]], i32 3
; RV64-UF2-NEXT: [[TMP40:%.*]] = add <4 x i7> [[TMP31]], splat (i7 1)
; RV64-UF2-NEXT: [[TMP41:%.*]] = add <4 x i7> [[TMP39]], splat (i7 1)
; RV64-UF2-NEXT: [[TMP42:%.*]] = getelementptr inbounds i7, ptr [[A]], i64 [[TMP8]]
diff --git a/llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-cond-reduction.ll b/llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-cond-reduction.ll
index 98b791ffe8d38..bdae288cbe5e5 100644
--- a/llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-cond-reduction.ll
+++ b/llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-cond-reduction.ll
@@ -23,7 +23,7 @@ define i32 @cond_add(ptr %a, i64 %n, i32 %start) {
; IF-EVL-OUTLOOP-NEXT: entry:
; IF-EVL-OUTLOOP-NEXT: br label [[VECTOR_PH:%.*]]
; IF-EVL-OUTLOOP: vector.ph:
-; IF-EVL-OUTLOOP-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i64 0
+; IF-EVL-OUTLOOP-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i32 0
; IF-EVL-OUTLOOP-NEXT: br label [[VECTOR_BODY:%.*]]
; IF-EVL-OUTLOOP: vector.body:
; IF-EVL-OUTLOOP-NEXT: [[EVL_BASED_IV1:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT1:%.*]], [[VECTOR_BODY]] ]
@@ -85,7 +85,7 @@ define i32 @cond_add(ptr %a, i64 %n, i32 %start) {
; NO-VP-OUTLOOP-NEXT: [[TMP7:%.*]] = shl nuw i64 [[TMP1]], 2
; NO-VP-OUTLOOP-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[N]], [[TMP7]]
; NO-VP-OUTLOOP-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; NO-VP-OUTLOOP-NEXT: [[TMP11:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i64 0
+; NO-VP-OUTLOOP-NEXT: [[TMP11:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i32 0
; NO-VP-OUTLOOP-NEXT: br label [[VECTOR_BODY:%.*]]
; NO-VP-OUTLOOP: vector.body:
; NO-VP-OUTLOOP-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -192,7 +192,7 @@ define i32 @cond_add_pred(ptr %a, i64 %n, i32 %start) {
; IF-EVL-OUTLOOP-NEXT: entry:
; IF-EVL-OUTLOOP-NEXT: br label [[VECTOR_PH:%.*]]
; IF-EVL-OUTLOOP: vector.ph:
-; IF-EVL-OUTLOOP-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i64 0
+; IF-EVL-OUTLOOP-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i32 0
; IF-EVL-OUTLOOP-NEXT: br label [[VECTOR_BODY:%.*]]
; IF-EVL-OUTLOOP: vector.body:
; IF-EVL-OUTLOOP-NEXT: [[EVL_BASED_IV:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -252,7 +252,7 @@ define i32 @cond_add_pred(ptr %a, i64 %n, i32 %start) {
; NO-VP-OUTLOOP-NEXT: [[TMP7:%.*]] = shl nuw i64 [[TMP1]], 2
; NO-VP-OUTLOOP-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[N]], [[TMP7]]
; NO-VP-OUTLOOP-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; NO-VP-OUTLOOP-NEXT: [[TMP11:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i64 0
+; NO-VP-OUTLOOP-NEXT: [[TMP11:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i32 0
; NO-VP-OUTLOOP-NEXT: br label [[VECTOR_BODY:%.*]]
; NO-VP-OUTLOOP: vector.body:
; NO-VP-OUTLOOP-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -373,7 +373,7 @@ define i32 @step_cond_add(ptr %a, i64 %n, i32 %start) {
; IF-EVL-OUTLOOP-NEXT: entry:
; IF-EVL-OUTLOOP-NEXT: br label [[VECTOR_PH:%.*]]
; IF-EVL-OUTLOOP: vector.ph:
-; IF-EVL-OUTLOOP-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i64 0
+; IF-EVL-OUTLOOP-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i32 0
; IF-EVL-OUTLOOP-NEXT: [[TMP10:%.*]] = call <vscale x 4 x i32> @llvm.stepvector.nxv4i32()
; IF-EVL-OUTLOOP-NEXT: br label [[VECTOR_BODY:%.*]]
; IF-EVL-OUTLOOP: vector.body:
@@ -445,7 +445,7 @@ define i32 @step_cond_add(ptr %a, i64 %n, i32 %start) {
; NO-VP-OUTLOOP-NEXT: [[TMP7:%.*]] = shl nuw i64 [[TMP1]], 2
; NO-VP-OUTLOOP-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[N]], [[TMP7]]
; NO-VP-OUTLOOP-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; NO-VP-OUTLOOP-NEXT: [[TMP11:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i64 0
+; NO-VP-OUTLOOP-NEXT: [[TMP11:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i32 0
; NO-VP-OUTLOOP-NEXT: [[TMP12:%.*]] = call <vscale x 4 x i32> @llvm.stepvector.nxv4i32()
; NO-VP-OUTLOOP-NEXT: [[TMP16:%.*]] = trunc i64 [[TMP7]] to i32
; NO-VP-OUTLOOP-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP16]], i64 0
@@ -567,7 +567,7 @@ define i32 @step_cond_add_pred(ptr %a, i64 %n, i32 %start) {
; IF-EVL-OUTLOOP-NEXT: entry:
; IF-EVL-OUTLOOP-NEXT: br label [[VECTOR_PH:%.*]]
; IF-EVL-OUTLOOP: vector.ph:
-; IF-EVL-OUTLOOP-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i64 0
+; IF-EVL-OUTLOOP-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i32 0
; IF-EVL-OUTLOOP-NEXT: [[TMP10:%.*]] = call <vscale x 4 x i32> @llvm.stepvector.nxv4i32()
; IF-EVL-OUTLOOP-NEXT: br label [[VECTOR_BODY:%.*]]
; IF-EVL-OUTLOOP: vector.body:
@@ -637,7 +637,7 @@ define i32 @step_cond_add_pred(ptr %a, i64 %n, i32 %start) {
; NO-VP-OUTLOOP-NEXT: [[TMP7:%.*]] = shl nuw i64 [[TMP1]], 2
; NO-VP-OUTLOOP-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[N]], [[TMP7]]
; NO-VP-OUTLOOP-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; NO-VP-OUTLOOP-NEXT: [[TMP11:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i64 0
+; NO-VP-OUTLOOP-NEXT: [[TMP11:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i32 0
; NO-VP-OUTLOOP-NEXT: [[TMP12:%.*]] = call <vscale x 4 x i32> @llvm.stepvector.nxv4i32()
; NO-VP-OUTLOOP-NEXT: [[TMP16:%.*]] = trunc i64 [[TMP7]] to i32
; NO-VP-OUTLOOP-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP16]], i64 0
diff --git a/llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-intermediate-store.ll b/llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-intermediate-store.ll
index 45c84d6821fa2..e7631a2ddf9b5 100644
--- a/llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-intermediate-store.ll
+++ b/llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-intermediate-store.ll
@@ -31,7 +31,7 @@ define void @reduction_intermediate_store(ptr %a, i64 %n, i32 %start, ptr %addr)
; IF-EVL-OUTLOOP-NEXT: [[FOUND_CONFLICT:%.*]] = and i1 [[BOUND0]], [[BOUND1]]
; IF-EVL-OUTLOOP-NEXT: br i1 [[FOUND_CONFLICT]], label [[SCALAR_PH:%.*]], label [[ENTRY:%.*]]
; IF-EVL-OUTLOOP: vector.ph:
-; IF-EVL-OUTLOOP-NEXT: [[TMP10:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i64 0
+; IF-EVL-OUTLOOP-NEXT: [[TMP10:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i32 0
; IF-EVL-OUTLOOP-NEXT: br label [[FOR_BODY:%.*]]
; IF-EVL-OUTLOOP: vector.body:
; IF-EVL-OUTLOOP-NEXT: [[EVL_BASED_IV:%.*]] = phi i64 [ 0, [[ENTRY]] ], [ [[INDEX_EVL_NEXT:%.*]], [[FOR_BODY]] ]
@@ -131,7 +131,7 @@ define void @reduction_intermediate_store(ptr %a, i64 %n, i32 %start, ptr %addr)
; NO-VP-OUTLOOP-NEXT: [[TMP5:%.*]] = shl nuw i64 [[TMP0]], 2
; NO-VP-OUTLOOP-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[N]], [[TMP5]]
; NO-VP-OUTLOOP-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; NO-VP-OUTLOOP-NEXT: [[TMP8:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i64 0
+; NO-VP-OUTLOOP-NEXT: [[TMP8:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i32 0
; NO-VP-OUTLOOP-NEXT: br label [[VECTOR_BODY:%.*]]
; NO-VP-OUTLOOP: vector.body:
; NO-VP-OUTLOOP-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-reduction.ll b/llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-reduction.ll
index 56fcac31c446b..120b1003584a4 100644
--- a/llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-reduction.ll
+++ b/llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-reduction.ll
@@ -12,7 +12,7 @@ define i32 @add(ptr %a, i64 %n, i32 %start) {
; IF-EVL-NEXT: entry:
; IF-EVL-NEXT: br label [[VECTOR_PH:%.*]]
; IF-EVL: vector.ph:
-; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START:%.*]], i64 0
+; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START:%.*]], i32 0
; IF-EVL-NEXT: br label [[VECTOR_BODY:%.*]]
; IF-EVL: vector.body:
; IF-EVL-NEXT: [[EVL_BASED_IV:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -44,7 +44,7 @@ define i32 @add(ptr %a, i64 %n, i32 %start) {
; NO-VP-NEXT: [[TMP3:%.*]] = shl nuw i64 [[TMP0]], 2
; NO-VP-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[N]], [[TMP3]]
; NO-VP-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; NO-VP-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START:%.*]], i64 0
+; NO-VP-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START:%.*]], i32 0
; NO-VP-NEXT: br label [[VECTOR_BODY:%.*]]
; NO-VP: vector.body:
; NO-VP-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -102,7 +102,7 @@ define i32 @mul(ptr %a, i64 %n, i32 %start) {
; IF-EVL: vector.ph:
; IF-EVL-NEXT: [[N_MOD_VF:%.*]] = and i64 [[N_RND_UP]], 15
; IF-EVL-NEXT: [[N_VEC:%.*]] = sub i64 [[N_RND_UP]], [[N_MOD_VF]]
-; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <8 x i32> splat (i32 1), i32 [[START:%.*]], i64 0
+; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <8 x i32> splat (i32 1), i32 [[START:%.*]], i32 0
; IF-EVL-NEXT: br label [[FOR_BODY:%.*]]
; IF-EVL: vector.body:
; IF-EVL-NEXT: [[IV:%.*]] = phi i64 [ 0, [[ENTRY]] ], [ [[IV_NEXT:%.*]], [[FOR_BODY]] ]
@@ -146,7 +146,7 @@ define i32 @mul(ptr %a, i64 %n, i32 %start) {
; NO-VP: vector.ph:
; NO-VP-NEXT: [[N_MOD_VF:%.*]] = and i64 [[N]], 15
; NO-VP-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; NO-VP-NEXT: [[TMP0:%.*]] = insertelement <8 x i32> splat (i32 1), i32 [[START:%.*]], i64 0
+; NO-VP-NEXT: [[TMP0:%.*]] = insertelement <8 x i32> splat (i32 1), i32 [[START:%.*]], i32 0
; NO-VP-NEXT: br label [[VECTOR_BODY:%.*]]
; NO-VP: vector.body:
; NO-VP-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -205,7 +205,7 @@ define i32 @or(ptr %a, i64 %n, i32 %start) {
; IF-EVL-NEXT: entry:
; IF-EVL-NEXT: br label [[VECTOR_PH:%.*]]
; IF-EVL: vector.ph:
-; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START:%.*]], i64 0
+; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START:%.*]], i32 0
; IF-EVL-NEXT: br label [[VECTOR_BODY:%.*]]
; IF-EVL: vector.body:
; IF-EVL-NEXT: [[EVL_BASED_IV:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -237,7 +237,7 @@ define i32 @or(ptr %a, i64 %n, i32 %start) {
; NO-VP-NEXT: [[TMP3:%.*]] = shl nuw i64 [[TMP0]], 2
; NO-VP-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[N]], [[TMP3]]
; NO-VP-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; NO-VP-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START:%.*]], i64 0
+; NO-VP-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START:%.*]], i32 0
; NO-VP-NEXT: br label [[VECTOR_BODY:%.*]]
; NO-VP: vector.body:
; NO-VP-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -291,7 +291,7 @@ define i32 @and(ptr %a, i64 %n, i32 %start) {
; IF-EVL-NEXT: entry:
; IF-EVL-NEXT: br label [[VECTOR_PH:%.*]]
; IF-EVL: vector.ph:
-; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> splat (i32 -1), i32 [[START:%.*]], i64 0
+; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> splat (i32 -1), i32 [[START:%.*]], i32 0
; IF-EVL-NEXT: br label [[VECTOR_BODY:%.*]]
; IF-EVL: vector.body:
; IF-EVL-NEXT: [[EVL_BASED_IV:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -323,7 +323,7 @@ define i32 @and(ptr %a, i64 %n, i32 %start) {
; NO-VP-NEXT: [[TMP3:%.*]] = shl nuw i64 [[TMP0]], 2
; NO-VP-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[N]], [[TMP3]]
; NO-VP-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; NO-VP-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x i32> splat (i32 -1), i32 [[START:%.*]], i64 0
+; NO-VP-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x i32> splat (i32 -1), i32 [[START:%.*]], i32 0
; NO-VP-NEXT: br label [[VECTOR_BODY:%.*]]
; NO-VP: vector.body:
; NO-VP-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -377,7 +377,7 @@ define i32 @xor(ptr %a, i64 %n, i32 %start) {
; IF-EVL-NEXT: entry:
; IF-EVL-NEXT: br label [[VECTOR_PH:%.*]]
; IF-EVL: vector.ph:
-; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START:%.*]], i64 0
+; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START:%.*]], i32 0
; IF-EVL-NEXT: br label [[VECTOR_BODY:%.*]]
; IF-EVL: vector.body:
; IF-EVL-NEXT: [[EVL_BASED_IV:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -409,7 +409,7 @@ define i32 @xor(ptr %a, i64 %n, i32 %start) {
; NO-VP-NEXT: [[TMP3:%.*]] = shl nuw i64 [[TMP0]], 2
; NO-VP-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[N]], [[TMP3]]
; NO-VP-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; NO-VP-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START:%.*]], i64 0
+; NO-VP-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START:%.*]], i32 0
; NO-VP-NEXT: br label [[VECTOR_BODY:%.*]]
; NO-VP: vector.body:
; NO-VP-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -815,7 +815,7 @@ define float @fadd(ptr %a, i64 %n, float %start) {
; IF-EVL-NEXT: entry:
; IF-EVL-NEXT: br label [[VECTOR_PH:%.*]]
; IF-EVL: vector.ph:
-; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x float> splat (float -0.000000e+00), float [[START:%.*]], i64 0
+; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x float> splat (float -0.000000e+00), float [[START:%.*]], i32 0
; IF-EVL-NEXT: br label [[VECTOR_BODY:%.*]]
; IF-EVL: vector.body:
; IF-EVL-NEXT: [[EVL_BASED_IV:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -847,7 +847,7 @@ define float @fadd(ptr %a, i64 %n, float %start) {
; NO-VP-NEXT: [[TMP3:%.*]] = shl nuw i64 [[TMP0]], 2
; NO-VP-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[N]], [[TMP3]]
; NO-VP-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; NO-VP-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x float> splat (float -0.000000e+00), float [[START:%.*]], i64 0
+; NO-VP-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x float> splat (float -0.000000e+00), float [[START:%.*]], i32 0
; NO-VP-NEXT: br label [[VECTOR_BODY:%.*]]
; NO-VP: vector.body:
; NO-VP-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -905,7 +905,7 @@ define float @fmul(ptr %a, i64 %n, float %start) {
; IF-EVL: vector.ph:
; IF-EVL-NEXT: [[N_MOD_VF:%.*]] = and i64 [[N_RND_UP]], 15
; IF-EVL-NEXT: [[N_VEC:%.*]] = sub i64 [[N_RND_UP]], [[N_MOD_VF]]
-; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <8 x float> splat (float 1.000000e+00), float [[START:%.*]], i64 0
+; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <8 x float> splat (float 1.000000e+00), float [[START:%.*]], i32 0
; IF-EVL-NEXT: br label [[FOR_BODY:%.*]]
; IF-EVL: vector.body:
; IF-EVL-NEXT: [[IV:%.*]] = phi i64 [ 0, [[ENTRY]] ], [ [[IV_NEXT:%.*]], [[FOR_BODY]] ]
@@ -949,7 +949,7 @@ define float @fmul(ptr %a, i64 %n, float %start) {
; NO-VP: vector.ph:
; NO-VP-NEXT: [[N_MOD_VF:%.*]] = and i64 [[N]], 15
; NO-VP-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; NO-VP-NEXT: [[TMP0:%.*]] = insertelement <8 x float> splat (float 1.000000e+00), float [[START:%.*]], i64 0
+; NO-VP-NEXT: [[TMP0:%.*]] = insertelement <8 x float> splat (float 1.000000e+00), float [[START:%.*]], i32 0
; NO-VP-NEXT: br label [[VECTOR_BODY:%.*]]
; NO-VP: vector.body:
; NO-VP-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -1406,7 +1406,7 @@ define float @fmuladd(ptr %a, ptr %b, i64 %n, float %start) {
; IF-EVL-NEXT: entry:
; IF-EVL-NEXT: br label [[VECTOR_PH:%.*]]
; IF-EVL: vector.ph:
-; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x float> splat (float -0.000000e+00), float [[START:%.*]], i64 0
+; IF-EVL-NEXT: [[TMP9:%.*]] = insertelement <vscale x 4 x float> splat (float -0.000000e+00), float [[START:%.*]], i32 0
; IF-EVL-NEXT: br label [[VECTOR_BODY:%.*]]
; IF-EVL: vector.body:
; IF-EVL-NEXT: [[EVL_BASED_IV:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_EVL_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -1440,7 +1440,7 @@ define float @fmuladd(ptr %a, ptr %b, i64 %n, float %start) {
; NO-VP-NEXT: [[TMP3:%.*]] = shl nuw i64 [[TMP0]], 2
; NO-VP-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[N]], [[TMP3]]
; NO-VP-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; NO-VP-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x float> splat (float -0.000000e+00), float [[START:%.*]], i64 0
+; NO-VP-NEXT: [[TMP6:%.*]] = insertelement <vscale x 4 x float> splat (float -0.000000e+00), float [[START:%.*]], i32 0
; NO-VP-NEXT: br label [[VECTOR_BODY:%.*]]
; NO-VP: vector.body:
; NO-VP-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/RISCV/vector-loop-backedge-elimination-with-evl.ll b/llvm/test/Transforms/LoopVectorize/RISCV/vector-loop-backedge-elimination-with-evl.ll
index 900bdecfe5558..7851adb8d85be 100644
--- a/llvm/test/Transforms/LoopVectorize/RISCV/vector-loop-backedge-elimination-with-evl.ll
+++ b/llvm/test/Transforms/LoopVectorize/RISCV/vector-loop-backedge-elimination-with-evl.ll
@@ -38,7 +38,7 @@ define i32 @test_remove_iv(i32 %start) #0 {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: br label %[[VECTOR_PH:.*]]
; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP2:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i64 0
+; CHECK-NEXT: [[TMP2:%.*]] = insertelement <vscale x 4 x i32> zeroinitializer, i32 [[START]], i32 0
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[TMP3:%.*]] = xor <vscale x 4 x i32> [[TMP2]], splat (i32 3)
diff --git a/llvm/test/Transforms/LoopVectorize/SystemZ/addressing.ll b/llvm/test/Transforms/LoopVectorize/SystemZ/addressing.ll
index 72f57a92049b4..ab808242840bc 100644
--- a/llvm/test/Transforms/LoopVectorize/SystemZ/addressing.ll
+++ b/llvm/test/Transforms/LoopVectorize/SystemZ/addressing.ll
@@ -138,20 +138,20 @@ define void @foo1(ptr nocapture noalias %A, ptr nocapture %PtrPtr) {
; CHECK-NEXT: [[TMP22:%.*]] = load ptr, ptr [[TMP14]], align 8
; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP3]], align 4
; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[TMP4]], align 4
-; CHECK-NEXT: [[TMP25:%.*]] = insertelement <2 x i32> poison, i32 [[TMP5]], i64 0
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i32> [[TMP25]], i32 [[TMP6]], i64 1
+; CHECK-NEXT: [[TMP25:%.*]] = insertelement <2 x i32> poison, i32 [[TMP5]], i32 0
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i32> [[TMP25]], i32 [[TMP6]], i32 1
; CHECK-NEXT: [[TMP27:%.*]] = load i32, ptr [[TMP17]], align 4
; CHECK-NEXT: [[TMP28:%.*]] = load i32, ptr [[TMP18]], align 4
-; CHECK-NEXT: [[TMP29:%.*]] = insertelement <2 x i32> poison, i32 [[TMP27]], i64 0
-; CHECK-NEXT: [[TMP30:%.*]] = insertelement <2 x i32> [[TMP29]], i32 [[TMP28]], i64 1
+; CHECK-NEXT: [[TMP29:%.*]] = insertelement <2 x i32> poison, i32 [[TMP27]], i32 0
+; CHECK-NEXT: [[TMP30:%.*]] = insertelement <2 x i32> [[TMP29]], i32 [[TMP28]], i32 1
; CHECK-NEXT: [[TMP31:%.*]] = load i32, ptr [[TMP19]], align 4
; CHECK-NEXT: [[TMP32:%.*]] = load i32, ptr [[TMP20]], align 4
-; CHECK-NEXT: [[TMP33:%.*]] = insertelement <2 x i32> poison, i32 [[TMP31]], i64 0
-; CHECK-NEXT: [[TMP34:%.*]] = insertelement <2 x i32> [[TMP33]], i32 [[TMP32]], i64 1
+; CHECK-NEXT: [[TMP33:%.*]] = insertelement <2 x i32> poison, i32 [[TMP31]], i32 0
+; CHECK-NEXT: [[TMP34:%.*]] = insertelement <2 x i32> [[TMP33]], i32 [[TMP32]], i32 1
; CHECK-NEXT: [[TMP35:%.*]] = load i32, ptr [[TMP21]], align 4
; CHECK-NEXT: [[TMP36:%.*]] = load i32, ptr [[TMP22]], align 4
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <2 x i32> poison, i32 [[TMP35]], i64 0
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <2 x i32> [[TMP37]], i32 [[TMP36]], i64 1
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <2 x i32> poison, i32 [[TMP35]], i32 0
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <2 x i32> [[TMP37]], i32 [[TMP36]], i32 1
; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds i32, ptr [[A:%.*]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP40:%.*]] = getelementptr inbounds i32, ptr [[TMP9]], i64 2
; CHECK-NEXT: [[TMP41:%.*]] = getelementptr inbounds i32, ptr [[TMP9]], i64 4
diff --git a/llvm/test/Transforms/LoopVectorize/SystemZ/scalar-steps-with-users-demanding-all-lanes-and-first-lane-only.ll b/llvm/test/Transforms/LoopVectorize/SystemZ/scalar-steps-with-users-demanding-all-lanes-and-first-lane-only.ll
index 4c3565b374cae..0a4fbc54a954c 100644
--- a/llvm/test/Transforms/LoopVectorize/SystemZ/scalar-steps-with-users-demanding-all-lanes-and-first-lane-only.ll
+++ b/llvm/test/Transforms/LoopVectorize/SystemZ/scalar-steps-with-users-demanding-all-lanes-and-first-lane-only.ll
@@ -25,10 +25,10 @@ define void @test_scalar_iv_steps_used_by_replicate_and_first_lane_only_vpinst(p
; CHECK-NEXT: [[TMP9:%.*]] = load i8, ptr [[TMP5]], align 1
; CHECK-NEXT: [[TMP10:%.*]] = load i8, ptr [[TMP6]], align 1
; CHECK-NEXT: [[TMP11:%.*]] = load i8, ptr [[TMP7]], align 1
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i8> poison, i8 [[TMP12]], i64 0
-; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x i8> [[TMP16]], i8 [[TMP9]], i64 1
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i8> [[TMP13]], i8 [[TMP10]], i64 2
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i8> [[TMP14]], i8 [[TMP11]], i64 3
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i8> poison, i8 [[TMP12]], i32 0
+; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x i8> [[TMP16]], i8 [[TMP9]], i32 1
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i8> [[TMP13]], i8 [[TMP10]], i32 2
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i8> [[TMP14]], i8 [[TMP11]], i32 3
; CHECK-NEXT: [[TMP20:%.*]] = icmp eq <4 x i8> [[TMP19]], zeroinitializer
; CHECK-NEXT: [[WIDE_LOAD:%.*]] = load <4 x i32>, ptr getelementptr inbounds nuw (i8, ptr @src, i64 16), align 4
; CHECK-NEXT: [[TMP24:%.*]] = extractelement <4 x i1> [[TMP20]], i64 0
diff --git a/llvm/test/Transforms/LoopVectorize/X86/cast-costs.ll b/llvm/test/Transforms/LoopVectorize/X86/cast-costs.ll
index 7f0ba19d3e7a8..67a4ac0c7808c 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/cast-costs.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/cast-costs.ll
@@ -244,7 +244,7 @@ define i16 @bitcast_half_to_i16(ptr %src, ptr %dst, i64 %n) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i16 [ [[TMP9]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF4:%.*]] = and i64 [[N]], 3
; CHECK-NEXT: [[N_VEC5:%.*]] = sub i64 [[N]], [[N_MOD_VF4]]
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <4 x i16> zeroinitializer, i16 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <4 x i16> zeroinitializer, i16 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX6:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT9:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/X86/cost-conditional-branches.ll b/llvm/test/Transforms/LoopVectorize/X86/cost-conditional-branches.ll
index f0c94e0a78629..100cd3e815f77 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/cost-conditional-branches.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/cost-conditional-branches.ll
@@ -74,22 +74,22 @@ define void @test_replicate_call_chain(float %x, ptr noalias %A, ptr noalias %B,
; CHECK-NEXT: [[TMP56:%.*]] = tail call float @llvm.pow.f32(float [[TMP38]], float [[X]])
; CHECK-NEXT: [[TMP57:%.*]] = tail call float @llvm.pow.f32(float [[TMP40]], float [[X]])
; CHECK-NEXT: [[TMP58:%.*]] = tail call float @llvm.pow.f32(float [[TMP42]], float [[X]])
-; CHECK-NEXT: [[TMP59:%.*]] = insertelement <16 x float> poison, float [[TMP43]], i64 0
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <16 x float> [[TMP59]], float [[TMP44]], i64 1
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <16 x float> [[TMP60]], float [[TMP45]], i64 2
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <16 x float> [[TMP61]], float [[TMP46]], i64 3
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <16 x float> [[TMP62]], float [[TMP47]], i64 4
-; CHECK-NEXT: [[TMP64:%.*]] = insertelement <16 x float> [[TMP63]], float [[TMP48]], i64 5
-; CHECK-NEXT: [[TMP65:%.*]] = insertelement <16 x float> [[TMP64]], float [[TMP49]], i64 6
-; CHECK-NEXT: [[TMP66:%.*]] = insertelement <16 x float> [[TMP65]], float [[TMP50]], i64 7
-; CHECK-NEXT: [[TMP67:%.*]] = insertelement <16 x float> [[TMP66]], float [[TMP51]], i64 8
-; CHECK-NEXT: [[TMP68:%.*]] = insertelement <16 x float> [[TMP67]], float [[TMP52]], i64 9
-; CHECK-NEXT: [[TMP69:%.*]] = insertelement <16 x float> [[TMP68]], float [[TMP53]], i64 10
-; CHECK-NEXT: [[TMP70:%.*]] = insertelement <16 x float> [[TMP69]], float [[TMP54]], i64 11
-; CHECK-NEXT: [[TMP71:%.*]] = insertelement <16 x float> [[TMP70]], float [[TMP55]], i64 12
-; CHECK-NEXT: [[TMP72:%.*]] = insertelement <16 x float> [[TMP71]], float [[TMP56]], i64 13
-; CHECK-NEXT: [[TMP73:%.*]] = insertelement <16 x float> [[TMP72]], float [[TMP57]], i64 14
-; CHECK-NEXT: [[TMP74:%.*]] = insertelement <16 x float> [[TMP73]], float [[TMP58]], i64 15
+; CHECK-NEXT: [[TMP59:%.*]] = insertelement <16 x float> poison, float [[TMP43]], i32 0
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <16 x float> [[TMP59]], float [[TMP44]], i32 1
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <16 x float> [[TMP60]], float [[TMP45]], i32 2
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <16 x float> [[TMP61]], float [[TMP46]], i32 3
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <16 x float> [[TMP62]], float [[TMP47]], i32 4
+; CHECK-NEXT: [[TMP64:%.*]] = insertelement <16 x float> [[TMP63]], float [[TMP48]], i32 5
+; CHECK-NEXT: [[TMP65:%.*]] = insertelement <16 x float> [[TMP64]], float [[TMP49]], i32 6
+; CHECK-NEXT: [[TMP66:%.*]] = insertelement <16 x float> [[TMP65]], float [[TMP50]], i32 7
+; CHECK-NEXT: [[TMP67:%.*]] = insertelement <16 x float> [[TMP66]], float [[TMP51]], i32 8
+; CHECK-NEXT: [[TMP68:%.*]] = insertelement <16 x float> [[TMP67]], float [[TMP52]], i32 9
+; CHECK-NEXT: [[TMP69:%.*]] = insertelement <16 x float> [[TMP68]], float [[TMP53]], i32 10
+; CHECK-NEXT: [[TMP70:%.*]] = insertelement <16 x float> [[TMP69]], float [[TMP54]], i32 11
+; CHECK-NEXT: [[TMP71:%.*]] = insertelement <16 x float> [[TMP70]], float [[TMP55]], i32 12
+; CHECK-NEXT: [[TMP72:%.*]] = insertelement <16 x float> [[TMP71]], float [[TMP56]], i32 13
+; CHECK-NEXT: [[TMP73:%.*]] = insertelement <16 x float> [[TMP72]], float [[TMP57]], i32 14
+; CHECK-NEXT: [[TMP74:%.*]] = insertelement <16 x float> [[TMP73]], float [[TMP58]], i32 15
; CHECK-NEXT: call void @llvm.masked.store.v16f32.p0(<16 x float> [[TMP74]], ptr align 4 [[TMP5]], <16 x i1> [[TMP7]])
; CHECK-NEXT: call void @llvm.masked.store.v16f32.p0(<16 x float> zeroinitializer, ptr align 4 [[TMP5]], <16 x i1> [[TMP6]])
; CHECK-NEXT: store float 0.000000e+00, ptr [[E:%.*]], align 4
diff --git a/llvm/test/Transforms/LoopVectorize/X86/cost-model.ll b/llvm/test/Transforms/LoopVectorize/X86/cost-model.ll
index 5ae9e55d58bac..d42c587963964 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/cost-model.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/cost-model.ll
@@ -164,14 +164,14 @@ define float @PR27826(ptr nocapture readonly %a, ptr nocapture readonly %b, i32
; CHECK-NEXT: [[TMP73:%.*]] = load float, ptr [[TMP41]], align 4
; CHECK-NEXT: [[TMP74:%.*]] = load float, ptr [[TMP42]], align 4
; CHECK-NEXT: [[TMP75:%.*]] = load float, ptr [[TMP43]], align 4
-; CHECK-NEXT: [[TMP76:%.*]] = insertelement <8 x float> poison, float [[TMP68]], i64 0
-; CHECK-NEXT: [[TMP77:%.*]] = insertelement <8 x float> [[TMP76]], float [[TMP69]], i64 1
-; CHECK-NEXT: [[TMP78:%.*]] = insertelement <8 x float> [[TMP77]], float [[TMP70]], i64 2
-; CHECK-NEXT: [[TMP79:%.*]] = insertelement <8 x float> [[TMP78]], float [[TMP71]], i64 3
-; CHECK-NEXT: [[TMP80:%.*]] = insertelement <8 x float> [[TMP79]], float [[TMP72]], i64 4
-; CHECK-NEXT: [[TMP81:%.*]] = insertelement <8 x float> [[TMP80]], float [[TMP73]], i64 5
-; CHECK-NEXT: [[TMP82:%.*]] = insertelement <8 x float> [[TMP81]], float [[TMP74]], i64 6
-; CHECK-NEXT: [[TMP83:%.*]] = insertelement <8 x float> [[TMP82]], float [[TMP75]], i64 7
+; CHECK-NEXT: [[TMP76:%.*]] = insertelement <8 x float> poison, float [[TMP68]], i32 0
+; CHECK-NEXT: [[TMP77:%.*]] = insertelement <8 x float> [[TMP76]], float [[TMP69]], i32 1
+; CHECK-NEXT: [[TMP78:%.*]] = insertelement <8 x float> [[TMP77]], float [[TMP70]], i32 2
+; CHECK-NEXT: [[TMP79:%.*]] = insertelement <8 x float> [[TMP78]], float [[TMP71]], i32 3
+; CHECK-NEXT: [[TMP80:%.*]] = insertelement <8 x float> [[TMP79]], float [[TMP72]], i32 4
+; CHECK-NEXT: [[TMP81:%.*]] = insertelement <8 x float> [[TMP80]], float [[TMP73]], i32 5
+; CHECK-NEXT: [[TMP82:%.*]] = insertelement <8 x float> [[TMP81]], float [[TMP74]], i32 6
+; CHECK-NEXT: [[TMP83:%.*]] = insertelement <8 x float> [[TMP82]], float [[TMP75]], i32 7
; CHECK-NEXT: [[TMP84:%.*]] = load float, ptr [[TMP44]], align 4
; CHECK-NEXT: [[TMP85:%.*]] = load float, ptr [[TMP45]], align 4
; CHECK-NEXT: [[TMP86:%.*]] = load float, ptr [[TMP46]], align 4
@@ -180,14 +180,14 @@ define float @PR27826(ptr nocapture readonly %a, ptr nocapture readonly %b, i32
; CHECK-NEXT: [[TMP89:%.*]] = load float, ptr [[TMP49]], align 4
; CHECK-NEXT: [[TMP90:%.*]] = load float, ptr [[TMP50]], align 4
; CHECK-NEXT: [[TMP91:%.*]] = load float, ptr [[TMP51]], align 4
-; CHECK-NEXT: [[TMP92:%.*]] = insertelement <8 x float> poison, float [[TMP84]], i64 0
-; CHECK-NEXT: [[TMP93:%.*]] = insertelement <8 x float> [[TMP92]], float [[TMP85]], i64 1
-; CHECK-NEXT: [[TMP94:%.*]] = insertelement <8 x float> [[TMP93]], float [[TMP86]], i64 2
-; CHECK-NEXT: [[TMP95:%.*]] = insertelement <8 x float> [[TMP94]], float [[TMP87]], i64 3
-; CHECK-NEXT: [[TMP96:%.*]] = insertelement <8 x float> [[TMP95]], float [[TMP88]], i64 4
-; CHECK-NEXT: [[TMP97:%.*]] = insertelement <8 x float> [[TMP96]], float [[TMP89]], i64 5
-; CHECK-NEXT: [[TMP98:%.*]] = insertelement <8 x float> [[TMP97]], float [[TMP90]], i64 6
-; CHECK-NEXT: [[TMP99:%.*]] = insertelement <8 x float> [[TMP98]], float [[TMP91]], i64 7
+; CHECK-NEXT: [[TMP92:%.*]] = insertelement <8 x float> poison, float [[TMP84]], i32 0
+; CHECK-NEXT: [[TMP93:%.*]] = insertelement <8 x float> [[TMP92]], float [[TMP85]], i32 1
+; CHECK-NEXT: [[TMP94:%.*]] = insertelement <8 x float> [[TMP93]], float [[TMP86]], i32 2
+; CHECK-NEXT: [[TMP95:%.*]] = insertelement <8 x float> [[TMP94]], float [[TMP87]], i32 3
+; CHECK-NEXT: [[TMP96:%.*]] = insertelement <8 x float> [[TMP95]], float [[TMP88]], i32 4
+; CHECK-NEXT: [[TMP97:%.*]] = insertelement <8 x float> [[TMP96]], float [[TMP89]], i32 5
+; CHECK-NEXT: [[TMP98:%.*]] = insertelement <8 x float> [[TMP97]], float [[TMP90]], i32 6
+; CHECK-NEXT: [[TMP99:%.*]] = insertelement <8 x float> [[TMP98]], float [[TMP91]], i32 7
; CHECK-NEXT: [[TMP100:%.*]] = load float, ptr [[TMP52]], align 4
; CHECK-NEXT: [[TMP101:%.*]] = load float, ptr [[TMP53]], align 4
; CHECK-NEXT: [[TMP102:%.*]] = load float, ptr [[TMP54]], align 4
@@ -196,14 +196,14 @@ define float @PR27826(ptr nocapture readonly %a, ptr nocapture readonly %b, i32
; CHECK-NEXT: [[TMP105:%.*]] = load float, ptr [[TMP57]], align 4
; CHECK-NEXT: [[TMP106:%.*]] = load float, ptr [[TMP58]], align 4
; CHECK-NEXT: [[TMP107:%.*]] = load float, ptr [[TMP59]], align 4
-; CHECK-NEXT: [[TMP108:%.*]] = insertelement <8 x float> poison, float [[TMP100]], i64 0
-; CHECK-NEXT: [[TMP109:%.*]] = insertelement <8 x float> [[TMP108]], float [[TMP101]], i64 1
-; CHECK-NEXT: [[TMP110:%.*]] = insertelement <8 x float> [[TMP109]], float [[TMP102]], i64 2
-; CHECK-NEXT: [[TMP111:%.*]] = insertelement <8 x float> [[TMP110]], float [[TMP103]], i64 3
-; CHECK-NEXT: [[TMP112:%.*]] = insertelement <8 x float> [[TMP111]], float [[TMP104]], i64 4
-; CHECK-NEXT: [[TMP113:%.*]] = insertelement <8 x float> [[TMP112]], float [[TMP105]], i64 5
-; CHECK-NEXT: [[TMP114:%.*]] = insertelement <8 x float> [[TMP113]], float [[TMP106]], i64 6
-; CHECK-NEXT: [[TMP115:%.*]] = insertelement <8 x float> [[TMP114]], float [[TMP107]], i64 7
+; CHECK-NEXT: [[TMP108:%.*]] = insertelement <8 x float> poison, float [[TMP100]], i32 0
+; CHECK-NEXT: [[TMP109:%.*]] = insertelement <8 x float> [[TMP108]], float [[TMP101]], i32 1
+; CHECK-NEXT: [[TMP110:%.*]] = insertelement <8 x float> [[TMP109]], float [[TMP102]], i32 2
+; CHECK-NEXT: [[TMP111:%.*]] = insertelement <8 x float> [[TMP110]], float [[TMP103]], i32 3
+; CHECK-NEXT: [[TMP112:%.*]] = insertelement <8 x float> [[TMP111]], float [[TMP104]], i32 4
+; CHECK-NEXT: [[TMP113:%.*]] = insertelement <8 x float> [[TMP112]], float [[TMP105]], i32 5
+; CHECK-NEXT: [[TMP114:%.*]] = insertelement <8 x float> [[TMP113]], float [[TMP106]], i32 6
+; CHECK-NEXT: [[TMP115:%.*]] = insertelement <8 x float> [[TMP114]], float [[TMP107]], i32 7
; CHECK-NEXT: [[TMP116:%.*]] = load float, ptr [[TMP60]], align 4
; CHECK-NEXT: [[TMP117:%.*]] = load float, ptr [[TMP61]], align 4
; CHECK-NEXT: [[TMP118:%.*]] = load float, ptr [[TMP62]], align 4
@@ -212,14 +212,14 @@ define float @PR27826(ptr nocapture readonly %a, ptr nocapture readonly %b, i32
; CHECK-NEXT: [[TMP121:%.*]] = load float, ptr [[TMP65]], align 4
; CHECK-NEXT: [[TMP122:%.*]] = load float, ptr [[TMP66]], align 4
; CHECK-NEXT: [[TMP123:%.*]] = load float, ptr [[TMP67]], align 4
-; CHECK-NEXT: [[TMP124:%.*]] = insertelement <8 x float> poison, float [[TMP116]], i64 0
-; CHECK-NEXT: [[TMP125:%.*]] = insertelement <8 x float> [[TMP124]], float [[TMP117]], i64 1
-; CHECK-NEXT: [[TMP126:%.*]] = insertelement <8 x float> [[TMP125]], float [[TMP118]], i64 2
-; CHECK-NEXT: [[TMP127:%.*]] = insertelement <8 x float> [[TMP126]], float [[TMP119]], i64 3
-; CHECK-NEXT: [[TMP128:%.*]] = insertelement <8 x float> [[TMP127]], float [[TMP120]], i64 4
-; CHECK-NEXT: [[TMP129:%.*]] = insertelement <8 x float> [[TMP128]], float [[TMP121]], i64 5
-; CHECK-NEXT: [[TMP130:%.*]] = insertelement <8 x float> [[TMP129]], float [[TMP122]], i64 6
-; CHECK-NEXT: [[TMP131:%.*]] = insertelement <8 x float> [[TMP130]], float [[TMP123]], i64 7
+; CHECK-NEXT: [[TMP124:%.*]] = insertelement <8 x float> poison, float [[TMP116]], i32 0
+; CHECK-NEXT: [[TMP125:%.*]] = insertelement <8 x float> [[TMP124]], float [[TMP117]], i32 1
+; CHECK-NEXT: [[TMP126:%.*]] = insertelement <8 x float> [[TMP125]], float [[TMP118]], i32 2
+; CHECK-NEXT: [[TMP127:%.*]] = insertelement <8 x float> [[TMP126]], float [[TMP119]], i32 3
+; CHECK-NEXT: [[TMP128:%.*]] = insertelement <8 x float> [[TMP127]], float [[TMP120]], i32 4
+; CHECK-NEXT: [[TMP129:%.*]] = insertelement <8 x float> [[TMP128]], float [[TMP121]], i32 5
+; CHECK-NEXT: [[TMP130:%.*]] = insertelement <8 x float> [[TMP129]], float [[TMP122]], i32 6
+; CHECK-NEXT: [[TMP131:%.*]] = insertelement <8 x float> [[TMP130]], float [[TMP123]], i32 7
; CHECK-NEXT: [[TMP132:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[TMP4]]
; CHECK-NEXT: [[TMP133:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[TMP5]]
; CHECK-NEXT: [[TMP134:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[TMP6]]
@@ -260,14 +260,14 @@ define float @PR27826(ptr nocapture readonly %a, ptr nocapture readonly %b, i32
; CHECK-NEXT: [[TMP169:%.*]] = load float, ptr [[TMP137]], align 4
; CHECK-NEXT: [[TMP170:%.*]] = load float, ptr [[TMP138]], align 4
; CHECK-NEXT: [[TMP171:%.*]] = load float, ptr [[TMP139]], align 4
-; CHECK-NEXT: [[TMP172:%.*]] = insertelement <8 x float> poison, float [[TMP164]], i64 0
-; CHECK-NEXT: [[TMP173:%.*]] = insertelement <8 x float> [[TMP172]], float [[TMP165]], i64 1
-; CHECK-NEXT: [[TMP174:%.*]] = insertelement <8 x float> [[TMP173]], float [[TMP166]], i64 2
-; CHECK-NEXT: [[TMP175:%.*]] = insertelement <8 x float> [[TMP174]], float [[TMP167]], i64 3
-; CHECK-NEXT: [[TMP176:%.*]] = insertelement <8 x float> [[TMP175]], float [[TMP168]], i64 4
-; CHECK-NEXT: [[TMP177:%.*]] = insertelement <8 x float> [[TMP176]], float [[TMP169]], i64 5
-; CHECK-NEXT: [[TMP178:%.*]] = insertelement <8 x float> [[TMP177]], float [[TMP170]], i64 6
-; CHECK-NEXT: [[TMP179:%.*]] = insertelement <8 x float> [[TMP178]], float [[TMP171]], i64 7
+; CHECK-NEXT: [[TMP172:%.*]] = insertelement <8 x float> poison, float [[TMP164]], i32 0
+; CHECK-NEXT: [[TMP173:%.*]] = insertelement <8 x float> [[TMP172]], float [[TMP165]], i32 1
+; CHECK-NEXT: [[TMP174:%.*]] = insertelement <8 x float> [[TMP173]], float [[TMP166]], i32 2
+; CHECK-NEXT: [[TMP175:%.*]] = insertelement <8 x float> [[TMP174]], float [[TMP167]], i32 3
+; CHECK-NEXT: [[TMP176:%.*]] = insertelement <8 x float> [[TMP175]], float [[TMP168]], i32 4
+; CHECK-NEXT: [[TMP177:%.*]] = insertelement <8 x float> [[TMP176]], float [[TMP169]], i32 5
+; CHECK-NEXT: [[TMP178:%.*]] = insertelement <8 x float> [[TMP177]], float [[TMP170]], i32 6
+; CHECK-NEXT: [[TMP179:%.*]] = insertelement <8 x float> [[TMP178]], float [[TMP171]], i32 7
; CHECK-NEXT: [[TMP180:%.*]] = load float, ptr [[TMP140]], align 4
; CHECK-NEXT: [[TMP181:%.*]] = load float, ptr [[TMP141]], align 4
; CHECK-NEXT: [[TMP182:%.*]] = load float, ptr [[TMP142]], align 4
@@ -276,14 +276,14 @@ define float @PR27826(ptr nocapture readonly %a, ptr nocapture readonly %b, i32
; CHECK-NEXT: [[TMP185:%.*]] = load float, ptr [[TMP145]], align 4
; CHECK-NEXT: [[TMP186:%.*]] = load float, ptr [[TMP146]], align 4
; CHECK-NEXT: [[TMP187:%.*]] = load float, ptr [[TMP147]], align 4
-; CHECK-NEXT: [[TMP188:%.*]] = insertelement <8 x float> poison, float [[TMP180]], i64 0
-; CHECK-NEXT: [[TMP189:%.*]] = insertelement <8 x float> [[TMP188]], float [[TMP181]], i64 1
-; CHECK-NEXT: [[TMP190:%.*]] = insertelement <8 x float> [[TMP189]], float [[TMP182]], i64 2
-; CHECK-NEXT: [[TMP191:%.*]] = insertelement <8 x float> [[TMP190]], float [[TMP183]], i64 3
-; CHECK-NEXT: [[TMP192:%.*]] = insertelement <8 x float> [[TMP191]], float [[TMP184]], i64 4
-; CHECK-NEXT: [[TMP193:%.*]] = insertelement <8 x float> [[TMP192]], float [[TMP185]], i64 5
-; CHECK-NEXT: [[TMP194:%.*]] = insertelement <8 x float> [[TMP193]], float [[TMP186]], i64 6
-; CHECK-NEXT: [[TMP195:%.*]] = insertelement <8 x float> [[TMP194]], float [[TMP187]], i64 7
+; CHECK-NEXT: [[TMP188:%.*]] = insertelement <8 x float> poison, float [[TMP180]], i32 0
+; CHECK-NEXT: [[TMP189:%.*]] = insertelement <8 x float> [[TMP188]], float [[TMP181]], i32 1
+; CHECK-NEXT: [[TMP190:%.*]] = insertelement <8 x float> [[TMP189]], float [[TMP182]], i32 2
+; CHECK-NEXT: [[TMP191:%.*]] = insertelement <8 x float> [[TMP190]], float [[TMP183]], i32 3
+; CHECK-NEXT: [[TMP192:%.*]] = insertelement <8 x float> [[TMP191]], float [[TMP184]], i32 4
+; CHECK-NEXT: [[TMP193:%.*]] = insertelement <8 x float> [[TMP192]], float [[TMP185]], i32 5
+; CHECK-NEXT: [[TMP194:%.*]] = insertelement <8 x float> [[TMP193]], float [[TMP186]], i32 6
+; CHECK-NEXT: [[TMP195:%.*]] = insertelement <8 x float> [[TMP194]], float [[TMP187]], i32 7
; CHECK-NEXT: [[TMP196:%.*]] = load float, ptr [[TMP148]], align 4
; CHECK-NEXT: [[TMP197:%.*]] = load float, ptr [[TMP149]], align 4
; CHECK-NEXT: [[TMP198:%.*]] = load float, ptr [[TMP150]], align 4
@@ -292,14 +292,14 @@ define float @PR27826(ptr nocapture readonly %a, ptr nocapture readonly %b, i32
; CHECK-NEXT: [[TMP201:%.*]] = load float, ptr [[TMP153]], align 4
; CHECK-NEXT: [[TMP202:%.*]] = load float, ptr [[TMP154]], align 4
; CHECK-NEXT: [[TMP203:%.*]] = load float, ptr [[TMP155]], align 4
-; CHECK-NEXT: [[TMP204:%.*]] = insertelement <8 x float> poison, float [[TMP196]], i64 0
-; CHECK-NEXT: [[TMP205:%.*]] = insertelement <8 x float> [[TMP204]], float [[TMP197]], i64 1
-; CHECK-NEXT: [[TMP206:%.*]] = insertelement <8 x float> [[TMP205]], float [[TMP198]], i64 2
-; CHECK-NEXT: [[TMP207:%.*]] = insertelement <8 x float> [[TMP206]], float [[TMP199]], i64 3
-; CHECK-NEXT: [[TMP208:%.*]] = insertelement <8 x float> [[TMP207]], float [[TMP200]], i64 4
-; CHECK-NEXT: [[TMP209:%.*]] = insertelement <8 x float> [[TMP208]], float [[TMP201]], i64 5
-; CHECK-NEXT: [[TMP210:%.*]] = insertelement <8 x float> [[TMP209]], float [[TMP202]], i64 6
-; CHECK-NEXT: [[TMP211:%.*]] = insertelement <8 x float> [[TMP210]], float [[TMP203]], i64 7
+; CHECK-NEXT: [[TMP204:%.*]] = insertelement <8 x float> poison, float [[TMP196]], i32 0
+; CHECK-NEXT: [[TMP205:%.*]] = insertelement <8 x float> [[TMP204]], float [[TMP197]], i32 1
+; CHECK-NEXT: [[TMP206:%.*]] = insertelement <8 x float> [[TMP205]], float [[TMP198]], i32 2
+; CHECK-NEXT: [[TMP207:%.*]] = insertelement <8 x float> [[TMP206]], float [[TMP199]], i32 3
+; CHECK-NEXT: [[TMP208:%.*]] = insertelement <8 x float> [[TMP207]], float [[TMP200]], i32 4
+; CHECK-NEXT: [[TMP209:%.*]] = insertelement <8 x float> [[TMP208]], float [[TMP201]], i32 5
+; CHECK-NEXT: [[TMP210:%.*]] = insertelement <8 x float> [[TMP209]], float [[TMP202]], i32 6
+; CHECK-NEXT: [[TMP211:%.*]] = insertelement <8 x float> [[TMP210]], float [[TMP203]], i32 7
; CHECK-NEXT: [[TMP212:%.*]] = load float, ptr [[TMP156]], align 4
; CHECK-NEXT: [[TMP213:%.*]] = load float, ptr [[TMP157]], align 4
; CHECK-NEXT: [[TMP214:%.*]] = load float, ptr [[TMP158]], align 4
@@ -308,14 +308,14 @@ define float @PR27826(ptr nocapture readonly %a, ptr nocapture readonly %b, i32
; CHECK-NEXT: [[TMP217:%.*]] = load float, ptr [[TMP161]], align 4
; CHECK-NEXT: [[TMP218:%.*]] = load float, ptr [[TMP162]], align 4
; CHECK-NEXT: [[TMP219:%.*]] = load float, ptr [[TMP163]], align 4
-; CHECK-NEXT: [[TMP220:%.*]] = insertelement <8 x float> poison, float [[TMP212]], i64 0
-; CHECK-NEXT: [[TMP221:%.*]] = insertelement <8 x float> [[TMP220]], float [[TMP213]], i64 1
-; CHECK-NEXT: [[TMP222:%.*]] = insertelement <8 x float> [[TMP221]], float [[TMP214]], i64 2
-; CHECK-NEXT: [[TMP223:%.*]] = insertelement <8 x float> [[TMP222]], float [[TMP215]], i64 3
-; CHECK-NEXT: [[TMP224:%.*]] = insertelement <8 x float> [[TMP223]], float [[TMP216]], i64 4
-; CHECK-NEXT: [[TMP225:%.*]] = insertelement <8 x float> [[TMP224]], float [[TMP217]], i64 5
-; CHECK-NEXT: [[TMP226:%.*]] = insertelement <8 x float> [[TMP225]], float [[TMP218]], i64 6
-; CHECK-NEXT: [[TMP227:%.*]] = insertelement <8 x float> [[TMP226]], float [[TMP219]], i64 7
+; CHECK-NEXT: [[TMP220:%.*]] = insertelement <8 x float> poison, float [[TMP212]], i32 0
+; CHECK-NEXT: [[TMP221:%.*]] = insertelement <8 x float> [[TMP220]], float [[TMP213]], i32 1
+; CHECK-NEXT: [[TMP222:%.*]] = insertelement <8 x float> [[TMP221]], float [[TMP214]], i32 2
+; CHECK-NEXT: [[TMP223:%.*]] = insertelement <8 x float> [[TMP222]], float [[TMP215]], i32 3
+; CHECK-NEXT: [[TMP224:%.*]] = insertelement <8 x float> [[TMP223]], float [[TMP216]], i32 4
+; CHECK-NEXT: [[TMP225:%.*]] = insertelement <8 x float> [[TMP224]], float [[TMP217]], i32 5
+; CHECK-NEXT: [[TMP226:%.*]] = insertelement <8 x float> [[TMP225]], float [[TMP218]], i32 6
+; CHECK-NEXT: [[TMP227:%.*]] = insertelement <8 x float> [[TMP226]], float [[TMP219]], i32 7
; CHECK-NEXT: [[TMP228:%.*]] = fadd fast <8 x float> [[TMP83]], [[VEC_PHI]]
; CHECK-NEXT: [[TMP229:%.*]] = fadd fast <8 x float> [[TMP99]], [[VEC_PHI2]]
; CHECK-NEXT: [[TMP230:%.*]] = fadd fast <8 x float> [[TMP115]], [[VEC_PHI3]]
@@ -343,7 +343,7 @@ define float @PR27826(ptr nocapture readonly %a, ptr nocapture readonly %b, i32
; CHECK-NEXT: [[N_MOD_VF7:%.*]] = and i64 [[TMP2]], 7
; CHECK-NEXT: [[N_VEC8:%.*]] = sub i64 [[TMP2]], [[N_MOD_VF7]]
; CHECK-NEXT: [[TMP238:%.*]] = shl i64 [[N_VEC8]], 5
-; CHECK-NEXT: [[TMP239:%.*]] = insertelement <8 x float> zeroinitializer, float [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP239:%.*]] = insertelement <8 x float> zeroinitializer, float [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX9:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT11:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
@@ -372,14 +372,14 @@ define float @PR27826(ptr nocapture readonly %a, ptr nocapture readonly %b, i32
; CHECK-NEXT: [[TMP281:%.*]] = load float, ptr [[TMP253]], align 4
; CHECK-NEXT: [[TMP282:%.*]] = load float, ptr [[TMP254]], align 4
; CHECK-NEXT: [[TMP283:%.*]] = load float, ptr [[TMP255]], align 4
-; CHECK-NEXT: [[TMP264:%.*]] = insertelement <8 x float> poison, float [[TMP248]], i64 0
-; CHECK-NEXT: [[TMP265:%.*]] = insertelement <8 x float> [[TMP264]], float [[TMP249]], i64 1
-; CHECK-NEXT: [[TMP266:%.*]] = insertelement <8 x float> [[TMP265]], float [[TMP250]], i64 2
-; CHECK-NEXT: [[TMP267:%.*]] = insertelement <8 x float> [[TMP266]], float [[TMP251]], i64 3
-; CHECK-NEXT: [[TMP268:%.*]] = insertelement <8 x float> [[TMP267]], float [[TMP280]], i64 4
-; CHECK-NEXT: [[TMP269:%.*]] = insertelement <8 x float> [[TMP268]], float [[TMP281]], i64 5
-; CHECK-NEXT: [[TMP298:%.*]] = insertelement <8 x float> [[TMP269]], float [[TMP282]], i64 6
-; CHECK-NEXT: [[TMP271:%.*]] = insertelement <8 x float> [[TMP298]], float [[TMP283]], i64 7
+; CHECK-NEXT: [[TMP264:%.*]] = insertelement <8 x float> poison, float [[TMP248]], i32 0
+; CHECK-NEXT: [[TMP265:%.*]] = insertelement <8 x float> [[TMP264]], float [[TMP249]], i32 1
+; CHECK-NEXT: [[TMP266:%.*]] = insertelement <8 x float> [[TMP265]], float [[TMP250]], i32 2
+; CHECK-NEXT: [[TMP267:%.*]] = insertelement <8 x float> [[TMP266]], float [[TMP251]], i32 3
+; CHECK-NEXT: [[TMP268:%.*]] = insertelement <8 x float> [[TMP267]], float [[TMP280]], i32 4
+; CHECK-NEXT: [[TMP269:%.*]] = insertelement <8 x float> [[TMP268]], float [[TMP281]], i32 5
+; CHECK-NEXT: [[TMP298:%.*]] = insertelement <8 x float> [[TMP269]], float [[TMP282]], i32 6
+; CHECK-NEXT: [[TMP271:%.*]] = insertelement <8 x float> [[TMP298]], float [[TMP283]], i32 7
; CHECK-NEXT: [[TMP256:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[TMP240]]
; CHECK-NEXT: [[TMP257:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[TMP241]]
; CHECK-NEXT: [[TMP258:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[TMP242]]
@@ -396,14 +396,14 @@ define float @PR27826(ptr nocapture readonly %a, ptr nocapture readonly %b, i32
; CHECK-NEXT: [[TMP285:%.*]] = load float, ptr [[TMP277]], align 4
; CHECK-NEXT: [[TMP286:%.*]] = load float, ptr [[TMP278]], align 4
; CHECK-NEXT: [[TMP287:%.*]] = load float, ptr [[TMP279]], align 4
-; CHECK-NEXT: [[TMP288:%.*]] = insertelement <8 x float> poison, float [[TMP260]], i64 0
-; CHECK-NEXT: [[TMP289:%.*]] = insertelement <8 x float> [[TMP288]], float [[TMP261]], i64 1
-; CHECK-NEXT: [[TMP290:%.*]] = insertelement <8 x float> [[TMP289]], float [[TMP262]], i64 2
-; CHECK-NEXT: [[TMP291:%.*]] = insertelement <8 x float> [[TMP290]], float [[TMP263]], i64 3
-; CHECK-NEXT: [[TMP292:%.*]] = insertelement <8 x float> [[TMP291]], float [[TMP284]], i64 4
-; CHECK-NEXT: [[TMP293:%.*]] = insertelement <8 x float> [[TMP292]], float [[TMP285]], i64 5
-; CHECK-NEXT: [[TMP294:%.*]] = insertelement <8 x float> [[TMP293]], float [[TMP286]], i64 6
-; CHECK-NEXT: [[TMP295:%.*]] = insertelement <8 x float> [[TMP294]], float [[TMP287]], i64 7
+; CHECK-NEXT: [[TMP288:%.*]] = insertelement <8 x float> poison, float [[TMP260]], i32 0
+; CHECK-NEXT: [[TMP289:%.*]] = insertelement <8 x float> [[TMP288]], float [[TMP261]], i32 1
+; CHECK-NEXT: [[TMP290:%.*]] = insertelement <8 x float> [[TMP289]], float [[TMP262]], i32 2
+; CHECK-NEXT: [[TMP291:%.*]] = insertelement <8 x float> [[TMP290]], float [[TMP263]], i32 3
+; CHECK-NEXT: [[TMP292:%.*]] = insertelement <8 x float> [[TMP291]], float [[TMP284]], i32 4
+; CHECK-NEXT: [[TMP293:%.*]] = insertelement <8 x float> [[TMP292]], float [[TMP285]], i32 5
+; CHECK-NEXT: [[TMP294:%.*]] = insertelement <8 x float> [[TMP293]], float [[TMP286]], i32 6
+; CHECK-NEXT: [[TMP295:%.*]] = insertelement <8 x float> [[TMP294]], float [[TMP287]], i32 7
; CHECK-NEXT: [[TMP296:%.*]] = fadd fast <8 x float> [[TMP271]], [[VEC_PHI10]]
; CHECK-NEXT: [[TMP297]] = fadd fast <8 x float> [[TMP296]], [[TMP295]]
; CHECK-NEXT: [[INDEX_NEXT11]] = add nuw i64 [[INDEX9]], 8
@@ -582,12 +582,12 @@ define i1 @any_of_cost(ptr %start, ptr %end) #0 {
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr i8, ptr [[NEXT_GEP6]], i64 8
; CHECK-NEXT: [[TMP15:%.*]] = load ptr, ptr [[TMP11]], align 8
; CHECK-NEXT: [[TMP16:%.*]] = load ptr, ptr [[TMP12]], align 8
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <2 x ptr> poison, ptr [[TMP15]], i64 0
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <2 x ptr> [[TMP17]], ptr [[TMP16]], i64 1
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <2 x ptr> poison, ptr [[TMP15]], i32 0
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <2 x ptr> [[TMP17]], ptr [[TMP16]], i32 1
; CHECK-NEXT: [[TMP19:%.*]] = load ptr, ptr [[TMP13]], align 8
; CHECK-NEXT: [[TMP20:%.*]] = load ptr, ptr [[TMP14]], align 8
-; CHECK-NEXT: [[TMP21:%.*]] = insertelement <2 x ptr> poison, ptr [[TMP19]], i64 0
-; CHECK-NEXT: [[TMP22:%.*]] = insertelement <2 x ptr> [[TMP21]], ptr [[TMP20]], i64 1
+; CHECK-NEXT: [[TMP21:%.*]] = insertelement <2 x ptr> poison, ptr [[TMP19]], i32 0
+; CHECK-NEXT: [[TMP22:%.*]] = insertelement <2 x ptr> [[TMP21]], ptr [[TMP20]], i32 1
; CHECK-NEXT: [[TMP23:%.*]] = icmp ne <2 x ptr> [[TMP18]], splat (ptr null)
; CHECK-NEXT: [[TMP24:%.*]] = icmp ne <2 x ptr> [[TMP22]], splat (ptr null)
; CHECK-NEXT: [[TMP25]] = or <2 x i1> [[VEC_PHI]], [[TMP23]]
@@ -940,7 +940,7 @@ define i32 @g(i64 %n) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP20]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF7:%.*]] = and i32 [[TMP1]], 3
; CHECK-NEXT: [[N_VEC8:%.*]] = sub i32 [[TMP1]], [[N_MOD_VF7]]
-; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: [[BROADCAST_SPLATINSERT9:%.*]] = insertelement <4 x i64> poison, i64 [[N]], i64 0
; CHECK-NEXT: [[BROADCAST_SPLAT10:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT9]], <4 x i64> poison, <4 x i32> zeroinitializer
; CHECK-NEXT: [[BROADCAST_SPLATINSERT11:%.*]] = insertelement <4 x i32> poison, i32 [[VEC_EPILOG_RESUME_VAL]], i64 0
diff --git a/llvm/test/Transforms/LoopVectorize/X86/drop-poison-generating-flags.ll b/llvm/test/Transforms/LoopVectorize/X86/drop-poison-generating-flags.ll
index 80b33329bbceb..241b66ef30c07 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/drop-poison-generating-flags.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/drop-poison-generating-flags.ll
@@ -294,10 +294,10 @@ define void @drop_nonvector_nuw_nsw_avx1(ptr noalias nocapture readonly %input,
; CHECK-NEXT: [[TMP11:%.*]] = getelementptr float, ptr [[INPUT]], i64 [[TMP7]]
; CHECK-NEXT: [[TMP12:%.*]] = getelementptr float, ptr [[INPUT]], i64 [[TMP8]]
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr float, ptr [[INPUT]], i64 [[TMP9]]
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x ptr> poison, ptr [[TMP10]], i64 0
-; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x ptr> [[TMP14]], ptr [[TMP11]], i64 1
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x ptr> [[TMP15]], ptr [[TMP12]], i64 2
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x ptr> [[TMP16]], ptr [[TMP13]], i64 3
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x ptr> poison, ptr [[TMP10]], i32 0
+; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x ptr> [[TMP14]], ptr [[TMP11]], i32 1
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x ptr> [[TMP15]], ptr [[TMP12]], i32 2
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x ptr> [[TMP16]], ptr [[TMP13]], i32 3
; CHECK-NEXT: store <4 x ptr> [[TMP17]], ptr [[PTRS]], align 8
; CHECK-NEXT: [[WIDE_MASKED_LOAD:%.*]] = call <4 x float> @llvm.masked.load.v4f32.p0(ptr align 4 [[TMP10]], <4 x i1> <i1 false, i1 true, i1 true, i1 true>, <4 x float> poison), !invariant.load [[META0]]
; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> <i1 false, i1 true, i1 true, i1 true>, <4 x float> [[WIDE_MASKED_LOAD]], <4 x float> zeroinitializer
diff --git a/llvm/test/Transforms/LoopVectorize/X86/fixed-order-recurrence.ll b/llvm/test/Transforms/LoopVectorize/X86/fixed-order-recurrence.ll
index cf081d726faaa..b72e83bb8b9c8 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/fixed-order-recurrence.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/fixed-order-recurrence.ll
@@ -365,18 +365,18 @@ define void @test_for_tried_to_force_scalar(ptr noalias %A, ptr noalias %B, ptr
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr nusw [3 x float], ptr [[A]], i64 [[TMP6]]
; CHECK-NEXT: [[TMP15:%.*]] = getelementptr nusw [3 x float], ptr [[A]], i64 [[TMP7]]
; CHECK-NEXT: [[TMP16:%.*]] = getelementptr nusw [3 x float], ptr [[A]], i64 [[TMP8]]
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x ptr> poison, ptr [[TMP13]], i64 0
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x ptr> [[TMP17]], ptr [[TMP14]], i64 1
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x ptr> [[TMP18]], ptr [[TMP15]], i64 2
-; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x ptr> [[TMP19]], ptr [[TMP16]], i64 3
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x ptr> poison, ptr [[TMP13]], i32 0
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x ptr> [[TMP17]], ptr [[TMP14]], i32 1
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x ptr> [[TMP18]], ptr [[TMP15]], i32 2
+; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x ptr> [[TMP19]], ptr [[TMP16]], i32 3
; CHECK-NEXT: [[TMP21:%.*]] = getelementptr nusw [3 x float], ptr [[A]], i64 [[TMP9]]
; CHECK-NEXT: [[TMP22:%.*]] = getelementptr nusw [3 x float], ptr [[A]], i64 [[TMP10]]
; CHECK-NEXT: [[TMP23:%.*]] = getelementptr nusw [3 x float], ptr [[A]], i64 [[TMP11]]
; CHECK-NEXT: [[TMP24:%.*]] = getelementptr nusw [3 x float], ptr [[A]], i64 [[TMP12]]
-; CHECK-NEXT: [[TMP25:%.*]] = insertelement <4 x ptr> poison, ptr [[TMP21]], i64 0
-; CHECK-NEXT: [[TMP26:%.*]] = insertelement <4 x ptr> [[TMP25]], ptr [[TMP22]], i64 1
-; CHECK-NEXT: [[TMP27:%.*]] = insertelement <4 x ptr> [[TMP26]], ptr [[TMP23]], i64 2
-; CHECK-NEXT: [[TMP28:%.*]] = insertelement <4 x ptr> [[TMP27]], ptr [[TMP24]], i64 3
+; CHECK-NEXT: [[TMP25:%.*]] = insertelement <4 x ptr> poison, ptr [[TMP21]], i32 0
+; CHECK-NEXT: [[TMP26:%.*]] = insertelement <4 x ptr> [[TMP25]], ptr [[TMP22]], i32 1
+; CHECK-NEXT: [[TMP27:%.*]] = insertelement <4 x ptr> [[TMP26]], ptr [[TMP23]], i32 2
+; CHECK-NEXT: [[TMP28:%.*]] = insertelement <4 x ptr> [[TMP27]], ptr [[TMP24]], i32 3
; CHECK-NEXT: [[TMP29:%.*]] = shufflevector <4 x ptr> [[TMP20]], <4 x ptr> [[TMP28]], <4 x i32> <i32 3, i32 4, i32 5, i32 6>
; CHECK-NEXT: [[WIDE_VEC:%.*]] = load <12 x float>, ptr [[TMP21]], align 4
; CHECK-NEXT: [[STRIDED_VEC:%.*]] = shufflevector <12 x float> [[WIDE_VEC]], <12 x float> poison, <4 x i32> <i32 0, i32 3, i32 6, i32 9>
diff --git a/llvm/test/Transforms/LoopVectorize/X86/gather-cost.ll b/llvm/test/Transforms/LoopVectorize/X86/gather-cost.ll
index 6dcf5bcd9dce8..32177827a15ed 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/gather-cost.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/gather-cost.ll
@@ -62,18 +62,18 @@ define float @_Z4testmm(i64 %size, i64 %offset) {
; CHECK-NEXT: [[TMP33:%.*]] = load float, ptr [[TMP25]], align 4
; CHECK-NEXT: [[TMP34:%.*]] = load float, ptr [[TMP26]], align 4
; CHECK-NEXT: [[TMP35:%.*]] = load float, ptr [[TMP27]], align 4
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x float> poison, float [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x float> [[TMP36]], float [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x float> [[TMP37]], float [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x float> [[TMP38]], float [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x float> poison, float [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x float> [[TMP36]], float [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x float> [[TMP37]], float [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x float> [[TMP38]], float [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load float, ptr [[TMP28]], align 4
; CHECK-NEXT: [[TMP41:%.*]] = load float, ptr [[TMP29]], align 4
; CHECK-NEXT: [[TMP42:%.*]] = load float, ptr [[TMP30]], align 4
; CHECK-NEXT: [[TMP43:%.*]] = load float, ptr [[TMP31]], align 4
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x float> poison, float [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x float> [[TMP44]], float [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x float> [[TMP45]], float [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x float> [[TMP46]], float [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x float> poison, float [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x float> [[TMP44]], float [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x float> [[TMP45]], float [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x float> [[TMP46]], float [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = getelementptr inbounds [512 x float], ptr @kernel, i64 0, i64 [[INDEX]]
; CHECK-NEXT: [[TMP49:%.*]] = getelementptr inbounds float, ptr [[TMP48]], i64 4
; CHECK-NEXT: [[WIDE_LOAD:%.*]] = load <4 x float>, ptr [[TMP48]], align 4
@@ -120,18 +120,18 @@ define float @_Z4testmm(i64 %size, i64 %offset) {
; CHECK-NEXT: [[TMP83:%.*]] = load float, ptr [[TMP75]], align 4
; CHECK-NEXT: [[TMP84:%.*]] = load float, ptr [[TMP76]], align 4
; CHECK-NEXT: [[TMP85:%.*]] = load float, ptr [[TMP77]], align 4
-; CHECK-NEXT: [[TMP86:%.*]] = insertelement <4 x float> poison, float [[TMP82]], i64 0
-; CHECK-NEXT: [[TMP87:%.*]] = insertelement <4 x float> [[TMP86]], float [[TMP83]], i64 1
-; CHECK-NEXT: [[TMP88:%.*]] = insertelement <4 x float> [[TMP87]], float [[TMP84]], i64 2
-; CHECK-NEXT: [[TMP89:%.*]] = insertelement <4 x float> [[TMP88]], float [[TMP85]], i64 3
+; CHECK-NEXT: [[TMP86:%.*]] = insertelement <4 x float> poison, float [[TMP82]], i32 0
+; CHECK-NEXT: [[TMP87:%.*]] = insertelement <4 x float> [[TMP86]], float [[TMP83]], i32 1
+; CHECK-NEXT: [[TMP88:%.*]] = insertelement <4 x float> [[TMP87]], float [[TMP84]], i32 2
+; CHECK-NEXT: [[TMP89:%.*]] = insertelement <4 x float> [[TMP88]], float [[TMP85]], i32 3
; CHECK-NEXT: [[TMP90:%.*]] = load float, ptr [[TMP78]], align 4
; CHECK-NEXT: [[TMP91:%.*]] = load float, ptr [[TMP79]], align 4
; CHECK-NEXT: [[TMP92:%.*]] = load float, ptr [[TMP80]], align 4
; CHECK-NEXT: [[TMP93:%.*]] = load float, ptr [[TMP81]], align 4
-; CHECK-NEXT: [[TMP94:%.*]] = insertelement <4 x float> poison, float [[TMP90]], i64 0
-; CHECK-NEXT: [[TMP95:%.*]] = insertelement <4 x float> [[TMP94]], float [[TMP91]], i64 1
-; CHECK-NEXT: [[TMP96:%.*]] = insertelement <4 x float> [[TMP95]], float [[TMP92]], i64 2
-; CHECK-NEXT: [[TMP97:%.*]] = insertelement <4 x float> [[TMP96]], float [[TMP93]], i64 3
+; CHECK-NEXT: [[TMP94:%.*]] = insertelement <4 x float> poison, float [[TMP90]], i32 0
+; CHECK-NEXT: [[TMP95:%.*]] = insertelement <4 x float> [[TMP94]], float [[TMP91]], i32 1
+; CHECK-NEXT: [[TMP96:%.*]] = insertelement <4 x float> [[TMP95]], float [[TMP92]], i32 2
+; CHECK-NEXT: [[TMP97:%.*]] = insertelement <4 x float> [[TMP96]], float [[TMP93]], i32 3
; CHECK-NEXT: [[TMP98:%.*]] = fmul fast <4 x float> [[WIDE_LOAD]], [[TMP89]]
; CHECK-NEXT: [[TMP99:%.*]] = fmul fast <4 x float> [[WIDE_LOAD6]], [[TMP97]]
; CHECK-NEXT: [[TMP100:%.*]] = fmul fast <4 x float> [[WIDE_LOAD7]], [[TMP98]]
@@ -162,18 +162,18 @@ define float @_Z4testmm(i64 %size, i64 %offset) {
; CHECK-NEXT: [[TMP125:%.*]] = load float, ptr [[TMP117]], align 4
; CHECK-NEXT: [[TMP126:%.*]] = load float, ptr [[TMP118]], align 4
; CHECK-NEXT: [[TMP127:%.*]] = load float, ptr [[TMP119]], align 4
-; CHECK-NEXT: [[TMP128:%.*]] = insertelement <4 x float> poison, float [[TMP124]], i64 0
-; CHECK-NEXT: [[TMP129:%.*]] = insertelement <4 x float> [[TMP128]], float [[TMP125]], i64 1
-; CHECK-NEXT: [[TMP130:%.*]] = insertelement <4 x float> [[TMP129]], float [[TMP126]], i64 2
-; CHECK-NEXT: [[TMP131:%.*]] = insertelement <4 x float> [[TMP130]], float [[TMP127]], i64 3
+; CHECK-NEXT: [[TMP128:%.*]] = insertelement <4 x float> poison, float [[TMP124]], i32 0
+; CHECK-NEXT: [[TMP129:%.*]] = insertelement <4 x float> [[TMP128]], float [[TMP125]], i32 1
+; CHECK-NEXT: [[TMP130:%.*]] = insertelement <4 x float> [[TMP129]], float [[TMP126]], i32 2
+; CHECK-NEXT: [[TMP131:%.*]] = insertelement <4 x float> [[TMP130]], float [[TMP127]], i32 3
; CHECK-NEXT: [[TMP132:%.*]] = load float, ptr [[TMP120]], align 4
; CHECK-NEXT: [[TMP133:%.*]] = load float, ptr [[TMP121]], align 4
; CHECK-NEXT: [[TMP134:%.*]] = load float, ptr [[TMP122]], align 4
; CHECK-NEXT: [[TMP135:%.*]] = load float, ptr [[TMP123]], align 4
-; CHECK-NEXT: [[TMP136:%.*]] = insertelement <4 x float> poison, float [[TMP132]], i64 0
-; CHECK-NEXT: [[TMP137:%.*]] = insertelement <4 x float> [[TMP136]], float [[TMP133]], i64 1
-; CHECK-NEXT: [[TMP138:%.*]] = insertelement <4 x float> [[TMP137]], float [[TMP134]], i64 2
-; CHECK-NEXT: [[TMP139:%.*]] = insertelement <4 x float> [[TMP138]], float [[TMP135]], i64 3
+; CHECK-NEXT: [[TMP136:%.*]] = insertelement <4 x float> poison, float [[TMP132]], i32 0
+; CHECK-NEXT: [[TMP137:%.*]] = insertelement <4 x float> [[TMP136]], float [[TMP133]], i32 1
+; CHECK-NEXT: [[TMP138:%.*]] = insertelement <4 x float> [[TMP137]], float [[TMP134]], i32 2
+; CHECK-NEXT: [[TMP139:%.*]] = insertelement <4 x float> [[TMP138]], float [[TMP135]], i32 3
; CHECK-NEXT: [[TMP140:%.*]] = fmul fast <4 x float> [[WIDE_LOAD]], [[TMP131]]
; CHECK-NEXT: [[TMP141:%.*]] = fmul fast <4 x float> [[WIDE_LOAD6]], [[TMP139]]
; CHECK-NEXT: [[TMP142:%.*]] = fmul fast <4 x float> [[WIDE_LOAD7]], [[TMP140]]
diff --git a/llvm/test/Transforms/LoopVectorize/X86/gather_scatter.ll b/llvm/test/Transforms/LoopVectorize/X86/gather_scatter.ll
index 40a92bbb802f0..975cf698aa102 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/gather_scatter.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/gather_scatter.ll
@@ -155,8 +155,8 @@ define void @foo2(ptr noalias %in, ptr noalias %out, ptr noalias %trigger, ptr n
; FVW2-NEXT: [[TMP3:%.*]] = getelementptr inbounds i32, ptr [[TRIGGER]], i64 [[TMP1]]
; FVW2-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP2]], align 4
; FVW2-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP3]], align 4
-; FVW2-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP4]], i64 0
-; FVW2-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP5]], i64 1
+; FVW2-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP4]], i32 0
+; FVW2-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP5]], i32 1
; FVW2-NEXT: [[TMP8:%.*]] = icmp sgt <2 x i32> [[TMP7]], zeroinitializer
; FVW2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT_IN:%.*]], ptr [[IN:%.*]], <2 x i64> [[VEC_IND]], i32 1
; FVW2-NEXT: [[WIDE_MASKED_GATHER:%.*]] = call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> align 4 [[TMP9]], <2 x i1> [[TMP8]], <2 x float> poison)
@@ -269,8 +269,8 @@ define void @foo3(ptr noalias %in, ptr noalias %out, ptr noalias %trigger) {
; FVW2-NEXT: [[TMP3:%.*]] = getelementptr inbounds i32, ptr [[TRIGGER]], i64 [[TMP1]]
; FVW2-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP2]], align 4
; FVW2-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP3]], align 4
-; FVW2-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP4]], i64 0
-; FVW2-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP5]], i64 1
+; FVW2-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP4]], i32 0
+; FVW2-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP5]], i32 1
; FVW2-NEXT: [[TMP8:%.*]] = icmp sgt <2 x i32> [[TMP7]], zeroinitializer
; FVW2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT_IN:%.*]], ptr [[IN:%.*]], <2 x i64> [[VEC_IND]], i32 1
; FVW2-NEXT: [[WIDE_MASKED_GATHER:%.*]] = call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> align 4 [[TMP9]], <2 x i1> [[TMP8]], <2 x float> poison)
@@ -369,8 +369,8 @@ define void @foo2_addrspace(ptr addrspace(1) noalias %in, ptr addrspace(1) noali
; FVW2-NEXT: [[TMP3:%.*]] = getelementptr inbounds i32, ptr [[TRIGGER]], i64 [[TMP1]]
; FVW2-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP2]], align 4
; FVW2-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP3]], align 4
-; FVW2-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP4]], i64 0
-; FVW2-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP5]], i64 1
+; FVW2-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP4]], i32 0
+; FVW2-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP5]], i32 1
; FVW2-NEXT: [[TMP8:%.*]] = icmp sgt <2 x i32> [[TMP7]], zeroinitializer
; FVW2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT_IN:%.*]], ptr addrspace(1) [[IN:%.*]], <2 x i64> [[VEC_IND]], i32 1
; FVW2-NEXT: [[WIDE_MASKED_GATHER:%.*]] = call <2 x float> @llvm.masked.gather.v2f32.v2p1(<2 x ptr addrspace(1)> align 4 [[TMP9]], <2 x i1> [[TMP8]], <2 x float> poison)
@@ -469,8 +469,8 @@ define void @foo2_addrspace2(ptr addrspace(1) noalias %in, ptr addrspace(0) noal
; FVW2-NEXT: [[TMP3:%.*]] = getelementptr inbounds i32, ptr [[TRIGGER]], i64 [[TMP1]]
; FVW2-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP2]], align 4
; FVW2-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP3]], align 4
-; FVW2-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP4]], i64 0
-; FVW2-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP5]], i64 1
+; FVW2-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP4]], i32 0
+; FVW2-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP5]], i32 1
; FVW2-NEXT: [[TMP8:%.*]] = icmp sgt <2 x i32> [[TMP7]], zeroinitializer
; FVW2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT_IN:%.*]], ptr addrspace(1) [[IN:%.*]], <2 x i64> [[VEC_IND]], i32 1
; FVW2-NEXT: [[WIDE_MASKED_GATHER:%.*]] = call <2 x float> @llvm.masked.gather.v2f32.v2p1(<2 x ptr addrspace(1)> align 4 [[TMP9]], <2 x i1> [[TMP8]], <2 x float> poison)
@@ -569,8 +569,8 @@ define void @foo2_addrspace3(ptr addrspace(0) noalias %in, ptr addrspace(1) noal
; FVW2-NEXT: [[TMP3:%.*]] = getelementptr inbounds i32, ptr [[TRIGGER]], i64 [[TMP1]]
; FVW2-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP2]], align 4
; FVW2-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP3]], align 4
-; FVW2-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP4]], i64 0
-; FVW2-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP5]], i64 1
+; FVW2-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP4]], i32 0
+; FVW2-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP5]], i32 1
; FVW2-NEXT: [[TMP8:%.*]] = icmp sgt <2 x i32> [[TMP7]], zeroinitializer
; FVW2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT_IN:%.*]], ptr [[IN:%.*]], <2 x i64> [[VEC_IND]], i32 1
; FVW2-NEXT: [[WIDE_MASKED_GATHER:%.*]] = call <2 x float> @llvm.masked.gather.v2f32.v2p0(<2 x ptr> align 4 [[TMP9]], <2 x i1> [[TMP8]], <2 x float> poison)
diff --git a/llvm/test/Transforms/LoopVectorize/X86/interleaved-accesses-hoist-load-across-store.ll b/llvm/test/Transforms/LoopVectorize/X86/interleaved-accesses-hoist-load-across-store.ll
index 582b72a5cb5c5..1a7355502cbdb 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/interleaved-accesses-hoist-load-across-store.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/interleaved-accesses-hoist-load-across-store.ll
@@ -57,18 +57,18 @@ define void @pr63602_1(ptr %arr) {
; CHECK-NEXT: [[TMP34:%.*]] = load i32, ptr [[TMP30]], align 4
; CHECK-NEXT: [[TMP35:%.*]] = load i32, ptr [[TMP31]], align 4
; CHECK-NEXT: [[TMP36:%.*]] = load i32, ptr [[TMP32]], align 4
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i32> poison, i32 [[TMP33]], i64 0
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i32> [[TMP37]], i32 [[TMP34]], i64 1
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i32> [[TMP38]], i32 [[TMP35]], i64 2
-; CHECK-NEXT: [[TMP40:%.*]] = insertelement <4 x i32> [[TMP39]], i32 [[TMP36]], i64 3
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i32> poison, i32 [[TMP33]], i32 0
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i32> [[TMP37]], i32 [[TMP34]], i32 1
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i32> [[TMP38]], i32 [[TMP35]], i32 2
+; CHECK-NEXT: [[TMP40:%.*]] = insertelement <4 x i32> [[TMP39]], i32 [[TMP36]], i32 3
; CHECK-NEXT: [[TMP41:%.*]] = load i32, ptr [[TMP21]], align 4
; CHECK-NEXT: [[TMP42:%.*]] = load i32, ptr [[TMP22]], align 4
; CHECK-NEXT: [[TMP43:%.*]] = load i32, ptr [[TMP23]], align 4
; CHECK-NEXT: [[TMP44:%.*]] = load i32, ptr [[TMP24]], align 4
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i32> poison, i32 [[TMP41]], i64 0
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i32> [[TMP45]], i32 [[TMP42]], i64 1
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i32> [[TMP46]], i32 [[TMP43]], i64 2
-; CHECK-NEXT: [[TMP48:%.*]] = insertelement <4 x i32> [[TMP47]], i32 [[TMP44]], i64 3
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i32> poison, i32 [[TMP41]], i32 0
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i32> [[TMP45]], i32 [[TMP42]], i32 1
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i32> [[TMP46]], i32 [[TMP43]], i32 2
+; CHECK-NEXT: [[TMP48:%.*]] = insertelement <4 x i32> [[TMP47]], i32 [[TMP44]], i32 3
; CHECK-NEXT: [[TMP49:%.*]] = add <4 x i32> [[TMP48]], [[TMP40]]
; CHECK-NEXT: [[TMP50:%.*]] = extractelement <4 x i32> [[TMP49]], i64 0
; CHECK-NEXT: store i32 [[TMP50]], ptr [[TMP21]], align 4
@@ -190,18 +190,18 @@ define void @pr63602_2(ptr %arr) {
; CHECK-NEXT: [[TMP34:%.*]] = load i32, ptr [[TMP22]], align 4
; CHECK-NEXT: [[TMP35:%.*]] = load i32, ptr [[TMP23]], align 4
; CHECK-NEXT: [[TMP36:%.*]] = load i32, ptr [[TMP24]], align 4
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i32> poison, i32 [[TMP33]], i64 0
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i32> [[TMP37]], i32 [[TMP34]], i64 1
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i32> [[TMP38]], i32 [[TMP35]], i64 2
-; CHECK-NEXT: [[TMP40:%.*]] = insertelement <4 x i32> [[TMP39]], i32 [[TMP36]], i64 3
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i32> poison, i32 [[TMP33]], i32 0
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i32> [[TMP37]], i32 [[TMP34]], i32 1
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i32> [[TMP38]], i32 [[TMP35]], i32 2
+; CHECK-NEXT: [[TMP40:%.*]] = insertelement <4 x i32> [[TMP39]], i32 [[TMP36]], i32 3
; CHECK-NEXT: [[TMP41:%.*]] = load i32, ptr [[TMP29]], align 4
; CHECK-NEXT: [[TMP42:%.*]] = load i32, ptr [[TMP30]], align 4
; CHECK-NEXT: [[TMP43:%.*]] = load i32, ptr [[TMP31]], align 4
; CHECK-NEXT: [[TMP44:%.*]] = load i32, ptr [[TMP32]], align 4
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i32> poison, i32 [[TMP41]], i64 0
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i32> [[TMP45]], i32 [[TMP42]], i64 1
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i32> [[TMP46]], i32 [[TMP43]], i64 2
-; CHECK-NEXT: [[TMP48:%.*]] = insertelement <4 x i32> [[TMP47]], i32 [[TMP44]], i64 3
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i32> poison, i32 [[TMP41]], i32 0
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i32> [[TMP45]], i32 [[TMP42]], i32 1
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i32> [[TMP46]], i32 [[TMP43]], i32 2
+; CHECK-NEXT: [[TMP48:%.*]] = insertelement <4 x i32> [[TMP47]], i32 [[TMP44]], i32 3
; CHECK-NEXT: [[TMP49:%.*]] = add <4 x i32> [[TMP40]], [[TMP48]]
; CHECK-NEXT: [[TMP50:%.*]] = extractelement <4 x i32> [[TMP49]], i64 0
; CHECK-NEXT: store i32 [[TMP50]], ptr [[TMP21]], align 4
diff --git a/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll b/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
index 3858aca343564..2cd57a8d0f7f1 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
@@ -68,7 +68,7 @@ define i32 @inv_val_store_to_inv_address_with_reduction(ptr %a, i64 %n, ptr %b)
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP10]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF12:%.*]] = and i64 [[SMAX2]], 7
; CHECK-NEXT: [[N_VEC13:%.*]] = sub i64 [[SMAX2]], [[N_MOD_VF12]]
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <8 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <8 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX14:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT17:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
@@ -428,7 +428,7 @@ define void @test_store_of_final_reduction_value(i64 %x, ptr %dst) {
; CHECK: [[VEC_EPILOG_PH]]:
; CHECK-NEXT: [[VEC_EPILOG_RESUME_VAL:%.*]] = phi i64 [ 96, %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i64 [ [[TMP1]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
-; CHECK-NEXT: [[TMP6:%.*]] = insertelement <4 x i64> splat (i64 1), i64 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <4 x i64> splat (i64 1), i64 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: [[BROADCAST_SPLATINSERT6:%.*]] = insertelement <4 x i64> poison, i64 [[X]], i64 0
; CHECK-NEXT: [[BROADCAST_SPLAT7:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT6]], <4 x i64> poison, <4 x i32> zeroinitializer
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
diff --git a/llvm/test/Transforms/LoopVectorize/X86/invoke-in-preheader.ll b/llvm/test/Transforms/LoopVectorize/X86/invoke-in-preheader.ll
index 4c5c2906456b9..4baf87a706431 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/invoke-in-preheader.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/invoke-in-preheader.ll
@@ -35,7 +35,7 @@ define i32 @test_invoke_broadcast() #0 personality ptr @__gxx_personality_v0 {
; CHECK: [[VEC_EPILOG_PH]]:
; CHECK-NEXT: [[VEC_EPILOG_RESUME_VAL:%.*]] = phi i64 [ 32, %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP1]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
-; CHECK-NEXT: [[TMP2:%.*]] = insertelement <4 x i32> splat (i32 1), i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP2:%.*]] = insertelement <4 x i32> splat (i32 1), i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: [[BROADCAST_SPLATINSERT5:%.*]] = insertelement <4 x i32> poison, i32 [[INVOKE]], i64 0
; CHECK-NEXT: [[BROADCAST_SPLAT6:%.*]] = shufflevector <4 x i32> [[BROADCAST_SPLATINSERT5]], <4 x i32> poison, <4 x i32> zeroinitializer
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
diff --git a/llvm/test/Transforms/LoopVectorize/X86/iv-live-outs.ll b/llvm/test/Transforms/LoopVectorize/X86/iv-live-outs.ll
index 94a48f086c16b..f47d1ab1c963e 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/iv-live-outs.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/iv-live-outs.ll
@@ -129,8 +129,8 @@ define i64 @reverse_load_liveout_only(ptr %A) {
; CHECK-NEXT: [[TMP1:%.*]] = add i64 [[TMP0]], -1
; CHECK-NEXT: [[TMP2:%.*]] = add i64 [[TMP0]], -1
; CHECK-NEXT: [[TMP3:%.*]] = add i64 [[TMP1]], -1
-; CHECK-NEXT: [[TMP4:%.*]] = insertelement <2 x i64> poison, i64 [[TMP2]], i64 0
-; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x i64> [[TMP4]], i64 [[TMP3]], i64 1
+; CHECK-NEXT: [[TMP4:%.*]] = insertelement <2 x i64> poison, i64 [[TMP2]], i32 0
+; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x i64> [[TMP4]], i64 [[TMP3]], i32 1
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr i32, ptr [[A]], i64 [[TMP0]]
; CHECK-NEXT: [[TMP7:%.*]] = getelementptr i8, ptr [[TMP6]], i64 4
; CHECK-NEXT: [[TMP8:%.*]] = getelementptr i32, ptr [[TMP7]], i64 -1
diff --git a/llvm/test/Transforms/LoopVectorize/X86/load-deref-pred.ll b/llvm/test/Transforms/LoopVectorize/X86/load-deref-pred.ll
index 411318d341de3..41491c1745292 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/load-deref-pred.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/load-deref-pred.ll
@@ -141,34 +141,34 @@ define i32 @test_explicit_pred_generic(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP33:%.*]] = load i1, ptr [[TMP17]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load i1, ptr [[TMP20]], align 1
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i1, ptr [[TMP24]], align 1
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP28]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: [[TMP64:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP69:%.*]] = getelementptr inbounds i32, ptr [[TMP64]], i64 4
; CHECK-NEXT: [[TMP70:%.*]] = getelementptr inbounds i32, ptr [[TMP64]], i64 8
@@ -237,10 +237,10 @@ define i32 @test_invariant_address(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP64:%.*]] = load i32, ptr [[ALLOCA]], align 4
; CHECK-NEXT: [[TMP65:%.*]] = load i32, ptr [[ALLOCA]], align 4
; CHECK-NEXT: [[TMP66:%.*]] = load i32, ptr [[ALLOCA]], align 4
-; CHECK-NEXT: [[TMP67:%.*]] = insertelement <4 x i32> poison, i32 [[TMP0]], i64 0
-; CHECK-NEXT: [[TMP68:%.*]] = insertelement <4 x i32> [[TMP67]], i32 [[TMP64]], i64 1
-; CHECK-NEXT: [[TMP69:%.*]] = insertelement <4 x i32> [[TMP68]], i32 [[TMP65]], i64 2
-; CHECK-NEXT: [[TMP71:%.*]] = insertelement <4 x i32> [[TMP69]], i32 [[TMP66]], i64 3
+; CHECK-NEXT: [[TMP67:%.*]] = insertelement <4 x i32> poison, i32 [[TMP0]], i32 0
+; CHECK-NEXT: [[TMP68:%.*]] = insertelement <4 x i32> [[TMP67]], i32 [[TMP64]], i32 1
+; CHECK-NEXT: [[TMP69:%.*]] = insertelement <4 x i32> [[TMP68]], i32 [[TMP65]], i32 2
+; CHECK-NEXT: [[TMP71:%.*]] = insertelement <4 x i32> [[TMP69]], i32 [[TMP66]], i32 3
; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]
; CHECK: vector.body:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
@@ -283,34 +283,34 @@ define i32 @test_invariant_address(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP33:%.*]] = load i1, ptr [[TMP17]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load i1, ptr [[TMP20]], align 1
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i1, ptr [[TMP24]], align 1
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP28]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> [[TMP39]], <4 x i32> [[TMP71]], <4 x i32> zeroinitializer
; CHECK-NEXT: [[PREDPHI4:%.*]] = select <4 x i1> [[TMP47]], <4 x i32> [[TMP71]], <4 x i32> zeroinitializer
; CHECK-NEXT: [[PREDPHI5:%.*]] = select <4 x i1> [[TMP55]], <4 x i32> [[TMP71]], <4 x i32> zeroinitializer
@@ -405,34 +405,34 @@ define i32 @test_step_narrower_than_access(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP33:%.*]] = load i1, ptr [[TMP17]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load i1, ptr [[TMP20]], align 1
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i1, ptr [[TMP24]], align 1
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP28]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: br i1 [[TMP32]], label [[PRED_LOAD_IF:%.*]], label [[PRED_LOAD_CONTINUE:%.*]]
; CHECK: pred.load.if:
; CHECK-NEXT: [[TMP65:%.*]] = getelementptr inbounds i16, ptr [[ALLOCA]], i64 [[INDEX]]
@@ -661,34 +661,34 @@ define i32 @test_max_trip_count(i64 %len, ptr %test_base, i64 %n) {
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
; CHECK-NEXT: [[TMP36:%.*]] = load i1, ptr [[TMP20]], align 1
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> poison, i1 [[TMP33]], i64 0
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 1
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 2
-; CHECK-NEXT: [[TMP40:%.*]] = insertelement <4 x i1> [[TMP39]], i1 [[TMP36]], i64 3
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> poison, i1 [[TMP33]], i32 0
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 1
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 2
+; CHECK-NEXT: [[TMP40:%.*]] = insertelement <4 x i1> [[TMP39]], i1 [[TMP36]], i32 3
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
; CHECK-NEXT: [[TMP44:%.*]] = load i1, ptr [[TMP24]], align 1
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> poison, i1 [[TMP41]], i64 0
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 1
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 2
-; CHECK-NEXT: [[TMP48:%.*]] = insertelement <4 x i1> [[TMP47]], i1 [[TMP44]], i64 3
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> poison, i1 [[TMP41]], i32 0
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 1
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 2
+; CHECK-NEXT: [[TMP48:%.*]] = insertelement <4 x i1> [[TMP47]], i1 [[TMP44]], i32 3
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
; CHECK-NEXT: [[TMP52:%.*]] = load i1, ptr [[TMP28]], align 1
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> poison, i1 [[TMP49]], i64 0
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 1
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 2
-; CHECK-NEXT: [[TMP56:%.*]] = insertelement <4 x i1> [[TMP55]], i1 [[TMP52]], i64 3
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> poison, i1 [[TMP49]], i32 0
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 1
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 2
+; CHECK-NEXT: [[TMP56:%.*]] = insertelement <4 x i1> [[TMP55]], i1 [[TMP52]], i32 3
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
; CHECK-NEXT: [[TMP60:%.*]] = load i1, ptr [[TMP32]], align 1
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> poison, i1 [[TMP57]], i64 0
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 1
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 2
-; CHECK-NEXT: [[TMP64:%.*]] = insertelement <4 x i1> [[TMP63]], i1 [[TMP60]], i64 3
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> poison, i1 [[TMP57]], i32 0
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 1
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 2
+; CHECK-NEXT: [[TMP64:%.*]] = insertelement <4 x i1> [[TMP63]], i1 [[TMP60]], i32 3
; CHECK-NEXT: [[TMP65:%.*]] = getelementptr i32, ptr [[ALLOCA]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP70:%.*]] = getelementptr i32, ptr [[TMP65]], i64 4
; CHECK-NEXT: [[TMP71:%.*]] = getelementptr i32, ptr [[TMP65]], i64 8
@@ -819,34 +819,34 @@ define i32 @test_non_zero_start(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP33:%.*]] = load i1, ptr [[TMP17]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load i1, ptr [[TMP20]], align 1
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i1, ptr [[TMP24]], align 1
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP28]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: [[TMP64:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[OFFSET_IDX]]
; CHECK-NEXT: [[TMP69:%.*]] = getelementptr inbounds i32, ptr [[TMP64]], i64 4
; CHECK-NEXT: [[TMP70:%.*]] = getelementptr inbounds i32, ptr [[TMP64]], i64 8
@@ -1001,34 +1001,34 @@ define i32 @test_non_unit_stride(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP33:%.*]] = load i1, ptr [[TMP17]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load i1, ptr [[TMP20]], align 1
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i1, ptr [[TMP24]], align 1
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP28]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: [[TMP64:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[OFFSET_IDX]]
; CHECK-NEXT: [[TMP65:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP66:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[TMP2]]
@@ -1049,34 +1049,34 @@ define i32 @test_non_unit_stride(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP81:%.*]] = load i32, ptr [[TMP65]], align 4
; CHECK-NEXT: [[TMP82:%.*]] = load i32, ptr [[TMP66]], align 4
; CHECK-NEXT: [[TMP83:%.*]] = load i32, ptr [[TMP67]], align 4
-; CHECK-NEXT: [[TMP84:%.*]] = insertelement <4 x i32> poison, i32 [[TMP80]], i64 0
-; CHECK-NEXT: [[TMP85:%.*]] = insertelement <4 x i32> [[TMP84]], i32 [[TMP81]], i64 1
-; CHECK-NEXT: [[TMP86:%.*]] = insertelement <4 x i32> [[TMP85]], i32 [[TMP82]], i64 2
-; CHECK-NEXT: [[TMP87:%.*]] = insertelement <4 x i32> [[TMP86]], i32 [[TMP83]], i64 3
+; CHECK-NEXT: [[TMP84:%.*]] = insertelement <4 x i32> poison, i32 [[TMP80]], i32 0
+; CHECK-NEXT: [[TMP85:%.*]] = insertelement <4 x i32> [[TMP84]], i32 [[TMP81]], i32 1
+; CHECK-NEXT: [[TMP86:%.*]] = insertelement <4 x i32> [[TMP85]], i32 [[TMP82]], i32 2
+; CHECK-NEXT: [[TMP87:%.*]] = insertelement <4 x i32> [[TMP86]], i32 [[TMP83]], i32 3
; CHECK-NEXT: [[TMP88:%.*]] = load i32, ptr [[TMP68]], align 4
; CHECK-NEXT: [[TMP89:%.*]] = load i32, ptr [[TMP69]], align 4
; CHECK-NEXT: [[TMP90:%.*]] = load i32, ptr [[TMP70]], align 4
; CHECK-NEXT: [[TMP91:%.*]] = load i32, ptr [[TMP71]], align 4
-; CHECK-NEXT: [[TMP92:%.*]] = insertelement <4 x i32> poison, i32 [[TMP88]], i64 0
-; CHECK-NEXT: [[TMP93:%.*]] = insertelement <4 x i32> [[TMP92]], i32 [[TMP89]], i64 1
-; CHECK-NEXT: [[TMP94:%.*]] = insertelement <4 x i32> [[TMP93]], i32 [[TMP90]], i64 2
-; CHECK-NEXT: [[TMP95:%.*]] = insertelement <4 x i32> [[TMP94]], i32 [[TMP91]], i64 3
+; CHECK-NEXT: [[TMP92:%.*]] = insertelement <4 x i32> poison, i32 [[TMP88]], i32 0
+; CHECK-NEXT: [[TMP93:%.*]] = insertelement <4 x i32> [[TMP92]], i32 [[TMP89]], i32 1
+; CHECK-NEXT: [[TMP94:%.*]] = insertelement <4 x i32> [[TMP93]], i32 [[TMP90]], i32 2
+; CHECK-NEXT: [[TMP95:%.*]] = insertelement <4 x i32> [[TMP94]], i32 [[TMP91]], i32 3
; CHECK-NEXT: [[TMP96:%.*]] = load i32, ptr [[TMP72]], align 4
; CHECK-NEXT: [[TMP97:%.*]] = load i32, ptr [[TMP73]], align 4
; CHECK-NEXT: [[TMP98:%.*]] = load i32, ptr [[TMP74]], align 4
; CHECK-NEXT: [[TMP99:%.*]] = load i32, ptr [[TMP75]], align 4
-; CHECK-NEXT: [[TMP100:%.*]] = insertelement <4 x i32> poison, i32 [[TMP96]], i64 0
-; CHECK-NEXT: [[TMP101:%.*]] = insertelement <4 x i32> [[TMP100]], i32 [[TMP97]], i64 1
-; CHECK-NEXT: [[TMP102:%.*]] = insertelement <4 x i32> [[TMP101]], i32 [[TMP98]], i64 2
-; CHECK-NEXT: [[TMP103:%.*]] = insertelement <4 x i32> [[TMP102]], i32 [[TMP99]], i64 3
+; CHECK-NEXT: [[TMP100:%.*]] = insertelement <4 x i32> poison, i32 [[TMP96]], i32 0
+; CHECK-NEXT: [[TMP101:%.*]] = insertelement <4 x i32> [[TMP100]], i32 [[TMP97]], i32 1
+; CHECK-NEXT: [[TMP102:%.*]] = insertelement <4 x i32> [[TMP101]], i32 [[TMP98]], i32 2
+; CHECK-NEXT: [[TMP103:%.*]] = insertelement <4 x i32> [[TMP102]], i32 [[TMP99]], i32 3
; CHECK-NEXT: [[TMP104:%.*]] = load i32, ptr [[TMP76]], align 4
; CHECK-NEXT: [[TMP105:%.*]] = load i32, ptr [[TMP77]], align 4
; CHECK-NEXT: [[TMP106:%.*]] = load i32, ptr [[TMP78]], align 4
; CHECK-NEXT: [[TMP107:%.*]] = load i32, ptr [[TMP79]], align 4
-; CHECK-NEXT: [[TMP108:%.*]] = insertelement <4 x i32> poison, i32 [[TMP104]], i64 0
-; CHECK-NEXT: [[TMP109:%.*]] = insertelement <4 x i32> [[TMP108]], i32 [[TMP105]], i64 1
-; CHECK-NEXT: [[TMP110:%.*]] = insertelement <4 x i32> [[TMP109]], i32 [[TMP106]], i64 2
-; CHECK-NEXT: [[TMP111:%.*]] = insertelement <4 x i32> [[TMP110]], i32 [[TMP107]], i64 3
+; CHECK-NEXT: [[TMP108:%.*]] = insertelement <4 x i32> poison, i32 [[TMP104]], i32 0
+; CHECK-NEXT: [[TMP109:%.*]] = insertelement <4 x i32> [[TMP108]], i32 [[TMP105]], i32 1
+; CHECK-NEXT: [[TMP110:%.*]] = insertelement <4 x i32> [[TMP109]], i32 [[TMP106]], i32 2
+; CHECK-NEXT: [[TMP111:%.*]] = insertelement <4 x i32> [[TMP110]], i32 [[TMP107]], i32 3
; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> [[TMP39]], <4 x i32> [[TMP87]], <4 x i32> zeroinitializer
; CHECK-NEXT: [[PREDPHI4:%.*]] = select <4 x i1> [[TMP47]], <4 x i32> [[TMP95]], <4 x i32> zeroinitializer
; CHECK-NEXT: [[PREDPHI5:%.*]] = select <4 x i1> [[TMP55]], <4 x i32> [[TMP103]], <4 x i32> zeroinitializer
@@ -1171,34 +1171,34 @@ define i32 @neg_off_by_many(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP33:%.*]] = load i1, ptr [[TMP17]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load i1, ptr [[TMP20]], align 1
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i1, ptr [[TMP24]], align 1
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP28]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: [[TMP64:%.*]] = getelementptr i32, ptr [[ALLOCA]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP69:%.*]] = getelementptr i32, ptr [[TMP64]], i64 4
; CHECK-NEXT: [[TMP70:%.*]] = getelementptr i32, ptr [[TMP64]], i64 8
@@ -1301,34 +1301,34 @@ define i32 @neg_off_by_one_iteration(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP33:%.*]] = load i1, ptr [[TMP17]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load i1, ptr [[TMP20]], align 1
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i1, ptr [[TMP24]], align 1
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP28]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: [[TMP64:%.*]] = getelementptr i32, ptr [[ALLOCA]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP69:%.*]] = getelementptr i32, ptr [[TMP64]], i64 4
; CHECK-NEXT: [[TMP70:%.*]] = getelementptr i32, ptr [[TMP64]], i64 8
@@ -1431,34 +1431,34 @@ define i32 @neg_off_by_one_byte(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP33:%.*]] = load i1, ptr [[TMP17]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load i1, ptr [[TMP20]], align 1
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i1, ptr [[TMP24]], align 1
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP28]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: [[TMP64:%.*]] = getelementptr i32, ptr [[ALLOCA]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP69:%.*]] = getelementptr i32, ptr [[TMP64]], i64 4
; CHECK-NEXT: [[TMP70:%.*]] = getelementptr i32, ptr [[TMP64]], i64 8
@@ -1570,34 +1570,34 @@ define i32 @test_constant_max(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
; CHECK-NEXT: [[TMP36:%.*]] = load i1, ptr [[TMP20]], align 1
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> poison, i1 [[TMP33]], i64 0
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 1
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 2
-; CHECK-NEXT: [[TMP40:%.*]] = insertelement <4 x i1> [[TMP39]], i1 [[TMP36]], i64 3
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> poison, i1 [[TMP33]], i32 0
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 1
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 2
+; CHECK-NEXT: [[TMP40:%.*]] = insertelement <4 x i1> [[TMP39]], i1 [[TMP36]], i32 3
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
; CHECK-NEXT: [[TMP44:%.*]] = load i1, ptr [[TMP24]], align 1
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> poison, i1 [[TMP41]], i64 0
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 1
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 2
-; CHECK-NEXT: [[TMP48:%.*]] = insertelement <4 x i1> [[TMP47]], i1 [[TMP44]], i64 3
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> poison, i1 [[TMP41]], i32 0
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 1
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 2
+; CHECK-NEXT: [[TMP48:%.*]] = insertelement <4 x i1> [[TMP47]], i1 [[TMP44]], i32 3
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
; CHECK-NEXT: [[TMP52:%.*]] = load i1, ptr [[TMP28]], align 1
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> poison, i1 [[TMP49]], i64 0
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 1
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 2
-; CHECK-NEXT: [[TMP56:%.*]] = insertelement <4 x i1> [[TMP55]], i1 [[TMP52]], i64 3
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> poison, i1 [[TMP49]], i32 0
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 1
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 2
+; CHECK-NEXT: [[TMP56:%.*]] = insertelement <4 x i1> [[TMP55]], i1 [[TMP52]], i32 3
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
; CHECK-NEXT: [[TMP60:%.*]] = load i1, ptr [[TMP32]], align 1
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> poison, i1 [[TMP57]], i64 0
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 1
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 2
-; CHECK-NEXT: [[TMP64:%.*]] = insertelement <4 x i1> [[TMP63]], i1 [[TMP60]], i64 3
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> poison, i1 [[TMP57]], i32 0
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 1
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 2
+; CHECK-NEXT: [[TMP64:%.*]] = insertelement <4 x i1> [[TMP63]], i1 [[TMP60]], i32 3
; CHECK-NEXT: [[TMP65:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP70:%.*]] = getelementptr inbounds i32, ptr [[TMP65]], i64 4
; CHECK-NEXT: [[TMP71:%.*]] = getelementptr inbounds i32, ptr [[TMP65]], i64 8
@@ -1729,34 +1729,34 @@ define i32 @test_allocsize(i64 %len, ptr %test_base) nofree nosync {
; CHECK-NEXT: [[TMP33:%.*]] = load i1, ptr [[TMP17]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load i1, ptr [[TMP20]], align 1
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i1, ptr [[TMP24]], align 1
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP28]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: [[TMP64:%.*]] = getelementptr i32, ptr [[ALLOCATION]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP69:%.*]] = getelementptr i32, ptr [[TMP64]], i64 4
; CHECK-NEXT: [[TMP70:%.*]] = getelementptr i32, ptr [[TMP64]], i64 8
@@ -1860,34 +1860,34 @@ define i32 @test_allocsize_array(i64 %len, ptr %test_base) nofree nosync {
; CHECK-NEXT: [[TMP33:%.*]] = load i1, ptr [[TMP17]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load i1, ptr [[TMP20]], align 1
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i1, ptr [[TMP24]], align 1
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP28]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: [[TMP64:%.*]] = getelementptr i32, ptr [[ALLOCATION]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP69:%.*]] = getelementptr i32, ptr [[TMP64]], i64 4
; CHECK-NEXT: [[TMP70:%.*]] = getelementptr i32, ptr [[TMP64]], i64 8
@@ -2001,34 +2001,34 @@ define i32 @test_allocsize_cond_deref(i1 %allzero, ptr %test_base) {
; CHECK-NEXT: [[TMP33:%.*]] = load i1, ptr [[TMP17]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load i1, ptr [[TMP20]], align 1
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i1, ptr [[TMP24]], align 1
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP28]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: [[TMP64:%.*]] = getelementptr i32, ptr [[ALLOCATION]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP69:%.*]] = getelementptr i32, ptr [[TMP64]], i64 4
; CHECK-NEXT: [[TMP70:%.*]] = getelementptr i32, ptr [[TMP64]], i64 8
@@ -2140,34 +2140,34 @@ define i32 @test_stride_three(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP33:%.*]] = load i1, ptr [[TMP17]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load i1, ptr [[TMP20]], align 1
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i1, ptr [[TMP24]], align 1
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP28]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: [[TMP64:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[OFFSET_IDX]]
; CHECK-NEXT: [[TMP65:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP66:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[TMP2]]
@@ -2188,34 +2188,34 @@ define i32 @test_stride_three(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP81:%.*]] = load i32, ptr [[TMP65]], align 4
; CHECK-NEXT: [[TMP82:%.*]] = load i32, ptr [[TMP66]], align 4
; CHECK-NEXT: [[TMP83:%.*]] = load i32, ptr [[TMP67]], align 4
-; CHECK-NEXT: [[TMP84:%.*]] = insertelement <4 x i32> poison, i32 [[TMP80]], i64 0
-; CHECK-NEXT: [[TMP85:%.*]] = insertelement <4 x i32> [[TMP84]], i32 [[TMP81]], i64 1
-; CHECK-NEXT: [[TMP86:%.*]] = insertelement <4 x i32> [[TMP85]], i32 [[TMP82]], i64 2
-; CHECK-NEXT: [[TMP87:%.*]] = insertelement <4 x i32> [[TMP86]], i32 [[TMP83]], i64 3
+; CHECK-NEXT: [[TMP84:%.*]] = insertelement <4 x i32> poison, i32 [[TMP80]], i32 0
+; CHECK-NEXT: [[TMP85:%.*]] = insertelement <4 x i32> [[TMP84]], i32 [[TMP81]], i32 1
+; CHECK-NEXT: [[TMP86:%.*]] = insertelement <4 x i32> [[TMP85]], i32 [[TMP82]], i32 2
+; CHECK-NEXT: [[TMP87:%.*]] = insertelement <4 x i32> [[TMP86]], i32 [[TMP83]], i32 3
; CHECK-NEXT: [[TMP88:%.*]] = load i32, ptr [[TMP68]], align 4
; CHECK-NEXT: [[TMP89:%.*]] = load i32, ptr [[TMP69]], align 4
; CHECK-NEXT: [[TMP90:%.*]] = load i32, ptr [[TMP70]], align 4
; CHECK-NEXT: [[TMP91:%.*]] = load i32, ptr [[TMP71]], align 4
-; CHECK-NEXT: [[TMP92:%.*]] = insertelement <4 x i32> poison, i32 [[TMP88]], i64 0
-; CHECK-NEXT: [[TMP93:%.*]] = insertelement <4 x i32> [[TMP92]], i32 [[TMP89]], i64 1
-; CHECK-NEXT: [[TMP94:%.*]] = insertelement <4 x i32> [[TMP93]], i32 [[TMP90]], i64 2
-; CHECK-NEXT: [[TMP95:%.*]] = insertelement <4 x i32> [[TMP94]], i32 [[TMP91]], i64 3
+; CHECK-NEXT: [[TMP92:%.*]] = insertelement <4 x i32> poison, i32 [[TMP88]], i32 0
+; CHECK-NEXT: [[TMP93:%.*]] = insertelement <4 x i32> [[TMP92]], i32 [[TMP89]], i32 1
+; CHECK-NEXT: [[TMP94:%.*]] = insertelement <4 x i32> [[TMP93]], i32 [[TMP90]], i32 2
+; CHECK-NEXT: [[TMP95:%.*]] = insertelement <4 x i32> [[TMP94]], i32 [[TMP91]], i32 3
; CHECK-NEXT: [[TMP96:%.*]] = load i32, ptr [[TMP72]], align 4
; CHECK-NEXT: [[TMP97:%.*]] = load i32, ptr [[TMP73]], align 4
; CHECK-NEXT: [[TMP98:%.*]] = load i32, ptr [[TMP74]], align 4
; CHECK-NEXT: [[TMP99:%.*]] = load i32, ptr [[TMP75]], align 4
-; CHECK-NEXT: [[TMP100:%.*]] = insertelement <4 x i32> poison, i32 [[TMP96]], i64 0
-; CHECK-NEXT: [[TMP101:%.*]] = insertelement <4 x i32> [[TMP100]], i32 [[TMP97]], i64 1
-; CHECK-NEXT: [[TMP102:%.*]] = insertelement <4 x i32> [[TMP101]], i32 [[TMP98]], i64 2
-; CHECK-NEXT: [[TMP103:%.*]] = insertelement <4 x i32> [[TMP102]], i32 [[TMP99]], i64 3
+; CHECK-NEXT: [[TMP100:%.*]] = insertelement <4 x i32> poison, i32 [[TMP96]], i32 0
+; CHECK-NEXT: [[TMP101:%.*]] = insertelement <4 x i32> [[TMP100]], i32 [[TMP97]], i32 1
+; CHECK-NEXT: [[TMP102:%.*]] = insertelement <4 x i32> [[TMP101]], i32 [[TMP98]], i32 2
+; CHECK-NEXT: [[TMP103:%.*]] = insertelement <4 x i32> [[TMP102]], i32 [[TMP99]], i32 3
; CHECK-NEXT: [[TMP104:%.*]] = load i32, ptr [[TMP76]], align 4
; CHECK-NEXT: [[TMP105:%.*]] = load i32, ptr [[TMP77]], align 4
; CHECK-NEXT: [[TMP106:%.*]] = load i32, ptr [[TMP78]], align 4
; CHECK-NEXT: [[TMP107:%.*]] = load i32, ptr [[TMP79]], align 4
-; CHECK-NEXT: [[TMP108:%.*]] = insertelement <4 x i32> poison, i32 [[TMP104]], i64 0
-; CHECK-NEXT: [[TMP109:%.*]] = insertelement <4 x i32> [[TMP108]], i32 [[TMP105]], i64 1
-; CHECK-NEXT: [[TMP110:%.*]] = insertelement <4 x i32> [[TMP109]], i32 [[TMP106]], i64 2
-; CHECK-NEXT: [[TMP111:%.*]] = insertelement <4 x i32> [[TMP110]], i32 [[TMP107]], i64 3
+; CHECK-NEXT: [[TMP108:%.*]] = insertelement <4 x i32> poison, i32 [[TMP104]], i32 0
+; CHECK-NEXT: [[TMP109:%.*]] = insertelement <4 x i32> [[TMP108]], i32 [[TMP105]], i32 1
+; CHECK-NEXT: [[TMP110:%.*]] = insertelement <4 x i32> [[TMP109]], i32 [[TMP106]], i32 2
+; CHECK-NEXT: [[TMP111:%.*]] = insertelement <4 x i32> [[TMP110]], i32 [[TMP107]], i32 3
; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> [[TMP39]], <4 x i32> [[TMP87]], <4 x i32> zeroinitializer
; CHECK-NEXT: [[PREDPHI4:%.*]] = select <4 x i1> [[TMP47]], <4 x i32> [[TMP95]], <4 x i32> zeroinitializer
; CHECK-NEXT: [[PREDPHI5:%.*]] = select <4 x i1> [[TMP55]], <4 x i32> [[TMP103]], <4 x i32> zeroinitializer
@@ -2312,18 +2312,18 @@ define i32 @test_non_unit_stride_four(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP17:%.*]] = load i1, ptr [[TMP9]], align 1
; CHECK-NEXT: [[TMP18:%.*]] = load i1, ptr [[TMP10]], align 1
; CHECK-NEXT: [[TMP19:%.*]] = load i1, ptr [[TMP11]], align 1
-; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x i1> poison, i1 [[TMP16]], i64 0
-; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i1> [[TMP20]], i1 [[TMP17]], i64 1
-; CHECK-NEXT: [[TMP22:%.*]] = insertelement <4 x i1> [[TMP21]], i1 [[TMP18]], i64 2
-; CHECK-NEXT: [[TMP23:%.*]] = insertelement <4 x i1> [[TMP22]], i1 [[TMP19]], i64 3
+; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x i1> poison, i1 [[TMP16]], i32 0
+; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i1> [[TMP20]], i1 [[TMP17]], i32 1
+; CHECK-NEXT: [[TMP22:%.*]] = insertelement <4 x i1> [[TMP21]], i1 [[TMP18]], i32 2
+; CHECK-NEXT: [[TMP23:%.*]] = insertelement <4 x i1> [[TMP22]], i1 [[TMP19]], i32 3
; CHECK-NEXT: [[TMP24:%.*]] = load i1, ptr [[TMP12]], align 1
; CHECK-NEXT: [[TMP25:%.*]] = load i1, ptr [[TMP13]], align 1
; CHECK-NEXT: [[TMP26:%.*]] = load i1, ptr [[TMP14]], align 1
; CHECK-NEXT: [[TMP27:%.*]] = load i1, ptr [[TMP15]], align 1
-; CHECK-NEXT: [[TMP28:%.*]] = insertelement <4 x i1> poison, i1 [[TMP24]], i64 0
-; CHECK-NEXT: [[TMP29:%.*]] = insertelement <4 x i1> [[TMP28]], i1 [[TMP25]], i64 1
-; CHECK-NEXT: [[TMP30:%.*]] = insertelement <4 x i1> [[TMP29]], i1 [[TMP26]], i64 2
-; CHECK-NEXT: [[TMP31:%.*]] = insertelement <4 x i1> [[TMP30]], i1 [[TMP27]], i64 3
+; CHECK-NEXT: [[TMP28:%.*]] = insertelement <4 x i1> poison, i1 [[TMP24]], i32 0
+; CHECK-NEXT: [[TMP29:%.*]] = insertelement <4 x i1> [[TMP28]], i1 [[TMP25]], i32 1
+; CHECK-NEXT: [[TMP30:%.*]] = insertelement <4 x i1> [[TMP29]], i1 [[TMP26]], i32 2
+; CHECK-NEXT: [[TMP31:%.*]] = insertelement <4 x i1> [[TMP30]], i1 [[TMP27]], i32 3
; CHECK-NEXT: [[TMP32:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[OFFSET_IDX]]
; CHECK-NEXT: [[TMP33:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP34:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[TMP2]]
@@ -2336,18 +2336,18 @@ define i32 @test_non_unit_stride_four(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP41:%.*]] = load i32, ptr [[TMP33]], align 4
; CHECK-NEXT: [[TMP42:%.*]] = load i32, ptr [[TMP34]], align 4
; CHECK-NEXT: [[TMP43:%.*]] = load i32, ptr [[TMP35]], align 4
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i32> poison, i32 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i32> [[TMP44]], i32 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i32> [[TMP45]], i32 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i32> [[TMP46]], i32 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i32> poison, i32 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i32> [[TMP44]], i32 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i32> [[TMP45]], i32 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i32> [[TMP46]], i32 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i32, ptr [[TMP36]], align 4
; CHECK-NEXT: [[TMP49:%.*]] = load i32, ptr [[TMP37]], align 4
; CHECK-NEXT: [[TMP50:%.*]] = load i32, ptr [[TMP38]], align 4
; CHECK-NEXT: [[TMP51:%.*]] = load i32, ptr [[TMP39]], align 4
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i32> poison, i32 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i32> [[TMP52]], i32 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i32> [[TMP53]], i32 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i32> [[TMP54]], i32 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i32> poison, i32 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i32> [[TMP52]], i32 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i32> [[TMP53]], i32 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i32> [[TMP54]], i32 [[TMP51]], i32 3
; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> [[TMP23]], <4 x i32> [[TMP47]], <4 x i32> zeroinitializer
; CHECK-NEXT: [[PREDPHI2:%.*]] = select <4 x i1> [[TMP31]], <4 x i32> [[TMP55]], <4 x i32> zeroinitializer
; CHECK-NEXT: [[TMP56]] = add <4 x i32> [[VEC_PHI]], [[PREDPHI]]
@@ -2434,34 +2434,34 @@ define i32 @test_non_unit_stride_five(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP33:%.*]] = load i1, ptr [[TMP17]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load i1, ptr [[TMP20]], align 1
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i1, ptr [[TMP24]], align 1
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP28]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: [[TMP65:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 5
; CHECK-NEXT: [[TMP66:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 10
; CHECK-NEXT: [[TMP67:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 15
@@ -2481,34 +2481,34 @@ define i32 @test_non_unit_stride_five(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP81:%.*]] = load i32, ptr [[TMP65]], align 4
; CHECK-NEXT: [[TMP82:%.*]] = load i32, ptr [[TMP66]], align 4
; CHECK-NEXT: [[TMP83:%.*]] = load i32, ptr [[TMP67]], align 4
-; CHECK-NEXT: [[TMP84:%.*]] = insertelement <4 x i32> poison, i32 [[TMP80]], i64 0
-; CHECK-NEXT: [[TMP85:%.*]] = insertelement <4 x i32> [[TMP84]], i32 [[TMP81]], i64 1
-; CHECK-NEXT: [[TMP86:%.*]] = insertelement <4 x i32> [[TMP85]], i32 [[TMP82]], i64 2
-; CHECK-NEXT: [[TMP87:%.*]] = insertelement <4 x i32> [[TMP86]], i32 [[TMP83]], i64 3
+; CHECK-NEXT: [[TMP84:%.*]] = insertelement <4 x i32> poison, i32 [[TMP80]], i32 0
+; CHECK-NEXT: [[TMP85:%.*]] = insertelement <4 x i32> [[TMP84]], i32 [[TMP81]], i32 1
+; CHECK-NEXT: [[TMP86:%.*]] = insertelement <4 x i32> [[TMP85]], i32 [[TMP82]], i32 2
+; CHECK-NEXT: [[TMP87:%.*]] = insertelement <4 x i32> [[TMP86]], i32 [[TMP83]], i32 3
; CHECK-NEXT: [[TMP88:%.*]] = load i32, ptr [[TMP68]], align 4
; CHECK-NEXT: [[TMP89:%.*]] = load i32, ptr [[TMP69]], align 4
; CHECK-NEXT: [[TMP90:%.*]] = load i32, ptr [[TMP70]], align 4
; CHECK-NEXT: [[TMP91:%.*]] = load i32, ptr [[TMP71]], align 4
-; CHECK-NEXT: [[TMP92:%.*]] = insertelement <4 x i32> poison, i32 [[TMP88]], i64 0
-; CHECK-NEXT: [[TMP93:%.*]] = insertelement <4 x i32> [[TMP92]], i32 [[TMP89]], i64 1
-; CHECK-NEXT: [[TMP94:%.*]] = insertelement <4 x i32> [[TMP93]], i32 [[TMP90]], i64 2
-; CHECK-NEXT: [[TMP95:%.*]] = insertelement <4 x i32> [[TMP94]], i32 [[TMP91]], i64 3
+; CHECK-NEXT: [[TMP92:%.*]] = insertelement <4 x i32> poison, i32 [[TMP88]], i32 0
+; CHECK-NEXT: [[TMP93:%.*]] = insertelement <4 x i32> [[TMP92]], i32 [[TMP89]], i32 1
+; CHECK-NEXT: [[TMP94:%.*]] = insertelement <4 x i32> [[TMP93]], i32 [[TMP90]], i32 2
+; CHECK-NEXT: [[TMP95:%.*]] = insertelement <4 x i32> [[TMP94]], i32 [[TMP91]], i32 3
; CHECK-NEXT: [[TMP96:%.*]] = load i32, ptr [[TMP72]], align 4
; CHECK-NEXT: [[TMP97:%.*]] = load i32, ptr [[TMP73]], align 4
; CHECK-NEXT: [[TMP98:%.*]] = load i32, ptr [[TMP74]], align 4
; CHECK-NEXT: [[TMP99:%.*]] = load i32, ptr [[TMP75]], align 4
-; CHECK-NEXT: [[TMP100:%.*]] = insertelement <4 x i32> poison, i32 [[TMP96]], i64 0
-; CHECK-NEXT: [[TMP101:%.*]] = insertelement <4 x i32> [[TMP100]], i32 [[TMP97]], i64 1
-; CHECK-NEXT: [[TMP102:%.*]] = insertelement <4 x i32> [[TMP101]], i32 [[TMP98]], i64 2
-; CHECK-NEXT: [[TMP103:%.*]] = insertelement <4 x i32> [[TMP102]], i32 [[TMP99]], i64 3
+; CHECK-NEXT: [[TMP100:%.*]] = insertelement <4 x i32> poison, i32 [[TMP96]], i32 0
+; CHECK-NEXT: [[TMP101:%.*]] = insertelement <4 x i32> [[TMP100]], i32 [[TMP97]], i32 1
+; CHECK-NEXT: [[TMP102:%.*]] = insertelement <4 x i32> [[TMP101]], i32 [[TMP98]], i32 2
+; CHECK-NEXT: [[TMP103:%.*]] = insertelement <4 x i32> [[TMP102]], i32 [[TMP99]], i32 3
; CHECK-NEXT: [[TMP104:%.*]] = load i32, ptr [[TMP76]], align 4
; CHECK-NEXT: [[TMP105:%.*]] = load i32, ptr [[TMP77]], align 4
; CHECK-NEXT: [[TMP106:%.*]] = load i32, ptr [[TMP78]], align 4
; CHECK-NEXT: [[TMP107:%.*]] = load i32, ptr [[TMP79]], align 4
-; CHECK-NEXT: [[TMP108:%.*]] = insertelement <4 x i32> poison, i32 [[TMP104]], i64 0
-; CHECK-NEXT: [[TMP109:%.*]] = insertelement <4 x i32> [[TMP108]], i32 [[TMP105]], i64 1
-; CHECK-NEXT: [[TMP110:%.*]] = insertelement <4 x i32> [[TMP109]], i32 [[TMP106]], i64 2
-; CHECK-NEXT: [[TMP111:%.*]] = insertelement <4 x i32> [[TMP110]], i32 [[TMP107]], i64 3
+; CHECK-NEXT: [[TMP108:%.*]] = insertelement <4 x i32> poison, i32 [[TMP104]], i32 0
+; CHECK-NEXT: [[TMP109:%.*]] = insertelement <4 x i32> [[TMP108]], i32 [[TMP105]], i32 1
+; CHECK-NEXT: [[TMP110:%.*]] = insertelement <4 x i32> [[TMP109]], i32 [[TMP106]], i32 2
+; CHECK-NEXT: [[TMP111:%.*]] = insertelement <4 x i32> [[TMP110]], i32 [[TMP107]], i32 3
; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> [[TMP39]], <4 x i32> [[TMP87]], <4 x i32> zeroinitializer
; CHECK-NEXT: [[PREDPHI4:%.*]] = select <4 x i1> [[TMP47]], <4 x i32> [[TMP95]], <4 x i32> zeroinitializer
; CHECK-NEXT: [[PREDPHI5:%.*]] = select <4 x i1> [[TMP55]], <4 x i32> [[TMP103]], <4 x i32> zeroinitializer
@@ -2618,34 +2618,34 @@ define i32 @test_non_unit_stride_off_by_four_bytes(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP33:%.*]] = load i1, ptr [[TMP17]], align 1
; CHECK-NEXT: [[TMP34:%.*]] = load i1, ptr [[TMP18]], align 1
; CHECK-NEXT: [[TMP35:%.*]] = load i1, ptr [[TMP19]], align 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i64 0
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i64 1
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i64 2
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i64 3
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i1> poison, i1 [[TMP32]], i32 0
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i1> [[TMP36]], i1 [[TMP33]], i32 1
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i1> [[TMP37]], i1 [[TMP34]], i32 2
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i1> [[TMP38]], i1 [[TMP35]], i32 3
; CHECK-NEXT: [[TMP40:%.*]] = load i1, ptr [[TMP20]], align 1
; CHECK-NEXT: [[TMP41:%.*]] = load i1, ptr [[TMP21]], align 1
; CHECK-NEXT: [[TMP42:%.*]] = load i1, ptr [[TMP22]], align 1
; CHECK-NEXT: [[TMP43:%.*]] = load i1, ptr [[TMP23]], align 1
-; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i64 0
-; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i64 1
-; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i64 2
-; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i64 3
+; CHECK-NEXT: [[TMP44:%.*]] = insertelement <4 x i1> poison, i1 [[TMP40]], i32 0
+; CHECK-NEXT: [[TMP45:%.*]] = insertelement <4 x i1> [[TMP44]], i1 [[TMP41]], i32 1
+; CHECK-NEXT: [[TMP46:%.*]] = insertelement <4 x i1> [[TMP45]], i1 [[TMP42]], i32 2
+; CHECK-NEXT: [[TMP47:%.*]] = insertelement <4 x i1> [[TMP46]], i1 [[TMP43]], i32 3
; CHECK-NEXT: [[TMP48:%.*]] = load i1, ptr [[TMP24]], align 1
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP25]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP26]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP27]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP28]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP29]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP30]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP31]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: [[TMP64:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[OFFSET_IDX]]
; CHECK-NEXT: [[TMP65:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP66:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[TMP2]]
@@ -2666,34 +2666,34 @@ define i32 @test_non_unit_stride_off_by_four_bytes(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP81:%.*]] = load i32, ptr [[TMP65]], align 4
; CHECK-NEXT: [[TMP82:%.*]] = load i32, ptr [[TMP66]], align 4
; CHECK-NEXT: [[TMP83:%.*]] = load i32, ptr [[TMP67]], align 4
-; CHECK-NEXT: [[TMP84:%.*]] = insertelement <4 x i32> poison, i32 [[TMP80]], i64 0
-; CHECK-NEXT: [[TMP85:%.*]] = insertelement <4 x i32> [[TMP84]], i32 [[TMP81]], i64 1
-; CHECK-NEXT: [[TMP86:%.*]] = insertelement <4 x i32> [[TMP85]], i32 [[TMP82]], i64 2
-; CHECK-NEXT: [[TMP87:%.*]] = insertelement <4 x i32> [[TMP86]], i32 [[TMP83]], i64 3
+; CHECK-NEXT: [[TMP84:%.*]] = insertelement <4 x i32> poison, i32 [[TMP80]], i32 0
+; CHECK-NEXT: [[TMP85:%.*]] = insertelement <4 x i32> [[TMP84]], i32 [[TMP81]], i32 1
+; CHECK-NEXT: [[TMP86:%.*]] = insertelement <4 x i32> [[TMP85]], i32 [[TMP82]], i32 2
+; CHECK-NEXT: [[TMP87:%.*]] = insertelement <4 x i32> [[TMP86]], i32 [[TMP83]], i32 3
; CHECK-NEXT: [[TMP88:%.*]] = load i32, ptr [[TMP68]], align 4
; CHECK-NEXT: [[TMP89:%.*]] = load i32, ptr [[TMP69]], align 4
; CHECK-NEXT: [[TMP90:%.*]] = load i32, ptr [[TMP70]], align 4
; CHECK-NEXT: [[TMP91:%.*]] = load i32, ptr [[TMP71]], align 4
-; CHECK-NEXT: [[TMP92:%.*]] = insertelement <4 x i32> poison, i32 [[TMP88]], i64 0
-; CHECK-NEXT: [[TMP93:%.*]] = insertelement <4 x i32> [[TMP92]], i32 [[TMP89]], i64 1
-; CHECK-NEXT: [[TMP94:%.*]] = insertelement <4 x i32> [[TMP93]], i32 [[TMP90]], i64 2
-; CHECK-NEXT: [[TMP95:%.*]] = insertelement <4 x i32> [[TMP94]], i32 [[TMP91]], i64 3
+; CHECK-NEXT: [[TMP92:%.*]] = insertelement <4 x i32> poison, i32 [[TMP88]], i32 0
+; CHECK-NEXT: [[TMP93:%.*]] = insertelement <4 x i32> [[TMP92]], i32 [[TMP89]], i32 1
+; CHECK-NEXT: [[TMP94:%.*]] = insertelement <4 x i32> [[TMP93]], i32 [[TMP90]], i32 2
+; CHECK-NEXT: [[TMP95:%.*]] = insertelement <4 x i32> [[TMP94]], i32 [[TMP91]], i32 3
; CHECK-NEXT: [[TMP96:%.*]] = load i32, ptr [[TMP72]], align 4
; CHECK-NEXT: [[TMP97:%.*]] = load i32, ptr [[TMP73]], align 4
; CHECK-NEXT: [[TMP98:%.*]] = load i32, ptr [[TMP74]], align 4
; CHECK-NEXT: [[TMP99:%.*]] = load i32, ptr [[TMP75]], align 4
-; CHECK-NEXT: [[TMP100:%.*]] = insertelement <4 x i32> poison, i32 [[TMP96]], i64 0
-; CHECK-NEXT: [[TMP101:%.*]] = insertelement <4 x i32> [[TMP100]], i32 [[TMP97]], i64 1
-; CHECK-NEXT: [[TMP102:%.*]] = insertelement <4 x i32> [[TMP101]], i32 [[TMP98]], i64 2
-; CHECK-NEXT: [[TMP103:%.*]] = insertelement <4 x i32> [[TMP102]], i32 [[TMP99]], i64 3
+; CHECK-NEXT: [[TMP100:%.*]] = insertelement <4 x i32> poison, i32 [[TMP96]], i32 0
+; CHECK-NEXT: [[TMP101:%.*]] = insertelement <4 x i32> [[TMP100]], i32 [[TMP97]], i32 1
+; CHECK-NEXT: [[TMP102:%.*]] = insertelement <4 x i32> [[TMP101]], i32 [[TMP98]], i32 2
+; CHECK-NEXT: [[TMP103:%.*]] = insertelement <4 x i32> [[TMP102]], i32 [[TMP99]], i32 3
; CHECK-NEXT: [[TMP104:%.*]] = load i32, ptr [[TMP76]], align 4
; CHECK-NEXT: [[TMP105:%.*]] = load i32, ptr [[TMP77]], align 4
; CHECK-NEXT: [[TMP106:%.*]] = load i32, ptr [[TMP78]], align 4
; CHECK-NEXT: [[TMP107:%.*]] = load i32, ptr [[TMP79]], align 4
-; CHECK-NEXT: [[TMP108:%.*]] = insertelement <4 x i32> poison, i32 [[TMP104]], i64 0
-; CHECK-NEXT: [[TMP109:%.*]] = insertelement <4 x i32> [[TMP108]], i32 [[TMP105]], i64 1
-; CHECK-NEXT: [[TMP110:%.*]] = insertelement <4 x i32> [[TMP109]], i32 [[TMP106]], i64 2
-; CHECK-NEXT: [[TMP111:%.*]] = insertelement <4 x i32> [[TMP110]], i32 [[TMP107]], i64 3
+; CHECK-NEXT: [[TMP108:%.*]] = insertelement <4 x i32> poison, i32 [[TMP104]], i32 0
+; CHECK-NEXT: [[TMP109:%.*]] = insertelement <4 x i32> [[TMP108]], i32 [[TMP105]], i32 1
+; CHECK-NEXT: [[TMP110:%.*]] = insertelement <4 x i32> [[TMP109]], i32 [[TMP106]], i32 2
+; CHECK-NEXT: [[TMP111:%.*]] = insertelement <4 x i32> [[TMP110]], i32 [[TMP107]], i32 3
; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> [[TMP39]], <4 x i32> [[TMP87]], <4 x i32> zeroinitializer
; CHECK-NEXT: [[PREDPHI4:%.*]] = select <4 x i1> [[TMP47]], <4 x i32> [[TMP95]], <4 x i32> zeroinitializer
; CHECK-NEXT: [[PREDPHI5:%.*]] = select <4 x i1> [[TMP55]], <4 x i32> [[TMP103]], <4 x i32> zeroinitializer
@@ -2825,34 +2825,34 @@ define i32 @test_non_unit_stride_with_first_iteration_step_access(i64 %len, ptr
; CHECK-NEXT: [[TMP49:%.*]] = load i1, ptr [[TMP33]], align 1
; CHECK-NEXT: [[TMP50:%.*]] = load i1, ptr [[TMP34]], align 1
; CHECK-NEXT: [[TMP51:%.*]] = load i1, ptr [[TMP35]], align 1
-; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i64 3
+; CHECK-NEXT: [[TMP52:%.*]] = insertelement <4 x i1> poison, i1 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP53:%.*]] = insertelement <4 x i1> [[TMP52]], i1 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP54:%.*]] = insertelement <4 x i1> [[TMP53]], i1 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <4 x i1> [[TMP54]], i1 [[TMP51]], i32 3
; CHECK-NEXT: [[TMP56:%.*]] = load i1, ptr [[TMP36]], align 1
; CHECK-NEXT: [[TMP57:%.*]] = load i1, ptr [[TMP37]], align 1
; CHECK-NEXT: [[TMP58:%.*]] = load i1, ptr [[TMP38]], align 1
; CHECK-NEXT: [[TMP59:%.*]] = load i1, ptr [[TMP39]], align 1
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i64 0
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i64 1
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i64 2
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i64 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <4 x i1> poison, i1 [[TMP56]], i32 0
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <4 x i1> [[TMP60]], i1 [[TMP57]], i32 1
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <4 x i1> [[TMP61]], i1 [[TMP58]], i32 2
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
; CHECK-NEXT: [[TMP64:%.*]] = load i1, ptr [[TMP40]], align 1
; CHECK-NEXT: [[TMP65:%.*]] = load i1, ptr [[TMP41]], align 1
; CHECK-NEXT: [[TMP66:%.*]] = load i1, ptr [[TMP42]], align 1
; CHECK-NEXT: [[TMP67:%.*]] = load i1, ptr [[TMP43]], align 1
-; CHECK-NEXT: [[TMP68:%.*]] = insertelement <4 x i1> poison, i1 [[TMP64]], i64 0
-; CHECK-NEXT: [[TMP69:%.*]] = insertelement <4 x i1> [[TMP68]], i1 [[TMP65]], i64 1
-; CHECK-NEXT: [[TMP70:%.*]] = insertelement <4 x i1> [[TMP69]], i1 [[TMP66]], i64 2
-; CHECK-NEXT: [[TMP71:%.*]] = insertelement <4 x i1> [[TMP70]], i1 [[TMP67]], i64 3
+; CHECK-NEXT: [[TMP68:%.*]] = insertelement <4 x i1> poison, i1 [[TMP64]], i32 0
+; CHECK-NEXT: [[TMP69:%.*]] = insertelement <4 x i1> [[TMP68]], i1 [[TMP65]], i32 1
+; CHECK-NEXT: [[TMP70:%.*]] = insertelement <4 x i1> [[TMP69]], i1 [[TMP66]], i32 2
+; CHECK-NEXT: [[TMP71:%.*]] = insertelement <4 x i1> [[TMP70]], i1 [[TMP67]], i32 3
; CHECK-NEXT: [[TMP72:%.*]] = load i1, ptr [[TMP44]], align 1
; CHECK-NEXT: [[TMP73:%.*]] = load i1, ptr [[TMP45]], align 1
; CHECK-NEXT: [[TMP74:%.*]] = load i1, ptr [[TMP46]], align 1
; CHECK-NEXT: [[TMP75:%.*]] = load i1, ptr [[TMP47]], align 1
-; CHECK-NEXT: [[TMP76:%.*]] = insertelement <4 x i1> poison, i1 [[TMP72]], i64 0
-; CHECK-NEXT: [[TMP77:%.*]] = insertelement <4 x i1> [[TMP76]], i1 [[TMP73]], i64 1
-; CHECK-NEXT: [[TMP78:%.*]] = insertelement <4 x i1> [[TMP77]], i1 [[TMP74]], i64 2
-; CHECK-NEXT: [[TMP79:%.*]] = insertelement <4 x i1> [[TMP78]], i1 [[TMP75]], i64 3
+; CHECK-NEXT: [[TMP76:%.*]] = insertelement <4 x i1> poison, i1 [[TMP72]], i32 0
+; CHECK-NEXT: [[TMP77:%.*]] = insertelement <4 x i1> [[TMP76]], i1 [[TMP73]], i32 1
+; CHECK-NEXT: [[TMP78:%.*]] = insertelement <4 x i1> [[TMP77]], i1 [[TMP74]], i32 2
+; CHECK-NEXT: [[TMP79:%.*]] = insertelement <4 x i1> [[TMP78]], i1 [[TMP75]], i32 3
; CHECK-NEXT: [[TMP80:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[TMP16]]
; CHECK-NEXT: [[TMP81:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[TMP17]]
; CHECK-NEXT: [[TMP82:%.*]] = getelementptr inbounds i32, ptr [[ALLOCA]], i64 [[TMP18]]
@@ -2873,34 +2873,34 @@ define i32 @test_non_unit_stride_with_first_iteration_step_access(i64 %len, ptr
; CHECK-NEXT: [[TMP97:%.*]] = load i32, ptr [[TMP81]], align 4
; CHECK-NEXT: [[TMP98:%.*]] = load i32, ptr [[TMP82]], align 4
; CHECK-NEXT: [[TMP99:%.*]] = load i32, ptr [[TMP83]], align 4
-; CHECK-NEXT: [[TMP100:%.*]] = insertelement <4 x i32> poison, i32 [[TMP96]], i64 0
-; CHECK-NEXT: [[TMP101:%.*]] = insertelement <4 x i32> [[TMP100]], i32 [[TMP97]], i64 1
-; CHECK-NEXT: [[TMP102:%.*]] = insertelement <4 x i32> [[TMP101]], i32 [[TMP98]], i64 2
-; CHECK-NEXT: [[TMP103:%.*]] = insertelement <4 x i32> [[TMP102]], i32 [[TMP99]], i64 3
+; CHECK-NEXT: [[TMP100:%.*]] = insertelement <4 x i32> poison, i32 [[TMP96]], i32 0
+; CHECK-NEXT: [[TMP101:%.*]] = insertelement <4 x i32> [[TMP100]], i32 [[TMP97]], i32 1
+; CHECK-NEXT: [[TMP102:%.*]] = insertelement <4 x i32> [[TMP101]], i32 [[TMP98]], i32 2
+; CHECK-NEXT: [[TMP103:%.*]] = insertelement <4 x i32> [[TMP102]], i32 [[TMP99]], i32 3
; CHECK-NEXT: [[TMP104:%.*]] = load i32, ptr [[TMP84]], align 4
; CHECK-NEXT: [[TMP105:%.*]] = load i32, ptr [[TMP85]], align 4
; CHECK-NEXT: [[TMP106:%.*]] = load i32, ptr [[TMP86]], align 4
; CHECK-NEXT: [[TMP107:%.*]] = load i32, ptr [[TMP87]], align 4
-; CHECK-NEXT: [[TMP108:%.*]] = insertelement <4 x i32> poison, i32 [[TMP104]], i64 0
-; CHECK-NEXT: [[TMP109:%.*]] = insertelement <4 x i32> [[TMP108]], i32 [[TMP105]], i64 1
-; CHECK-NEXT: [[TMP110:%.*]] = insertelement <4 x i32> [[TMP109]], i32 [[TMP106]], i64 2
-; CHECK-NEXT: [[TMP111:%.*]] = insertelement <4 x i32> [[TMP110]], i32 [[TMP107]], i64 3
+; CHECK-NEXT: [[TMP108:%.*]] = insertelement <4 x i32> poison, i32 [[TMP104]], i32 0
+; CHECK-NEXT: [[TMP109:%.*]] = insertelement <4 x i32> [[TMP108]], i32 [[TMP105]], i32 1
+; CHECK-NEXT: [[TMP110:%.*]] = insertelement <4 x i32> [[TMP109]], i32 [[TMP106]], i32 2
+; CHECK-NEXT: [[TMP111:%.*]] = insertelement <4 x i32> [[TMP110]], i32 [[TMP107]], i32 3
; CHECK-NEXT: [[TMP112:%.*]] = load i32, ptr [[TMP88]], align 4
; CHECK-NEXT: [[TMP113:%.*]] = load i32, ptr [[TMP89]], align 4
; CHECK-NEXT: [[TMP114:%.*]] = load i32, ptr [[TMP90]], align 4
; CHECK-NEXT: [[TMP115:%.*]] = load i32, ptr [[TMP91]], align 4
-; CHECK-NEXT: [[TMP116:%.*]] = insertelement <4 x i32> poison, i32 [[TMP112]], i64 0
-; CHECK-NEXT: [[TMP117:%.*]] = insertelement <4 x i32> [[TMP116]], i32 [[TMP113]], i64 1
-; CHECK-NEXT: [[TMP118:%.*]] = insertelement <4 x i32> [[TMP117]], i32 [[TMP114]], i64 2
-; CHECK-NEXT: [[TMP119:%.*]] = insertelement <4 x i32> [[TMP118]], i32 [[TMP115]], i64 3
+; CHECK-NEXT: [[TMP116:%.*]] = insertelement <4 x i32> poison, i32 [[TMP112]], i32 0
+; CHECK-NEXT: [[TMP117:%.*]] = insertelement <4 x i32> [[TMP116]], i32 [[TMP113]], i32 1
+; CHECK-NEXT: [[TMP118:%.*]] = insertelement <4 x i32> [[TMP117]], i32 [[TMP114]], i32 2
+; CHECK-NEXT: [[TMP119:%.*]] = insertelement <4 x i32> [[TMP118]], i32 [[TMP115]], i32 3
; CHECK-NEXT: [[TMP120:%.*]] = load i32, ptr [[TMP92]], align 4
; CHECK-NEXT: [[TMP121:%.*]] = load i32, ptr [[TMP93]], align 4
; CHECK-NEXT: [[TMP122:%.*]] = load i32, ptr [[TMP94]], align 4
; CHECK-NEXT: [[TMP123:%.*]] = load i32, ptr [[TMP95]], align 4
-; CHECK-NEXT: [[TMP124:%.*]] = insertelement <4 x i32> poison, i32 [[TMP120]], i64 0
-; CHECK-NEXT: [[TMP125:%.*]] = insertelement <4 x i32> [[TMP124]], i32 [[TMP121]], i64 1
-; CHECK-NEXT: [[TMP126:%.*]] = insertelement <4 x i32> [[TMP125]], i32 [[TMP122]], i64 2
-; CHECK-NEXT: [[TMP127:%.*]] = insertelement <4 x i32> [[TMP126]], i32 [[TMP123]], i64 3
+; CHECK-NEXT: [[TMP124:%.*]] = insertelement <4 x i32> poison, i32 [[TMP120]], i32 0
+; CHECK-NEXT: [[TMP125:%.*]] = insertelement <4 x i32> [[TMP124]], i32 [[TMP121]], i32 1
+; CHECK-NEXT: [[TMP126:%.*]] = insertelement <4 x i32> [[TMP125]], i32 [[TMP122]], i32 2
+; CHECK-NEXT: [[TMP127:%.*]] = insertelement <4 x i32> [[TMP126]], i32 [[TMP123]], i32 3
; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> [[TMP55]], <4 x i32> [[TMP103]], <4 x i32> zeroinitializer
; CHECK-NEXT: [[PREDPHI4:%.*]] = select <4 x i1> [[TMP63]], <4 x i32> [[TMP111]], <4 x i32> zeroinitializer
; CHECK-NEXT: [[PREDPHI5:%.*]] = select <4 x i1> [[TMP71]], <4 x i32> [[TMP119]], <4 x i32> zeroinitializer
diff --git a/llvm/test/Transforms/LoopVectorize/X86/masked_load_store.ll b/llvm/test/Transforms/LoopVectorize/X86/masked_load_store.ll
index 310d894c159ad..9929cd8670f56 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/masked_load_store.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/masked_load_store.ll
@@ -2074,34 +2074,34 @@ define i32 @reverse_gather(ptr %p) {
; AVX2-NEXT: [[TMP65:%.*]] = load i32, ptr [[TMP49]], align 8
; AVX2-NEXT: [[TMP66:%.*]] = load i32, ptr [[TMP50]], align 8
; AVX2-NEXT: [[TMP67:%.*]] = load i32, ptr [[TMP51]], align 8
-; AVX2-NEXT: [[TMP68:%.*]] = insertelement <4 x i32> poison, i32 [[TMP64]], i64 0
-; AVX2-NEXT: [[TMP69:%.*]] = insertelement <4 x i32> [[TMP68]], i32 [[TMP65]], i64 1
-; AVX2-NEXT: [[TMP70:%.*]] = insertelement <4 x i32> [[TMP69]], i32 [[TMP66]], i64 2
-; AVX2-NEXT: [[TMP71:%.*]] = insertelement <4 x i32> [[TMP70]], i32 [[TMP67]], i64 3
+; AVX2-NEXT: [[TMP68:%.*]] = insertelement <4 x i32> poison, i32 [[TMP64]], i32 0
+; AVX2-NEXT: [[TMP69:%.*]] = insertelement <4 x i32> [[TMP68]], i32 [[TMP65]], i32 1
+; AVX2-NEXT: [[TMP70:%.*]] = insertelement <4 x i32> [[TMP69]], i32 [[TMP66]], i32 2
+; AVX2-NEXT: [[TMP71:%.*]] = insertelement <4 x i32> [[TMP70]], i32 [[TMP67]], i32 3
; AVX2-NEXT: [[TMP72:%.*]] = load i32, ptr [[TMP52]], align 8
; AVX2-NEXT: [[TMP73:%.*]] = load i32, ptr [[TMP53]], align 8
; AVX2-NEXT: [[TMP74:%.*]] = load i32, ptr [[TMP54]], align 8
; AVX2-NEXT: [[TMP75:%.*]] = load i32, ptr [[TMP55]], align 8
-; AVX2-NEXT: [[TMP76:%.*]] = insertelement <4 x i32> poison, i32 [[TMP72]], i64 0
-; AVX2-NEXT: [[TMP77:%.*]] = insertelement <4 x i32> [[TMP76]], i32 [[TMP73]], i64 1
-; AVX2-NEXT: [[TMP78:%.*]] = insertelement <4 x i32> [[TMP77]], i32 [[TMP74]], i64 2
-; AVX2-NEXT: [[TMP79:%.*]] = insertelement <4 x i32> [[TMP78]], i32 [[TMP75]], i64 3
+; AVX2-NEXT: [[TMP76:%.*]] = insertelement <4 x i32> poison, i32 [[TMP72]], i32 0
+; AVX2-NEXT: [[TMP77:%.*]] = insertelement <4 x i32> [[TMP76]], i32 [[TMP73]], i32 1
+; AVX2-NEXT: [[TMP78:%.*]] = insertelement <4 x i32> [[TMP77]], i32 [[TMP74]], i32 2
+; AVX2-NEXT: [[TMP79:%.*]] = insertelement <4 x i32> [[TMP78]], i32 [[TMP75]], i32 3
; AVX2-NEXT: [[TMP80:%.*]] = load i32, ptr [[TMP56]], align 8
; AVX2-NEXT: [[TMP81:%.*]] = load i32, ptr [[TMP57]], align 8
; AVX2-NEXT: [[TMP82:%.*]] = load i32, ptr [[TMP58]], align 8
; AVX2-NEXT: [[TMP83:%.*]] = load i32, ptr [[TMP59]], align 8
-; AVX2-NEXT: [[TMP84:%.*]] = insertelement <4 x i32> poison, i32 [[TMP80]], i64 0
-; AVX2-NEXT: [[TMP85:%.*]] = insertelement <4 x i32> [[TMP84]], i32 [[TMP81]], i64 1
-; AVX2-NEXT: [[TMP86:%.*]] = insertelement <4 x i32> [[TMP85]], i32 [[TMP82]], i64 2
-; AVX2-NEXT: [[TMP87:%.*]] = insertelement <4 x i32> [[TMP86]], i32 [[TMP83]], i64 3
+; AVX2-NEXT: [[TMP84:%.*]] = insertelement <4 x i32> poison, i32 [[TMP80]], i32 0
+; AVX2-NEXT: [[TMP85:%.*]] = insertelement <4 x i32> [[TMP84]], i32 [[TMP81]], i32 1
+; AVX2-NEXT: [[TMP86:%.*]] = insertelement <4 x i32> [[TMP85]], i32 [[TMP82]], i32 2
+; AVX2-NEXT: [[TMP87:%.*]] = insertelement <4 x i32> [[TMP86]], i32 [[TMP83]], i32 3
; AVX2-NEXT: [[TMP88:%.*]] = load i32, ptr [[TMP60]], align 8
; AVX2-NEXT: [[TMP89:%.*]] = load i32, ptr [[TMP61]], align 8
; AVX2-NEXT: [[TMP90:%.*]] = load i32, ptr [[TMP62]], align 8
; AVX2-NEXT: [[TMP91:%.*]] = load i32, ptr [[TMP63]], align 8
-; AVX2-NEXT: [[TMP92:%.*]] = insertelement <4 x i32> poison, i32 [[TMP88]], i64 0
-; AVX2-NEXT: [[TMP93:%.*]] = insertelement <4 x i32> [[TMP92]], i32 [[TMP89]], i64 1
-; AVX2-NEXT: [[TMP94:%.*]] = insertelement <4 x i32> [[TMP93]], i32 [[TMP90]], i64 2
-; AVX2-NEXT: [[TMP95:%.*]] = insertelement <4 x i32> [[TMP94]], i32 [[TMP91]], i64 3
+; AVX2-NEXT: [[TMP92:%.*]] = insertelement <4 x i32> poison, i32 [[TMP88]], i32 0
+; AVX2-NEXT: [[TMP93:%.*]] = insertelement <4 x i32> [[TMP92]], i32 [[TMP89]], i32 1
+; AVX2-NEXT: [[TMP94:%.*]] = insertelement <4 x i32> [[TMP93]], i32 [[TMP90]], i32 2
+; AVX2-NEXT: [[TMP95:%.*]] = insertelement <4 x i32> [[TMP94]], i32 [[TMP91]], i32 3
; AVX2-NEXT: [[TMP96:%.*]] = icmp ne <4 x i32> [[TMP71]], zeroinitializer
; AVX2-NEXT: [[TMP97:%.*]] = icmp ne <4 x i32> [[TMP79]], zeroinitializer
; AVX2-NEXT: [[TMP98:%.*]] = icmp ne <4 x i32> [[TMP87]], zeroinitializer
@@ -2153,10 +2153,10 @@ define i32 @reverse_gather(ptr %p) {
; AVX2-NEXT: [[TMP125:%.*]] = load i32, ptr [[TMP121]], align 8
; AVX2-NEXT: [[TMP126:%.*]] = load i32, ptr [[TMP122]], align 8
; AVX2-NEXT: [[TMP127:%.*]] = load i32, ptr [[TMP123]], align 8
-; AVX2-NEXT: [[TMP128:%.*]] = insertelement <4 x i32> poison, i32 [[TMP124]], i64 0
-; AVX2-NEXT: [[TMP129:%.*]] = insertelement <4 x i32> [[TMP128]], i32 [[TMP125]], i64 1
-; AVX2-NEXT: [[TMP130:%.*]] = insertelement <4 x i32> [[TMP129]], i32 [[TMP126]], i64 2
-; AVX2-NEXT: [[TMP131:%.*]] = insertelement <4 x i32> [[TMP130]], i32 [[TMP127]], i64 3
+; AVX2-NEXT: [[TMP128:%.*]] = insertelement <4 x i32> poison, i32 [[TMP124]], i32 0
+; AVX2-NEXT: [[TMP129:%.*]] = insertelement <4 x i32> [[TMP128]], i32 [[TMP125]], i32 1
+; AVX2-NEXT: [[TMP130:%.*]] = insertelement <4 x i32> [[TMP129]], i32 [[TMP126]], i32 2
+; AVX2-NEXT: [[TMP131:%.*]] = insertelement <4 x i32> [[TMP130]], i32 [[TMP127]], i32 3
; AVX2-NEXT: [[TMP132:%.*]] = icmp ne <4 x i32> [[TMP131]], zeroinitializer
; AVX2-NEXT: [[TMP133]] = or <4 x i1> [[VEC_PHI7]], [[TMP132]]
; AVX2-NEXT: [[INDEX_NEXT8]] = add nuw i32 [[INDEX6]], 4
@@ -2247,10 +2247,10 @@ define i32 @reverse_gather(ptr %p) {
; AVX512-NEXT: [[TMP28:%.*]] = load i32, ptr [[TMP27]], align 8
; AVX512-NEXT: [[TMP29:%.*]] = extractelement <4 x ptr> [[REVERSE18]], i64 3
; AVX512-NEXT: [[TMP30:%.*]] = load i32, ptr [[TMP29]], align 8
-; AVX512-NEXT: [[TMP31:%.*]] = insertelement <4 x i32> poison, i32 [[TMP24]], i64 0
-; AVX512-NEXT: [[TMP32:%.*]] = insertelement <4 x i32> [[TMP31]], i32 [[TMP26]], i64 1
-; AVX512-NEXT: [[TMP33:%.*]] = insertelement <4 x i32> [[TMP32]], i32 [[TMP28]], i64 2
-; AVX512-NEXT: [[TMP34:%.*]] = insertelement <4 x i32> [[TMP33]], i32 [[TMP30]], i64 3
+; AVX512-NEXT: [[TMP31:%.*]] = insertelement <4 x i32> poison, i32 [[TMP24]], i32 0
+; AVX512-NEXT: [[TMP32:%.*]] = insertelement <4 x i32> [[TMP31]], i32 [[TMP26]], i32 1
+; AVX512-NEXT: [[TMP33:%.*]] = insertelement <4 x i32> [[TMP32]], i32 [[TMP28]], i32 2
+; AVX512-NEXT: [[TMP34:%.*]] = insertelement <4 x i32> [[TMP33]], i32 [[TMP30]], i32 3
; AVX512-NEXT: [[TMP35:%.*]] = icmp ne <4 x i32> [[TMP34]], zeroinitializer
; AVX512-NEXT: [[TMP36]] = or <4 x i1> [[VEC_PHI16]], [[TMP35]]
; AVX512-NEXT: [[INDEX_NEXT19]] = add nuw i32 [[INDEX15]], 4
diff --git a/llvm/test/Transforms/LoopVectorize/X86/nondetermisitic-widening-cost.ll b/llvm/test/Transforms/LoopVectorize/X86/nondetermisitic-widening-cost.ll
index 9e473b373faa8..8a2dfe0bef400 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/nondetermisitic-widening-cost.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/nondetermisitic-widening-cost.ll
@@ -47,10 +47,10 @@ define float @fun(i64 %0, float %1, ptr noalias %a, ptr noalias %b, i64 %len) #
; CHECK-NEXT: [[TMP72:%.*]] = load float, ptr [[TMP45]], align 4
; CHECK-NEXT: [[TMP73:%.*]] = load float, ptr [[TMP46]], align 4
; CHECK-NEXT: [[TMP74:%.*]] = load float, ptr [[TMP47]], align 4
-; CHECK-NEXT: [[TMP75:%.*]] = insertelement <4 x float> poison, float [[TMP71]], i64 0
-; CHECK-NEXT: [[TMP76:%.*]] = insertelement <4 x float> [[TMP75]], float [[TMP72]], i64 1
-; CHECK-NEXT: [[TMP77:%.*]] = insertelement <4 x float> [[TMP76]], float [[TMP73]], i64 2
-; CHECK-NEXT: [[TMP78:%.*]] = insertelement <4 x float> [[TMP77]], float [[TMP74]], i64 3
+; CHECK-NEXT: [[TMP75:%.*]] = insertelement <4 x float> poison, float [[TMP71]], i32 0
+; CHECK-NEXT: [[TMP76:%.*]] = insertelement <4 x float> [[TMP75]], float [[TMP72]], i32 1
+; CHECK-NEXT: [[TMP77:%.*]] = insertelement <4 x float> [[TMP76]], float [[TMP73]], i32 2
+; CHECK-NEXT: [[TMP78:%.*]] = insertelement <4 x float> [[TMP77]], float [[TMP74]], i32 3
; CHECK-NEXT: [[TMP61:%.*]] = getelementptr [4 x i8], ptr [[VLA]], i64 [[INDEX]]
; CHECK-NEXT: store <4 x float> [[TMP78]], ptr [[TMP61]], align 4
; CHECK-NEXT: [[TMP63:%.*]] = getelementptr [4 x i8], ptr [[TMP4]], i64 [[INDEX]]
diff --git a/llvm/test/Transforms/LoopVectorize/X86/replicate-recipe-with-only-first-lane-used.ll b/llvm/test/Transforms/LoopVectorize/X86/replicate-recipe-with-only-first-lane-used.ll
index 1e0a27b306fa3..0d0a8d2d78e00 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/replicate-recipe-with-only-first-lane-used.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/replicate-recipe-with-only-first-lane-used.ll
@@ -196,10 +196,10 @@ define float @uniform_load_replicating_select(ptr %A, ptr %B, i64 %1) {
; CHECK-NEXT: [[TMP25:%.*]] = load float, ptr [[TMP20]], align 4
; CHECK-NEXT: [[TMP26:%.*]] = load float, ptr [[TMP21]], align 4
; CHECK-NEXT: [[TMP27:%.*]] = load float, ptr [[TMP22]], align 4
-; CHECK-NEXT: [[TMP28:%.*]] = insertelement <4 x float> poison, float [[TMP24]], i64 0
-; CHECK-NEXT: [[TMP29:%.*]] = insertelement <4 x float> [[TMP28]], float [[TMP25]], i64 1
-; CHECK-NEXT: [[TMP30:%.*]] = insertelement <4 x float> [[TMP29]], float [[TMP26]], i64 2
-; CHECK-NEXT: [[TMP31:%.*]] = insertelement <4 x float> [[TMP30]], float [[TMP27]], i64 3
+; CHECK-NEXT: [[TMP28:%.*]] = insertelement <4 x float> poison, float [[TMP24]], i32 0
+; CHECK-NEXT: [[TMP29:%.*]] = insertelement <4 x float> [[TMP28]], float [[TMP25]], i32 1
+; CHECK-NEXT: [[TMP30:%.*]] = insertelement <4 x float> [[TMP29]], float [[TMP26]], i32 2
+; CHECK-NEXT: [[TMP31:%.*]] = insertelement <4 x float> [[TMP30]], float [[TMP27]], i32 3
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 8
; CHECK-NEXT: [[TMP34:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
; CHECK-NEXT: br i1 [[TMP34]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP6:![0-9]+]]
diff --git a/llvm/test/Transforms/LoopVectorize/X86/replicating-load-store-costs-max-bandwidth.ll b/llvm/test/Transforms/LoopVectorize/X86/replicating-load-store-costs-max-bandwidth.ll
index 8dbd53a76cbaf..a52e2c7a0dde8 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/replicating-load-store-costs-max-bandwidth.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/replicating-load-store-costs-max-bandwidth.ll
@@ -37,22 +37,22 @@ define void @replicating_store_with_phi_addr1(ptr noalias %array, i64 %N, i32 %x
; CHECK-NEXT: [[TMP14:%.*]] = load i32, ptr [[TMP0]], align 4
; CHECK-NEXT: [[TMP15:%.*]] = load i32, ptr [[TMP0]], align 4
; CHECK-NEXT: [[TMP16:%.*]] = load i32, ptr [[TMP0]], align 4
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <16 x i32> poison, i32 [[TMP1]], i64 0
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <16 x i32> [[TMP17]], i32 [[TMP2]], i64 1
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <16 x i32> [[TMP18]], i32 [[TMP3]], i64 2
-; CHECK-NEXT: [[TMP20:%.*]] = insertelement <16 x i32> [[TMP19]], i32 [[TMP4]], i64 3
-; CHECK-NEXT: [[TMP21:%.*]] = insertelement <16 x i32> [[TMP20]], i32 [[TMP5]], i64 4
-; CHECK-NEXT: [[TMP22:%.*]] = insertelement <16 x i32> [[TMP21]], i32 [[TMP6]], i64 5
-; CHECK-NEXT: [[TMP23:%.*]] = insertelement <16 x i32> [[TMP22]], i32 [[TMP7]], i64 6
-; CHECK-NEXT: [[TMP24:%.*]] = insertelement <16 x i32> [[TMP23]], i32 [[TMP8]], i64 7
-; CHECK-NEXT: [[TMP25:%.*]] = insertelement <16 x i32> [[TMP24]], i32 [[TMP9]], i64 8
-; CHECK-NEXT: [[TMP26:%.*]] = insertelement <16 x i32> [[TMP25]], i32 [[TMP10]], i64 9
-; CHECK-NEXT: [[TMP27:%.*]] = insertelement <16 x i32> [[TMP26]], i32 [[TMP11]], i64 10
-; CHECK-NEXT: [[TMP28:%.*]] = insertelement <16 x i32> [[TMP27]], i32 [[TMP12]], i64 11
-; CHECK-NEXT: [[TMP29:%.*]] = insertelement <16 x i32> [[TMP28]], i32 [[TMP13]], i64 12
-; CHECK-NEXT: [[TMP30:%.*]] = insertelement <16 x i32> [[TMP29]], i32 [[TMP14]], i64 13
-; CHECK-NEXT: [[TMP31:%.*]] = insertelement <16 x i32> [[TMP30]], i32 [[TMP15]], i64 14
-; CHECK-NEXT: [[TMP32:%.*]] = insertelement <16 x i32> [[TMP31]], i32 [[TMP16]], i64 15
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <16 x i32> poison, i32 [[TMP1]], i32 0
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <16 x i32> [[TMP17]], i32 [[TMP2]], i32 1
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <16 x i32> [[TMP18]], i32 [[TMP3]], i32 2
+; CHECK-NEXT: [[TMP20:%.*]] = insertelement <16 x i32> [[TMP19]], i32 [[TMP4]], i32 3
+; CHECK-NEXT: [[TMP21:%.*]] = insertelement <16 x i32> [[TMP20]], i32 [[TMP5]], i32 4
+; CHECK-NEXT: [[TMP22:%.*]] = insertelement <16 x i32> [[TMP21]], i32 [[TMP6]], i32 5
+; CHECK-NEXT: [[TMP23:%.*]] = insertelement <16 x i32> [[TMP22]], i32 [[TMP7]], i32 6
+; CHECK-NEXT: [[TMP24:%.*]] = insertelement <16 x i32> [[TMP23]], i32 [[TMP8]], i32 7
+; CHECK-NEXT: [[TMP25:%.*]] = insertelement <16 x i32> [[TMP24]], i32 [[TMP9]], i32 8
+; CHECK-NEXT: [[TMP26:%.*]] = insertelement <16 x i32> [[TMP25]], i32 [[TMP10]], i32 9
+; CHECK-NEXT: [[TMP27:%.*]] = insertelement <16 x i32> [[TMP26]], i32 [[TMP11]], i32 10
+; CHECK-NEXT: [[TMP28:%.*]] = insertelement <16 x i32> [[TMP27]], i32 [[TMP12]], i32 11
+; CHECK-NEXT: [[TMP29:%.*]] = insertelement <16 x i32> [[TMP28]], i32 [[TMP13]], i32 12
+; CHECK-NEXT: [[TMP30:%.*]] = insertelement <16 x i32> [[TMP29]], i32 [[TMP14]], i32 13
+; CHECK-NEXT: [[TMP31:%.*]] = insertelement <16 x i32> [[TMP30]], i32 [[TMP15]], i32 14
+; CHECK-NEXT: [[TMP32:%.*]] = insertelement <16 x i32> [[TMP31]], i32 [[TMP16]], i32 15
; CHECK-NEXT: [[TMP33:%.*]] = icmp sgt <16 x i32> [[TMP32]], zeroinitializer
; CHECK-NEXT: [[TMP34:%.*]] = xor <16 x i1> [[TMP33]], splat (i1 true)
; CHECK-NEXT: [[TMP35:%.*]] = icmp slt i32 [[X]], [[TMP1]]
@@ -87,22 +87,22 @@ define void @replicating_store_with_phi_addr1(ptr noalias %array, i64 %N, i32 %x
; CHECK-NEXT: [[TMP64:%.*]] = select i1 [[TMP48]], ptr [[PTR2]], ptr [[PTR3]]
; CHECK-NEXT: [[TMP65:%.*]] = select i1 [[TMP49]], ptr [[PTR2]], ptr [[PTR3]]
; CHECK-NEXT: [[TMP66:%.*]] = select i1 [[TMP50]], ptr [[PTR2]], ptr [[PTR3]]
-; CHECK-NEXT: [[TMP67:%.*]] = insertelement <16 x ptr> poison, ptr [[TMP51]], i64 0
-; CHECK-NEXT: [[TMP68:%.*]] = insertelement <16 x ptr> [[TMP67]], ptr [[TMP52]], i64 1
-; CHECK-NEXT: [[TMP69:%.*]] = insertelement <16 x ptr> [[TMP68]], ptr [[TMP53]], i64 2
-; CHECK-NEXT: [[TMP70:%.*]] = insertelement <16 x ptr> [[TMP69]], ptr [[TMP54]], i64 3
-; CHECK-NEXT: [[TMP71:%.*]] = insertelement <16 x ptr> [[TMP70]], ptr [[TMP55]], i64 4
-; CHECK-NEXT: [[TMP72:%.*]] = insertelement <16 x ptr> [[TMP71]], ptr [[TMP56]], i64 5
-; CHECK-NEXT: [[TMP73:%.*]] = insertelement <16 x ptr> [[TMP72]], ptr [[TMP57]], i64 6
-; CHECK-NEXT: [[TMP74:%.*]] = insertelement <16 x ptr> [[TMP73]], ptr [[TMP58]], i64 7
-; CHECK-NEXT: [[TMP75:%.*]] = insertelement <16 x ptr> [[TMP74]], ptr [[TMP59]], i64 8
-; CHECK-NEXT: [[TMP76:%.*]] = insertelement <16 x ptr> [[TMP75]], ptr [[TMP60]], i64 9
-; CHECK-NEXT: [[TMP77:%.*]] = insertelement <16 x ptr> [[TMP76]], ptr [[TMP61]], i64 10
-; CHECK-NEXT: [[TMP78:%.*]] = insertelement <16 x ptr> [[TMP77]], ptr [[TMP62]], i64 11
-; CHECK-NEXT: [[TMP79:%.*]] = insertelement <16 x ptr> [[TMP78]], ptr [[TMP63]], i64 12
-; CHECK-NEXT: [[TMP80:%.*]] = insertelement <16 x ptr> [[TMP79]], ptr [[TMP64]], i64 13
-; CHECK-NEXT: [[TMP81:%.*]] = insertelement <16 x ptr> [[TMP80]], ptr [[TMP65]], i64 14
-; CHECK-NEXT: [[TMP82:%.*]] = insertelement <16 x ptr> [[TMP81]], ptr [[TMP66]], i64 15
+; CHECK-NEXT: [[TMP67:%.*]] = insertelement <16 x ptr> poison, ptr [[TMP51]], i32 0
+; CHECK-NEXT: [[TMP68:%.*]] = insertelement <16 x ptr> [[TMP67]], ptr [[TMP52]], i32 1
+; CHECK-NEXT: [[TMP69:%.*]] = insertelement <16 x ptr> [[TMP68]], ptr [[TMP53]], i32 2
+; CHECK-NEXT: [[TMP70:%.*]] = insertelement <16 x ptr> [[TMP69]], ptr [[TMP54]], i32 3
+; CHECK-NEXT: [[TMP71:%.*]] = insertelement <16 x ptr> [[TMP70]], ptr [[TMP55]], i32 4
+; CHECK-NEXT: [[TMP72:%.*]] = insertelement <16 x ptr> [[TMP71]], ptr [[TMP56]], i32 5
+; CHECK-NEXT: [[TMP73:%.*]] = insertelement <16 x ptr> [[TMP72]], ptr [[TMP57]], i32 6
+; CHECK-NEXT: [[TMP74:%.*]] = insertelement <16 x ptr> [[TMP73]], ptr [[TMP58]], i32 7
+; CHECK-NEXT: [[TMP75:%.*]] = insertelement <16 x ptr> [[TMP74]], ptr [[TMP59]], i32 8
+; CHECK-NEXT: [[TMP76:%.*]] = insertelement <16 x ptr> [[TMP75]], ptr [[TMP60]], i32 9
+; CHECK-NEXT: [[TMP77:%.*]] = insertelement <16 x ptr> [[TMP76]], ptr [[TMP61]], i32 10
+; CHECK-NEXT: [[TMP78:%.*]] = insertelement <16 x ptr> [[TMP77]], ptr [[TMP62]], i32 11
+; CHECK-NEXT: [[TMP79:%.*]] = insertelement <16 x ptr> [[TMP78]], ptr [[TMP63]], i32 12
+; CHECK-NEXT: [[TMP80:%.*]] = insertelement <16 x ptr> [[TMP79]], ptr [[TMP64]], i32 13
+; CHECK-NEXT: [[TMP81:%.*]] = insertelement <16 x ptr> [[TMP80]], ptr [[TMP65]], i32 14
+; CHECK-NEXT: [[TMP82:%.*]] = insertelement <16 x ptr> [[TMP81]], ptr [[TMP66]], i32 15
; CHECK-NEXT: [[TMP83:%.*]] = select <16 x i1> [[TMP33]], <16 x i1> [[BROADCAST_SPLAT2]], <16 x i1> zeroinitializer
; CHECK-NEXT: [[TMP84:%.*]] = or <16 x i1> [[TMP83]], [[TMP34]]
; CHECK-NEXT: [[PREDPHI:%.*]] = select <16 x i1> [[TMP33]], <16 x ptr> [[BROADCAST_SPLAT]], <16 x ptr> [[TMP82]]
diff --git a/llvm/test/Transforms/LoopVectorize/X86/replicating-load-store-costs.ll b/llvm/test/Transforms/LoopVectorize/X86/replicating-load-store-costs.ll
index 1e649aac1329c..291c4f23ebb3c 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/replicating-load-store-costs.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/replicating-load-store-costs.ll
@@ -585,12 +585,12 @@ define double @test_load_used_by_other_load_scev_low_trip_count(ptr %ptr.a, ptr
; I64-NEXT: [[TMP13:%.*]] = getelementptr i8, ptr [[GEP_C]], i64 8
; I64-NEXT: [[LOAD_C:%.*]] = load double, ptr [[GEP_C_OFFSET]], align 8
; I64-NEXT: [[TMP15:%.*]] = load double, ptr [[TMP13]], align 8
-; I64-NEXT: [[TMP16:%.*]] = insertelement <2 x double> poison, double [[LOAD_C]], i64 0
-; I64-NEXT: [[TMP17:%.*]] = insertelement <2 x double> [[TMP16]], double [[TMP15]], i64 1
+; I64-NEXT: [[TMP16:%.*]] = insertelement <2 x double> poison, double [[LOAD_C]], i32 0
+; I64-NEXT: [[TMP17:%.*]] = insertelement <2 x double> [[TMP16]], double [[TMP15]], i32 1
; I64-NEXT: [[LOAD_B:%.*]] = load double, ptr [[GEP_B]], align 8
; I64-NEXT: [[TMP19:%.*]] = load double, ptr [[TMP11]], align 8
-; I64-NEXT: [[TMP20:%.*]] = insertelement <2 x double> poison, double [[LOAD_B]], i64 0
-; I64-NEXT: [[TMP21:%.*]] = insertelement <2 x double> [[TMP20]], double [[TMP19]], i64 1
+; I64-NEXT: [[TMP20:%.*]] = insertelement <2 x double> poison, double [[LOAD_B]], i32 0
+; I64-NEXT: [[TMP21:%.*]] = insertelement <2 x double> [[TMP20]], double [[TMP19]], i32 1
; I64-NEXT: br label %[[MIDDLE_BLOCK:.*]]
; I64: [[MIDDLE_BLOCK]]:
; I64-NEXT: [[TMP22:%.*]] = shufflevector <2 x double> [[BROADCAST_SPLAT2]], <2 x double> [[TMP2]], <2 x i32> <i32 1, i32 2>
@@ -749,14 +749,14 @@ define void @loaded_address_used_by_load_through_blend(i64 %start, ptr noalias %
; I32-NEXT: [[TMP31:%.*]] = load float, ptr [[TMP23]], align 4
; I32-NEXT: [[TMP32:%.*]] = load float, ptr [[TMP24]], align 4
; I32-NEXT: [[TMP33:%.*]] = load float, ptr [[TMP25]], align 4
-; I32-NEXT: [[TMP34:%.*]] = insertelement <8 x float> poison, float [[TMP26]], i64 0
-; I32-NEXT: [[TMP35:%.*]] = insertelement <8 x float> [[TMP34]], float [[TMP27]], i64 1
-; I32-NEXT: [[TMP36:%.*]] = insertelement <8 x float> [[TMP35]], float [[TMP28]], i64 2
-; I32-NEXT: [[TMP37:%.*]] = insertelement <8 x float> [[TMP36]], float [[TMP29]], i64 3
-; I32-NEXT: [[TMP38:%.*]] = insertelement <8 x float> [[TMP37]], float [[TMP30]], i64 4
-; I32-NEXT: [[TMP39:%.*]] = insertelement <8 x float> [[TMP38]], float [[TMP31]], i64 5
-; I32-NEXT: [[TMP40:%.*]] = insertelement <8 x float> [[TMP39]], float [[TMP32]], i64 6
-; I32-NEXT: [[TMP41:%.*]] = insertelement <8 x float> [[TMP40]], float [[TMP33]], i64 7
+; I32-NEXT: [[TMP34:%.*]] = insertelement <8 x float> poison, float [[TMP26]], i32 0
+; I32-NEXT: [[TMP35:%.*]] = insertelement <8 x float> [[TMP34]], float [[TMP27]], i32 1
+; I32-NEXT: [[TMP36:%.*]] = insertelement <8 x float> [[TMP35]], float [[TMP28]], i32 2
+; I32-NEXT: [[TMP37:%.*]] = insertelement <8 x float> [[TMP36]], float [[TMP29]], i32 3
+; I32-NEXT: [[TMP38:%.*]] = insertelement <8 x float> [[TMP37]], float [[TMP30]], i32 4
+; I32-NEXT: [[TMP39:%.*]] = insertelement <8 x float> [[TMP38]], float [[TMP31]], i32 5
+; I32-NEXT: [[TMP40:%.*]] = insertelement <8 x float> [[TMP39]], float [[TMP32]], i32 6
+; I32-NEXT: [[TMP41:%.*]] = insertelement <8 x float> [[TMP40]], float [[TMP33]], i32 7
; I32-NEXT: [[TMP42:%.*]] = fcmp oeq <8 x float> [[TMP41]], zeroinitializer
; I32-NEXT: [[TMP43:%.*]] = mul i64 [[TMP10]], [[START]]
; I32-NEXT: [[TMP44:%.*]] = mul i64 [[TMP11]], [[START]]
@@ -774,14 +774,14 @@ define void @loaded_address_used_by_load_through_blend(i64 %start, ptr noalias %
; I32-NEXT: [[TMP56:%.*]] = getelementptr i8, ptr [[SRC_2]], i64 [[TMP48]]
; I32-NEXT: [[TMP57:%.*]] = getelementptr i8, ptr [[SRC_2]], i64 [[TMP49]]
; I32-NEXT: [[TMP58:%.*]] = getelementptr i8, ptr [[SRC_2]], i64 [[TMP50]]
-; I32-NEXT: [[TMP59:%.*]] = insertelement <8 x ptr> poison, ptr [[TMP51]], i64 0
-; I32-NEXT: [[TMP60:%.*]] = insertelement <8 x ptr> [[TMP59]], ptr [[TMP52]], i64 1
-; I32-NEXT: [[TMP61:%.*]] = insertelement <8 x ptr> [[TMP60]], ptr [[TMP53]], i64 2
-; I32-NEXT: [[TMP62:%.*]] = insertelement <8 x ptr> [[TMP61]], ptr [[TMP54]], i64 3
-; I32-NEXT: [[TMP63:%.*]] = insertelement <8 x ptr> [[TMP62]], ptr [[TMP55]], i64 4
-; I32-NEXT: [[TMP64:%.*]] = insertelement <8 x ptr> [[TMP63]], ptr [[TMP56]], i64 5
-; I32-NEXT: [[TMP65:%.*]] = insertelement <8 x ptr> [[TMP64]], ptr [[TMP57]], i64 6
-; I32-NEXT: [[TMP66:%.*]] = insertelement <8 x ptr> [[TMP65]], ptr [[TMP58]], i64 7
+; I32-NEXT: [[TMP59:%.*]] = insertelement <8 x ptr> poison, ptr [[TMP51]], i32 0
+; I32-NEXT: [[TMP60:%.*]] = insertelement <8 x ptr> [[TMP59]], ptr [[TMP52]], i32 1
+; I32-NEXT: [[TMP61:%.*]] = insertelement <8 x ptr> [[TMP60]], ptr [[TMP53]], i32 2
+; I32-NEXT: [[TMP62:%.*]] = insertelement <8 x ptr> [[TMP61]], ptr [[TMP54]], i32 3
+; I32-NEXT: [[TMP63:%.*]] = insertelement <8 x ptr> [[TMP62]], ptr [[TMP55]], i32 4
+; I32-NEXT: [[TMP64:%.*]] = insertelement <8 x ptr> [[TMP63]], ptr [[TMP56]], i32 5
+; I32-NEXT: [[TMP65:%.*]] = insertelement <8 x ptr> [[TMP64]], ptr [[TMP57]], i32 6
+; I32-NEXT: [[TMP66:%.*]] = insertelement <8 x ptr> [[TMP65]], ptr [[TMP58]], i32 7
; I32-NEXT: [[PREDPHI:%.*]] = select <8 x i1> [[TMP42]], <8 x ptr> [[TMP66]], <8 x ptr> [[BROADCAST_SPLAT]]
; I32-NEXT: [[TMP67:%.*]] = extractelement <8 x ptr> [[PREDPHI]], i64 0
; I32-NEXT: [[TMP75:%.*]] = load float, ptr [[TMP67]], align 4
@@ -896,10 +896,10 @@ define void @address_use_in_different_block(ptr noalias %dst, ptr %src.0, ptr %s
; I64-NEXT: [[TMP64:%.*]] = load double, ptr [[TMP52]], align 8
; I64-NEXT: [[TMP67:%.*]] = load double, ptr [[TMP53]], align 8
; I64-NEXT: [[TMP68:%.*]] = load double, ptr [[TMP54]], align 8
-; I64-NEXT: [[TMP31:%.*]] = insertelement <4 x double> poison, double [[TMP63]], i64 0
-; I64-NEXT: [[TMP32:%.*]] = insertelement <4 x double> [[TMP31]], double [[TMP64]], i64 1
-; I64-NEXT: [[TMP33:%.*]] = insertelement <4 x double> [[TMP32]], double [[TMP67]], i64 2
-; I64-NEXT: [[TMP34:%.*]] = insertelement <4 x double> [[TMP33]], double [[TMP68]], i64 3
+; I64-NEXT: [[TMP31:%.*]] = insertelement <4 x double> poison, double [[TMP63]], i32 0
+; I64-NEXT: [[TMP32:%.*]] = insertelement <4 x double> [[TMP31]], double [[TMP64]], i32 1
+; I64-NEXT: [[TMP33:%.*]] = insertelement <4 x double> [[TMP32]], double [[TMP67]], i32 2
+; I64-NEXT: [[TMP34:%.*]] = insertelement <4 x double> [[TMP33]], double [[TMP68]], i32 3
; I64-NEXT: [[TMP39:%.*]] = fsub <4 x double> zeroinitializer, [[TMP34]]
; I64-NEXT: [[TMP87:%.*]] = getelementptr double, ptr [[DST]], i64 [[TMP11]]
; I64-NEXT: [[TMP88:%.*]] = getelementptr double, ptr [[DST]], i64 [[TMP12]]
@@ -961,10 +961,10 @@ define void @address_use_in_different_block(ptr noalias %dst, ptr %src.0, ptr %s
; I32-NEXT: [[TMP28:%.*]] = load double, ptr [[TMP24]], align 8
; I32-NEXT: [[TMP29:%.*]] = load double, ptr [[TMP25]], align 8
; I32-NEXT: [[TMP30:%.*]] = load double, ptr [[TMP26]], align 8
-; I32-NEXT: [[TMP31:%.*]] = insertelement <4 x double> poison, double [[TMP27]], i64 0
-; I32-NEXT: [[TMP32:%.*]] = insertelement <4 x double> [[TMP31]], double [[TMP28]], i64 1
-; I32-NEXT: [[TMP33:%.*]] = insertelement <4 x double> [[TMP32]], double [[TMP29]], i64 2
-; I32-NEXT: [[TMP34:%.*]] = insertelement <4 x double> [[TMP33]], double [[TMP30]], i64 3
+; I32-NEXT: [[TMP31:%.*]] = insertelement <4 x double> poison, double [[TMP27]], i32 0
+; I32-NEXT: [[TMP32:%.*]] = insertelement <4 x double> [[TMP31]], double [[TMP28]], i32 1
+; I32-NEXT: [[TMP33:%.*]] = insertelement <4 x double> [[TMP32]], double [[TMP29]], i32 2
+; I32-NEXT: [[TMP34:%.*]] = insertelement <4 x double> [[TMP33]], double [[TMP30]], i32 3
; I32-NEXT: [[TMP35:%.*]] = fsub <4 x double> zeroinitializer, [[TMP34]]
; I32-NEXT: [[TMP40:%.*]] = getelementptr double, ptr [[DST]], i64 [[TMP3]]
; I32-NEXT: [[TMP41:%.*]] = getelementptr double, ptr [[DST]], i64 [[TMP4]]
@@ -1080,18 +1080,18 @@ define void @replicated_load_wide_store_derived_iv_zext_and(ptr noalias %src, pt
; I64-NEXT: [[TMP48:%.*]] = load float, ptr [[TMP40]], align 4
; I64-NEXT: [[TMP49:%.*]] = load float, ptr [[TMP41]], align 4
; I64-NEXT: [[TMP50:%.*]] = load float, ptr [[TMP42]], align 4
-; I64-NEXT: [[TMP51:%.*]] = insertelement <4 x float> poison, float [[TMP47]], i64 0
-; I64-NEXT: [[TMP52:%.*]] = insertelement <4 x float> [[TMP51]], float [[TMP48]], i64 1
-; I64-NEXT: [[TMP53:%.*]] = insertelement <4 x float> [[TMP52]], float [[TMP49]], i64 2
-; I64-NEXT: [[TMP54:%.*]] = insertelement <4 x float> [[TMP53]], float [[TMP50]], i64 3
+; I64-NEXT: [[TMP51:%.*]] = insertelement <4 x float> poison, float [[TMP47]], i32 0
+; I64-NEXT: [[TMP52:%.*]] = insertelement <4 x float> [[TMP51]], float [[TMP48]], i32 1
+; I64-NEXT: [[TMP53:%.*]] = insertelement <4 x float> [[TMP52]], float [[TMP49]], i32 2
+; I64-NEXT: [[TMP54:%.*]] = insertelement <4 x float> [[TMP53]], float [[TMP50]], i32 3
; I64-NEXT: [[TMP55:%.*]] = load float, ptr [[TMP43]], align 4
; I64-NEXT: [[TMP56:%.*]] = load float, ptr [[TMP44]], align 4
; I64-NEXT: [[TMP57:%.*]] = load float, ptr [[TMP45]], align 4
; I64-NEXT: [[TMP58:%.*]] = load float, ptr [[TMP46]], align 4
-; I64-NEXT: [[TMP59:%.*]] = insertelement <4 x float> poison, float [[TMP55]], i64 0
-; I64-NEXT: [[TMP60:%.*]] = insertelement <4 x float> [[TMP59]], float [[TMP56]], i64 1
-; I64-NEXT: [[TMP61:%.*]] = insertelement <4 x float> [[TMP60]], float [[TMP57]], i64 2
-; I64-NEXT: [[TMP62:%.*]] = insertelement <4 x float> [[TMP61]], float [[TMP58]], i64 3
+; I64-NEXT: [[TMP59:%.*]] = insertelement <4 x float> poison, float [[TMP55]], i32 0
+; I64-NEXT: [[TMP60:%.*]] = insertelement <4 x float> [[TMP59]], float [[TMP56]], i32 1
+; I64-NEXT: [[TMP61:%.*]] = insertelement <4 x float> [[TMP60]], float [[TMP57]], i32 2
+; I64-NEXT: [[TMP62:%.*]] = insertelement <4 x float> [[TMP61]], float [[TMP58]], i32 3
; I64-NEXT: [[TMP63:%.*]] = getelementptr float, ptr [[DST]], i64 [[INDEX]]
; I64-NEXT: [[TMP64:%.*]] = getelementptr float, ptr [[TMP63]], i64 4
; I64-NEXT: store <4 x float> [[TMP54]], ptr [[TMP63]], align 4
@@ -1196,18 +1196,18 @@ define void @replicated_load_wide_store_derived_iv_zext_and2(ptr noalias %dst, p
; I64-NEXT: [[TMP40:%.*]] = load float, ptr [[TMP32]], align 4
; I64-NEXT: [[TMP41:%.*]] = load float, ptr [[TMP33]], align 4
; I64-NEXT: [[TMP42:%.*]] = load float, ptr [[TMP34]], align 4
-; I64-NEXT: [[TMP43:%.*]] = insertelement <4 x float> poison, float [[TMP39]], i64 0
-; I64-NEXT: [[TMP44:%.*]] = insertelement <4 x float> [[TMP43]], float [[TMP40]], i64 1
-; I64-NEXT: [[TMP45:%.*]] = insertelement <4 x float> [[TMP44]], float [[TMP41]], i64 2
-; I64-NEXT: [[TMP46:%.*]] = insertelement <4 x float> [[TMP45]], float [[TMP42]], i64 3
+; I64-NEXT: [[TMP43:%.*]] = insertelement <4 x float> poison, float [[TMP39]], i32 0
+; I64-NEXT: [[TMP44:%.*]] = insertelement <4 x float> [[TMP43]], float [[TMP40]], i32 1
+; I64-NEXT: [[TMP45:%.*]] = insertelement <4 x float> [[TMP44]], float [[TMP41]], i32 2
+; I64-NEXT: [[TMP46:%.*]] = insertelement <4 x float> [[TMP45]], float [[TMP42]], i32 3
; I64-NEXT: [[TMP47:%.*]] = load float, ptr [[TMP35]], align 4
; I64-NEXT: [[TMP48:%.*]] = load float, ptr [[TMP36]], align 4
; I64-NEXT: [[TMP49:%.*]] = load float, ptr [[TMP37]], align 4
; I64-NEXT: [[TMP50:%.*]] = load float, ptr [[TMP38]], align 4
-; I64-NEXT: [[TMP51:%.*]] = insertelement <4 x float> poison, float [[TMP47]], i64 0
-; I64-NEXT: [[TMP52:%.*]] = insertelement <4 x float> [[TMP51]], float [[TMP48]], i64 1
-; I64-NEXT: [[TMP53:%.*]] = insertelement <4 x float> [[TMP52]], float [[TMP49]], i64 2
-; I64-NEXT: [[TMP54:%.*]] = insertelement <4 x float> [[TMP53]], float [[TMP50]], i64 3
+; I64-NEXT: [[TMP51:%.*]] = insertelement <4 x float> poison, float [[TMP47]], i32 0
+; I64-NEXT: [[TMP52:%.*]] = insertelement <4 x float> [[TMP51]], float [[TMP48]], i32 1
+; I64-NEXT: [[TMP53:%.*]] = insertelement <4 x float> [[TMP52]], float [[TMP49]], i32 2
+; I64-NEXT: [[TMP54:%.*]] = insertelement <4 x float> [[TMP53]], float [[TMP50]], i32 3
; I64-NEXT: [[TMP55:%.*]] = getelementptr float, ptr [[DST]], i64 [[INDEX]]
; I64-NEXT: [[TMP56:%.*]] = getelementptr float, ptr [[TMP55]], i64 4
; I64-NEXT: store <4 x float> [[TMP46]], ptr [[TMP55]], align 4
diff --git a/llvm/test/Transforms/LoopVectorize/X86/strided_load_cost.ll b/llvm/test/Transforms/LoopVectorize/X86/strided_load_cost.ll
index 576a27bce5df4..9a56ecd2edd1a 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/strided_load_cost.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/strided_load_cost.ll
@@ -104,14 +104,14 @@ define i32 @matrix_row_col(ptr nocapture readonly %data, i32 %i, i32 %j) #0 {
; CHECK-NEXT: [[TMP77:%.*]] = load i32, ptr [[TMP45]], align 4
; CHECK-NEXT: [[TMP78:%.*]] = load i32, ptr [[TMP46]], align 4
; CHECK-NEXT: [[TMP79:%.*]] = load i32, ptr [[TMP47]], align 4
-; CHECK-NEXT: [[TMP80:%.*]] = insertelement <8 x i32> poison, i32 [[TMP72]], i64 0
-; CHECK-NEXT: [[TMP81:%.*]] = insertelement <8 x i32> [[TMP80]], i32 [[TMP73]], i64 1
-; CHECK-NEXT: [[TMP82:%.*]] = insertelement <8 x i32> [[TMP81]], i32 [[TMP74]], i64 2
-; CHECK-NEXT: [[TMP83:%.*]] = insertelement <8 x i32> [[TMP82]], i32 [[TMP75]], i64 3
-; CHECK-NEXT: [[TMP84:%.*]] = insertelement <8 x i32> [[TMP83]], i32 [[TMP76]], i64 4
-; CHECK-NEXT: [[TMP85:%.*]] = insertelement <8 x i32> [[TMP84]], i32 [[TMP77]], i64 5
-; CHECK-NEXT: [[TMP86:%.*]] = insertelement <8 x i32> [[TMP85]], i32 [[TMP78]], i64 6
-; CHECK-NEXT: [[TMP87:%.*]] = insertelement <8 x i32> [[TMP86]], i32 [[TMP79]], i64 7
+; CHECK-NEXT: [[TMP80:%.*]] = insertelement <8 x i32> poison, i32 [[TMP72]], i32 0
+; CHECK-NEXT: [[TMP81:%.*]] = insertelement <8 x i32> [[TMP80]], i32 [[TMP73]], i32 1
+; CHECK-NEXT: [[TMP82:%.*]] = insertelement <8 x i32> [[TMP81]], i32 [[TMP74]], i32 2
+; CHECK-NEXT: [[TMP83:%.*]] = insertelement <8 x i32> [[TMP82]], i32 [[TMP75]], i32 3
+; CHECK-NEXT: [[TMP84:%.*]] = insertelement <8 x i32> [[TMP83]], i32 [[TMP76]], i32 4
+; CHECK-NEXT: [[TMP85:%.*]] = insertelement <8 x i32> [[TMP84]], i32 [[TMP77]], i32 5
+; CHECK-NEXT: [[TMP86:%.*]] = insertelement <8 x i32> [[TMP85]], i32 [[TMP78]], i32 6
+; CHECK-NEXT: [[TMP87:%.*]] = insertelement <8 x i32> [[TMP86]], i32 [[TMP79]], i32 7
; CHECK-NEXT: [[TMP88:%.*]] = load i32, ptr [[TMP48]], align 4
; CHECK-NEXT: [[TMP89:%.*]] = load i32, ptr [[TMP49]], align 4
; CHECK-NEXT: [[TMP90:%.*]] = load i32, ptr [[TMP50]], align 4
@@ -120,14 +120,14 @@ define i32 @matrix_row_col(ptr nocapture readonly %data, i32 %i, i32 %j) #0 {
; CHECK-NEXT: [[TMP93:%.*]] = load i32, ptr [[TMP53]], align 4
; CHECK-NEXT: [[TMP94:%.*]] = load i32, ptr [[TMP54]], align 4
; CHECK-NEXT: [[TMP95:%.*]] = load i32, ptr [[TMP55]], align 4
-; CHECK-NEXT: [[TMP96:%.*]] = insertelement <8 x i32> poison, i32 [[TMP88]], i64 0
-; CHECK-NEXT: [[TMP97:%.*]] = insertelement <8 x i32> [[TMP96]], i32 [[TMP89]], i64 1
-; CHECK-NEXT: [[TMP98:%.*]] = insertelement <8 x i32> [[TMP97]], i32 [[TMP90]], i64 2
-; CHECK-NEXT: [[TMP99:%.*]] = insertelement <8 x i32> [[TMP98]], i32 [[TMP91]], i64 3
-; CHECK-NEXT: [[TMP100:%.*]] = insertelement <8 x i32> [[TMP99]], i32 [[TMP92]], i64 4
-; CHECK-NEXT: [[TMP101:%.*]] = insertelement <8 x i32> [[TMP100]], i32 [[TMP93]], i64 5
-; CHECK-NEXT: [[TMP102:%.*]] = insertelement <8 x i32> [[TMP101]], i32 [[TMP94]], i64 6
-; CHECK-NEXT: [[TMP103:%.*]] = insertelement <8 x i32> [[TMP102]], i32 [[TMP95]], i64 7
+; CHECK-NEXT: [[TMP96:%.*]] = insertelement <8 x i32> poison, i32 [[TMP88]], i32 0
+; CHECK-NEXT: [[TMP97:%.*]] = insertelement <8 x i32> [[TMP96]], i32 [[TMP89]], i32 1
+; CHECK-NEXT: [[TMP98:%.*]] = insertelement <8 x i32> [[TMP97]], i32 [[TMP90]], i32 2
+; CHECK-NEXT: [[TMP99:%.*]] = insertelement <8 x i32> [[TMP98]], i32 [[TMP91]], i32 3
+; CHECK-NEXT: [[TMP100:%.*]] = insertelement <8 x i32> [[TMP99]], i32 [[TMP92]], i32 4
+; CHECK-NEXT: [[TMP101:%.*]] = insertelement <8 x i32> [[TMP100]], i32 [[TMP93]], i32 5
+; CHECK-NEXT: [[TMP102:%.*]] = insertelement <8 x i32> [[TMP101]], i32 [[TMP94]], i32 6
+; CHECK-NEXT: [[TMP103:%.*]] = insertelement <8 x i32> [[TMP102]], i32 [[TMP95]], i32 7
; CHECK-NEXT: [[TMP104:%.*]] = load i32, ptr [[TMP56]], align 4
; CHECK-NEXT: [[TMP105:%.*]] = load i32, ptr [[TMP57]], align 4
; CHECK-NEXT: [[TMP106:%.*]] = load i32, ptr [[TMP58]], align 4
@@ -136,14 +136,14 @@ define i32 @matrix_row_col(ptr nocapture readonly %data, i32 %i, i32 %j) #0 {
; CHECK-NEXT: [[TMP109:%.*]] = load i32, ptr [[TMP61]], align 4
; CHECK-NEXT: [[TMP110:%.*]] = load i32, ptr [[TMP62]], align 4
; CHECK-NEXT: [[TMP111:%.*]] = load i32, ptr [[TMP63]], align 4
-; CHECK-NEXT: [[TMP112:%.*]] = insertelement <8 x i32> poison, i32 [[TMP104]], i64 0
-; CHECK-NEXT: [[TMP113:%.*]] = insertelement <8 x i32> [[TMP112]], i32 [[TMP105]], i64 1
-; CHECK-NEXT: [[TMP114:%.*]] = insertelement <8 x i32> [[TMP113]], i32 [[TMP106]], i64 2
-; CHECK-NEXT: [[TMP115:%.*]] = insertelement <8 x i32> [[TMP114]], i32 [[TMP107]], i64 3
-; CHECK-NEXT: [[TMP116:%.*]] = insertelement <8 x i32> [[TMP115]], i32 [[TMP108]], i64 4
-; CHECK-NEXT: [[TMP117:%.*]] = insertelement <8 x i32> [[TMP116]], i32 [[TMP109]], i64 5
-; CHECK-NEXT: [[TMP118:%.*]] = insertelement <8 x i32> [[TMP117]], i32 [[TMP110]], i64 6
-; CHECK-NEXT: [[TMP119:%.*]] = insertelement <8 x i32> [[TMP118]], i32 [[TMP111]], i64 7
+; CHECK-NEXT: [[TMP112:%.*]] = insertelement <8 x i32> poison, i32 [[TMP104]], i32 0
+; CHECK-NEXT: [[TMP113:%.*]] = insertelement <8 x i32> [[TMP112]], i32 [[TMP105]], i32 1
+; CHECK-NEXT: [[TMP114:%.*]] = insertelement <8 x i32> [[TMP113]], i32 [[TMP106]], i32 2
+; CHECK-NEXT: [[TMP115:%.*]] = insertelement <8 x i32> [[TMP114]], i32 [[TMP107]], i32 3
+; CHECK-NEXT: [[TMP116:%.*]] = insertelement <8 x i32> [[TMP115]], i32 [[TMP108]], i32 4
+; CHECK-NEXT: [[TMP117:%.*]] = insertelement <8 x i32> [[TMP116]], i32 [[TMP109]], i32 5
+; CHECK-NEXT: [[TMP118:%.*]] = insertelement <8 x i32> [[TMP117]], i32 [[TMP110]], i32 6
+; CHECK-NEXT: [[TMP119:%.*]] = insertelement <8 x i32> [[TMP118]], i32 [[TMP111]], i32 7
; CHECK-NEXT: [[TMP120:%.*]] = load i32, ptr [[TMP64]], align 4
; CHECK-NEXT: [[TMP121:%.*]] = load i32, ptr [[TMP65]], align 4
; CHECK-NEXT: [[TMP122:%.*]] = load i32, ptr [[TMP66]], align 4
@@ -152,14 +152,14 @@ define i32 @matrix_row_col(ptr nocapture readonly %data, i32 %i, i32 %j) #0 {
; CHECK-NEXT: [[TMP125:%.*]] = load i32, ptr [[TMP69]], align 4
; CHECK-NEXT: [[TMP126:%.*]] = load i32, ptr [[TMP70]], align 4
; CHECK-NEXT: [[TMP127:%.*]] = load i32, ptr [[TMP71]], align 4
-; CHECK-NEXT: [[TMP128:%.*]] = insertelement <8 x i32> poison, i32 [[TMP120]], i64 0
-; CHECK-NEXT: [[TMP129:%.*]] = insertelement <8 x i32> [[TMP128]], i32 [[TMP121]], i64 1
-; CHECK-NEXT: [[TMP130:%.*]] = insertelement <8 x i32> [[TMP129]], i32 [[TMP122]], i64 2
-; CHECK-NEXT: [[TMP131:%.*]] = insertelement <8 x i32> [[TMP130]], i32 [[TMP123]], i64 3
-; CHECK-NEXT: [[TMP132:%.*]] = insertelement <8 x i32> [[TMP131]], i32 [[TMP124]], i64 4
-; CHECK-NEXT: [[TMP133:%.*]] = insertelement <8 x i32> [[TMP132]], i32 [[TMP125]], i64 5
-; CHECK-NEXT: [[TMP134:%.*]] = insertelement <8 x i32> [[TMP133]], i32 [[TMP126]], i64 6
-; CHECK-NEXT: [[TMP135:%.*]] = insertelement <8 x i32> [[TMP134]], i32 [[TMP127]], i64 7
+; CHECK-NEXT: [[TMP128:%.*]] = insertelement <8 x i32> poison, i32 [[TMP120]], i32 0
+; CHECK-NEXT: [[TMP129:%.*]] = insertelement <8 x i32> [[TMP128]], i32 [[TMP121]], i32 1
+; CHECK-NEXT: [[TMP130:%.*]] = insertelement <8 x i32> [[TMP129]], i32 [[TMP122]], i32 2
+; CHECK-NEXT: [[TMP131:%.*]] = insertelement <8 x i32> [[TMP130]], i32 [[TMP123]], i32 3
+; CHECK-NEXT: [[TMP132:%.*]] = insertelement <8 x i32> [[TMP131]], i32 [[TMP124]], i32 4
+; CHECK-NEXT: [[TMP133:%.*]] = insertelement <8 x i32> [[TMP132]], i32 [[TMP125]], i32 5
+; CHECK-NEXT: [[TMP134:%.*]] = insertelement <8 x i32> [[TMP133]], i32 [[TMP126]], i32 6
+; CHECK-NEXT: [[TMP135:%.*]] = insertelement <8 x i32> [[TMP134]], i32 [[TMP127]], i32 7
; CHECK-NEXT: [[TMP136:%.*]] = mul nsw <8 x i32> [[TMP87]], [[WIDE_LOAD]]
; CHECK-NEXT: [[TMP137:%.*]] = mul nsw <8 x i32> [[TMP103]], [[WIDE_LOAD4]]
; CHECK-NEXT: [[TMP138:%.*]] = mul nsw <8 x i32> [[TMP119]], [[WIDE_LOAD5]]
@@ -186,7 +186,7 @@ define i32 @matrix_row_col(ptr nocapture readonly %data, i32 %i, i32 %j) #0 {
; CHECK: [[VEC_EPILOG_PH]]:
; CHECK-NEXT: [[VEC_EPILOG_RESUME_VAL:%.*]] = phi i64 [ 96, %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP149]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
-; CHECK-NEXT: [[TMP171:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP171:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX9:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT12:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
@@ -204,10 +204,10 @@ define i32 @matrix_row_col(ptr nocapture readonly %data, i32 %i, i32 %j) #0 {
; CHECK-NEXT: [[TMP159:%.*]] = load i32, ptr [[TMP155]], align 4
; CHECK-NEXT: [[TMP160:%.*]] = load i32, ptr [[TMP156]], align 4
; CHECK-NEXT: [[TMP161:%.*]] = load i32, ptr [[TMP157]], align 4
-; CHECK-NEXT: [[TMP162:%.*]] = insertelement <4 x i32> poison, i32 [[TMP158]], i64 0
-; CHECK-NEXT: [[TMP163:%.*]] = insertelement <4 x i32> [[TMP162]], i32 [[TMP159]], i64 1
-; CHECK-NEXT: [[TMP164:%.*]] = insertelement <4 x i32> [[TMP163]], i32 [[TMP160]], i64 2
-; CHECK-NEXT: [[TMP165:%.*]] = insertelement <4 x i32> [[TMP164]], i32 [[TMP161]], i64 3
+; CHECK-NEXT: [[TMP162:%.*]] = insertelement <4 x i32> poison, i32 [[TMP158]], i32 0
+; CHECK-NEXT: [[TMP163:%.*]] = insertelement <4 x i32> [[TMP162]], i32 [[TMP159]], i32 1
+; CHECK-NEXT: [[TMP164:%.*]] = insertelement <4 x i32> [[TMP163]], i32 [[TMP160]], i32 2
+; CHECK-NEXT: [[TMP165:%.*]] = insertelement <4 x i32> [[TMP164]], i32 [[TMP161]], i32 3
; CHECK-NEXT: [[TMP166:%.*]] = mul nsw <4 x i32> [[TMP165]], [[WIDE_LOAD11]]
; CHECK-NEXT: [[TMP167:%.*]] = add <4 x i32> [[VEC_PHI10]], splat (i32 4)
; CHECK-NEXT: [[TMP168]] = add <4 x i32> [[TMP167]], [[TMP166]]
@@ -333,14 +333,14 @@ define i32 @matrix_row_col(ptr nocapture readonly %data, i32 %i, i32 %j) #0 {
; MAX-BW-NEXT: [[TMP77:%.*]] = load i32, ptr [[TMP45]], align 4
; MAX-BW-NEXT: [[TMP78:%.*]] = load i32, ptr [[TMP46]], align 4
; MAX-BW-NEXT: [[TMP79:%.*]] = load i32, ptr [[TMP47]], align 4
-; MAX-BW-NEXT: [[TMP80:%.*]] = insertelement <8 x i32> poison, i32 [[TMP72]], i64 0
-; MAX-BW-NEXT: [[TMP81:%.*]] = insertelement <8 x i32> [[TMP80]], i32 [[TMP73]], i64 1
-; MAX-BW-NEXT: [[TMP82:%.*]] = insertelement <8 x i32> [[TMP81]], i32 [[TMP74]], i64 2
-; MAX-BW-NEXT: [[TMP83:%.*]] = insertelement <8 x i32> [[TMP82]], i32 [[TMP75]], i64 3
-; MAX-BW-NEXT: [[TMP84:%.*]] = insertelement <8 x i32> [[TMP83]], i32 [[TMP76]], i64 4
-; MAX-BW-NEXT: [[TMP85:%.*]] = insertelement <8 x i32> [[TMP84]], i32 [[TMP77]], i64 5
-; MAX-BW-NEXT: [[TMP86:%.*]] = insertelement <8 x i32> [[TMP85]], i32 [[TMP78]], i64 6
-; MAX-BW-NEXT: [[TMP87:%.*]] = insertelement <8 x i32> [[TMP86]], i32 [[TMP79]], i64 7
+; MAX-BW-NEXT: [[TMP80:%.*]] = insertelement <8 x i32> poison, i32 [[TMP72]], i32 0
+; MAX-BW-NEXT: [[TMP81:%.*]] = insertelement <8 x i32> [[TMP80]], i32 [[TMP73]], i32 1
+; MAX-BW-NEXT: [[TMP82:%.*]] = insertelement <8 x i32> [[TMP81]], i32 [[TMP74]], i32 2
+; MAX-BW-NEXT: [[TMP83:%.*]] = insertelement <8 x i32> [[TMP82]], i32 [[TMP75]], i32 3
+; MAX-BW-NEXT: [[TMP84:%.*]] = insertelement <8 x i32> [[TMP83]], i32 [[TMP76]], i32 4
+; MAX-BW-NEXT: [[TMP85:%.*]] = insertelement <8 x i32> [[TMP84]], i32 [[TMP77]], i32 5
+; MAX-BW-NEXT: [[TMP86:%.*]] = insertelement <8 x i32> [[TMP85]], i32 [[TMP78]], i32 6
+; MAX-BW-NEXT: [[TMP87:%.*]] = insertelement <8 x i32> [[TMP86]], i32 [[TMP79]], i32 7
; MAX-BW-NEXT: [[TMP88:%.*]] = load i32, ptr [[TMP48]], align 4
; MAX-BW-NEXT: [[TMP89:%.*]] = load i32, ptr [[TMP49]], align 4
; MAX-BW-NEXT: [[TMP90:%.*]] = load i32, ptr [[TMP50]], align 4
@@ -349,14 +349,14 @@ define i32 @matrix_row_col(ptr nocapture readonly %data, i32 %i, i32 %j) #0 {
; MAX-BW-NEXT: [[TMP93:%.*]] = load i32, ptr [[TMP53]], align 4
; MAX-BW-NEXT: [[TMP94:%.*]] = load i32, ptr [[TMP54]], align 4
; MAX-BW-NEXT: [[TMP95:%.*]] = load i32, ptr [[TMP55]], align 4
-; MAX-BW-NEXT: [[TMP96:%.*]] = insertelement <8 x i32> poison, i32 [[TMP88]], i64 0
-; MAX-BW-NEXT: [[TMP97:%.*]] = insertelement <8 x i32> [[TMP96]], i32 [[TMP89]], i64 1
-; MAX-BW-NEXT: [[TMP98:%.*]] = insertelement <8 x i32> [[TMP97]], i32 [[TMP90]], i64 2
-; MAX-BW-NEXT: [[TMP99:%.*]] = insertelement <8 x i32> [[TMP98]], i32 [[TMP91]], i64 3
-; MAX-BW-NEXT: [[TMP100:%.*]] = insertelement <8 x i32> [[TMP99]], i32 [[TMP92]], i64 4
-; MAX-BW-NEXT: [[TMP101:%.*]] = insertelement <8 x i32> [[TMP100]], i32 [[TMP93]], i64 5
-; MAX-BW-NEXT: [[TMP102:%.*]] = insertelement <8 x i32> [[TMP101]], i32 [[TMP94]], i64 6
-; MAX-BW-NEXT: [[TMP103:%.*]] = insertelement <8 x i32> [[TMP102]], i32 [[TMP95]], i64 7
+; MAX-BW-NEXT: [[TMP96:%.*]] = insertelement <8 x i32> poison, i32 [[TMP88]], i32 0
+; MAX-BW-NEXT: [[TMP97:%.*]] = insertelement <8 x i32> [[TMP96]], i32 [[TMP89]], i32 1
+; MAX-BW-NEXT: [[TMP98:%.*]] = insertelement <8 x i32> [[TMP97]], i32 [[TMP90]], i32 2
+; MAX-BW-NEXT: [[TMP99:%.*]] = insertelement <8 x i32> [[TMP98]], i32 [[TMP91]], i32 3
+; MAX-BW-NEXT: [[TMP100:%.*]] = insertelement <8 x i32> [[TMP99]], i32 [[TMP92]], i32 4
+; MAX-BW-NEXT: [[TMP101:%.*]] = insertelement <8 x i32> [[TMP100]], i32 [[TMP93]], i32 5
+; MAX-BW-NEXT: [[TMP102:%.*]] = insertelement <8 x i32> [[TMP101]], i32 [[TMP94]], i32 6
+; MAX-BW-NEXT: [[TMP103:%.*]] = insertelement <8 x i32> [[TMP102]], i32 [[TMP95]], i32 7
; MAX-BW-NEXT: [[TMP104:%.*]] = load i32, ptr [[TMP56]], align 4
; MAX-BW-NEXT: [[TMP105:%.*]] = load i32, ptr [[TMP57]], align 4
; MAX-BW-NEXT: [[TMP106:%.*]] = load i32, ptr [[TMP58]], align 4
@@ -365,14 +365,14 @@ define i32 @matrix_row_col(ptr nocapture readonly %data, i32 %i, i32 %j) #0 {
; MAX-BW-NEXT: [[TMP109:%.*]] = load i32, ptr [[TMP61]], align 4
; MAX-BW-NEXT: [[TMP110:%.*]] = load i32, ptr [[TMP62]], align 4
; MAX-BW-NEXT: [[TMP111:%.*]] = load i32, ptr [[TMP63]], align 4
-; MAX-BW-NEXT: [[TMP112:%.*]] = insertelement <8 x i32> poison, i32 [[TMP104]], i64 0
-; MAX-BW-NEXT: [[TMP113:%.*]] = insertelement <8 x i32> [[TMP112]], i32 [[TMP105]], i64 1
-; MAX-BW-NEXT: [[TMP114:%.*]] = insertelement <8 x i32> [[TMP113]], i32 [[TMP106]], i64 2
-; MAX-BW-NEXT: [[TMP115:%.*]] = insertelement <8 x i32> [[TMP114]], i32 [[TMP107]], i64 3
-; MAX-BW-NEXT: [[TMP116:%.*]] = insertelement <8 x i32> [[TMP115]], i32 [[TMP108]], i64 4
-; MAX-BW-NEXT: [[TMP117:%.*]] = insertelement <8 x i32> [[TMP116]], i32 [[TMP109]], i64 5
-; MAX-BW-NEXT: [[TMP118:%.*]] = insertelement <8 x i32> [[TMP117]], i32 [[TMP110]], i64 6
-; MAX-BW-NEXT: [[TMP119:%.*]] = insertelement <8 x i32> [[TMP118]], i32 [[TMP111]], i64 7
+; MAX-BW-NEXT: [[TMP112:%.*]] = insertelement <8 x i32> poison, i32 [[TMP104]], i32 0
+; MAX-BW-NEXT: [[TMP113:%.*]] = insertelement <8 x i32> [[TMP112]], i32 [[TMP105]], i32 1
+; MAX-BW-NEXT: [[TMP114:%.*]] = insertelement <8 x i32> [[TMP113]], i32 [[TMP106]], i32 2
+; MAX-BW-NEXT: [[TMP115:%.*]] = insertelement <8 x i32> [[TMP114]], i32 [[TMP107]], i32 3
+; MAX-BW-NEXT: [[TMP116:%.*]] = insertelement <8 x i32> [[TMP115]], i32 [[TMP108]], i32 4
+; MAX-BW-NEXT: [[TMP117:%.*]] = insertelement <8 x i32> [[TMP116]], i32 [[TMP109]], i32 5
+; MAX-BW-NEXT: [[TMP118:%.*]] = insertelement <8 x i32> [[TMP117]], i32 [[TMP110]], i32 6
+; MAX-BW-NEXT: [[TMP119:%.*]] = insertelement <8 x i32> [[TMP118]], i32 [[TMP111]], i32 7
; MAX-BW-NEXT: [[TMP120:%.*]] = load i32, ptr [[TMP64]], align 4
; MAX-BW-NEXT: [[TMP121:%.*]] = load i32, ptr [[TMP65]], align 4
; MAX-BW-NEXT: [[TMP122:%.*]] = load i32, ptr [[TMP66]], align 4
@@ -381,14 +381,14 @@ define i32 @matrix_row_col(ptr nocapture readonly %data, i32 %i, i32 %j) #0 {
; MAX-BW-NEXT: [[TMP125:%.*]] = load i32, ptr [[TMP69]], align 4
; MAX-BW-NEXT: [[TMP126:%.*]] = load i32, ptr [[TMP70]], align 4
; MAX-BW-NEXT: [[TMP127:%.*]] = load i32, ptr [[TMP71]], align 4
-; MAX-BW-NEXT: [[TMP128:%.*]] = insertelement <8 x i32> poison, i32 [[TMP120]], i64 0
-; MAX-BW-NEXT: [[TMP129:%.*]] = insertelement <8 x i32> [[TMP128]], i32 [[TMP121]], i64 1
-; MAX-BW-NEXT: [[TMP130:%.*]] = insertelement <8 x i32> [[TMP129]], i32 [[TMP122]], i64 2
-; MAX-BW-NEXT: [[TMP131:%.*]] = insertelement <8 x i32> [[TMP130]], i32 [[TMP123]], i64 3
-; MAX-BW-NEXT: [[TMP132:%.*]] = insertelement <8 x i32> [[TMP131]], i32 [[TMP124]], i64 4
-; MAX-BW-NEXT: [[TMP133:%.*]] = insertelement <8 x i32> [[TMP132]], i32 [[TMP125]], i64 5
-; MAX-BW-NEXT: [[TMP134:%.*]] = insertelement <8 x i32> [[TMP133]], i32 [[TMP126]], i64 6
-; MAX-BW-NEXT: [[TMP135:%.*]] = insertelement <8 x i32> [[TMP134]], i32 [[TMP127]], i64 7
+; MAX-BW-NEXT: [[TMP128:%.*]] = insertelement <8 x i32> poison, i32 [[TMP120]], i32 0
+; MAX-BW-NEXT: [[TMP129:%.*]] = insertelement <8 x i32> [[TMP128]], i32 [[TMP121]], i32 1
+; MAX-BW-NEXT: [[TMP130:%.*]] = insertelement <8 x i32> [[TMP129]], i32 [[TMP122]], i32 2
+; MAX-BW-NEXT: [[TMP131:%.*]] = insertelement <8 x i32> [[TMP130]], i32 [[TMP123]], i32 3
+; MAX-BW-NEXT: [[TMP132:%.*]] = insertelement <8 x i32> [[TMP131]], i32 [[TMP124]], i32 4
+; MAX-BW-NEXT: [[TMP133:%.*]] = insertelement <8 x i32> [[TMP132]], i32 [[TMP125]], i32 5
+; MAX-BW-NEXT: [[TMP134:%.*]] = insertelement <8 x i32> [[TMP133]], i32 [[TMP126]], i32 6
+; MAX-BW-NEXT: [[TMP135:%.*]] = insertelement <8 x i32> [[TMP134]], i32 [[TMP127]], i32 7
; MAX-BW-NEXT: [[TMP136:%.*]] = mul nsw <8 x i32> [[TMP87]], [[WIDE_LOAD]]
; MAX-BW-NEXT: [[TMP137:%.*]] = mul nsw <8 x i32> [[TMP103]], [[WIDE_LOAD4]]
; MAX-BW-NEXT: [[TMP138:%.*]] = mul nsw <8 x i32> [[TMP119]], [[WIDE_LOAD5]]
@@ -415,7 +415,7 @@ define i32 @matrix_row_col(ptr nocapture readonly %data, i32 %i, i32 %j) #0 {
; MAX-BW: [[VEC_EPILOG_PH]]:
; MAX-BW-NEXT: [[VEC_EPILOG_RESUME_VAL:%.*]] = phi i64 [ 96, %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; MAX-BW-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP149]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
-; MAX-BW-NEXT: [[TMP171:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; MAX-BW-NEXT: [[TMP171:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; MAX-BW-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; MAX-BW: [[VEC_EPILOG_VECTOR_BODY]]:
; MAX-BW-NEXT: [[INDEX9:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT12:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
@@ -433,10 +433,10 @@ define i32 @matrix_row_col(ptr nocapture readonly %data, i32 %i, i32 %j) #0 {
; MAX-BW-NEXT: [[TMP159:%.*]] = load i32, ptr [[TMP155]], align 4
; MAX-BW-NEXT: [[TMP160:%.*]] = load i32, ptr [[TMP156]], align 4
; MAX-BW-NEXT: [[TMP161:%.*]] = load i32, ptr [[TMP157]], align 4
-; MAX-BW-NEXT: [[TMP162:%.*]] = insertelement <4 x i32> poison, i32 [[TMP158]], i64 0
-; MAX-BW-NEXT: [[TMP163:%.*]] = insertelement <4 x i32> [[TMP162]], i32 [[TMP159]], i64 1
-; MAX-BW-NEXT: [[TMP164:%.*]] = insertelement <4 x i32> [[TMP163]], i32 [[TMP160]], i64 2
-; MAX-BW-NEXT: [[TMP165:%.*]] = insertelement <4 x i32> [[TMP164]], i32 [[TMP161]], i64 3
+; MAX-BW-NEXT: [[TMP162:%.*]] = insertelement <4 x i32> poison, i32 [[TMP158]], i32 0
+; MAX-BW-NEXT: [[TMP163:%.*]] = insertelement <4 x i32> [[TMP162]], i32 [[TMP159]], i32 1
+; MAX-BW-NEXT: [[TMP164:%.*]] = insertelement <4 x i32> [[TMP163]], i32 [[TMP160]], i32 2
+; MAX-BW-NEXT: [[TMP165:%.*]] = insertelement <4 x i32> [[TMP164]], i32 [[TMP161]], i32 3
; MAX-BW-NEXT: [[TMP166:%.*]] = mul nsw <4 x i32> [[TMP165]], [[WIDE_LOAD11]]
; MAX-BW-NEXT: [[TMP167:%.*]] = add <4 x i32> [[VEC_PHI10]], splat (i32 4)
; MAX-BW-NEXT: [[TMP168]] = add <4 x i32> [[TMP167]], [[TMP166]]
diff --git a/llvm/test/Transforms/LoopVectorize/X86/vplan-single-bit-ind-var-width-4.ll b/llvm/test/Transforms/LoopVectorize/X86/vplan-single-bit-ind-var-width-4.ll
index b0fabd240b181..f9bdb5dbe72ca 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/vplan-single-bit-ind-var-width-4.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/vplan-single-bit-ind-var-width-4.ll
@@ -19,10 +19,10 @@ define void @copy_bitcast_fusion(ptr noalias %foo, ptr noalias %bar) {
; CHECK-NEXT: [[TMP10:%.*]] = load float, ptr [[TMP6]], align 4
; CHECK-NEXT: [[TMP11:%.*]] = load float, ptr [[TMP7]], align 4
; CHECK-NEXT: [[TMP12:%.*]] = load float, ptr [[TMP6]], align 4
-; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x float> poison, float [[TMP9]], i64 0
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x float> [[TMP13]], float [[TMP10]], i64 1
-; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x float> [[TMP14]], float [[TMP11]], i64 2
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x float> [[TMP15]], float [[TMP12]], i64 3
+; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x float> poison, float [[TMP9]], i32 0
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x float> [[TMP13]], float [[TMP10]], i32 1
+; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x float> [[TMP14]], float [[TMP11]], i32 2
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x float> [[TMP15]], float [[TMP12]], i32 3
; CHECK-NEXT: [[TMP17:%.*]] = shufflevector <4 x float> [[TMP16]], <4 x float> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
; CHECK-NEXT: [[TMP18:%.*]] = shufflevector <8 x float> [[TMP17]], <8 x float> zeroinitializer, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
; CHECK-NEXT: [[TMP19:%.*]] = shufflevector <16 x float> [[TMP18]], <16 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float undef, float undef, float undef, float undef, float undef, float undef, float undef, float undef>, <24 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23>
diff --git a/llvm/test/Transforms/LoopVectorize/X86/vplan-single-bit-ind-var.ll b/llvm/test/Transforms/LoopVectorize/X86/vplan-single-bit-ind-var.ll
index 233cdef27baa9..fdb5a50eca83e 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/vplan-single-bit-ind-var.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/vplan-single-bit-ind-var.ll
@@ -16,8 +16,8 @@ define void @copy_bitcast_fusion(ptr noalias %foo, ptr noalias %bar) {
; CHECK-NEXT: [[TMP3:%.*]] = getelementptr float, ptr [[FOO]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP4:%.*]] = load float, ptr [[FOO]], align 4
; CHECK-NEXT: [[TMP5:%.*]] = load float, ptr [[TMP3]], align 4
-; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x float> poison, float [[TMP4]], i64 0
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x float> [[TMP6]], float [[TMP5]], i64 1
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x float> poison, float [[TMP4]], i32 0
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x float> [[TMP6]], float [[TMP5]], i32 1
; CHECK-NEXT: store <2 x float> [[TMP7]], ptr [[BAR]], align 4
; CHECK-NEXT: br label %[[MIDDLE_BLOCK:.*]]
; CHECK: [[MIDDLE_BLOCK]]:
diff --git a/llvm/test/Transforms/LoopVectorize/X86/x86-interleaved-accesses-masked-group.ll b/llvm/test/Transforms/LoopVectorize/X86/x86-interleaved-accesses-masked-group.ll
index acbdf269934df..5d5862352abcc 100644
--- a/llvm/test/Transforms/LoopVectorize/X86/x86-interleaved-accesses-masked-group.ll
+++ b/llvm/test/Transforms/LoopVectorize/X86/x86-interleaved-accesses-masked-group.ll
@@ -949,14 +949,14 @@ define void @unconditional_strided1_optsize(ptr noalias nocapture readonly %p, p
; DISABLED_MASKED_STRIDED-NEXT: [[TMP22:%.*]] = load i8, ptr [[TMP14]], align 1
; DISABLED_MASKED_STRIDED-NEXT: [[TMP23:%.*]] = load i8, ptr [[TMP15]], align 1
; DISABLED_MASKED_STRIDED-NEXT: [[TMP24:%.*]] = load i8, ptr [[TMP16]], align 1
-; DISABLED_MASKED_STRIDED-NEXT: [[TMP25:%.*]] = insertelement <8 x i8> poison, i8 [[TMP17]], i64 0
-; DISABLED_MASKED_STRIDED-NEXT: [[TMP26:%.*]] = insertelement <8 x i8> [[TMP25]], i8 [[TMP18]], i64 1
-; DISABLED_MASKED_STRIDED-NEXT: [[TMP27:%.*]] = insertelement <8 x i8> [[TMP26]], i8 [[TMP19]], i64 2
-; DISABLED_MASKED_STRIDED-NEXT: [[TMP28:%.*]] = insertelement <8 x i8> [[TMP27]], i8 [[TMP20]], i64 3
-; DISABLED_MASKED_STRIDED-NEXT: [[TMP29:%.*]] = insertelement <8 x i8> [[TMP28]], i8 [[TMP21]], i64 4
-; DISABLED_MASKED_STRIDED-NEXT: [[TMP30:%.*]] = insertelement <8 x i8> [[TMP29]], i8 [[TMP22]], i64 5
-; DISABLED_MASKED_STRIDED-NEXT: [[TMP31:%.*]] = insertelement <8 x i8> [[TMP30]], i8 [[TMP23]], i64 6
-; DISABLED_MASKED_STRIDED-NEXT: [[TMP32:%.*]] = insertelement <8 x i8> [[TMP31]], i8 [[TMP24]], i64 7
+; DISABLED_MASKED_STRIDED-NEXT: [[TMP25:%.*]] = insertelement <8 x i8> poison, i8 [[TMP17]], i32 0
+; DISABLED_MASKED_STRIDED-NEXT: [[TMP26:%.*]] = insertelement <8 x i8> [[TMP25]], i8 [[TMP18]], i32 1
+; DISABLED_MASKED_STRIDED-NEXT: [[TMP27:%.*]] = insertelement <8 x i8> [[TMP26]], i8 [[TMP19]], i32 2
+; DISABLED_MASKED_STRIDED-NEXT: [[TMP28:%.*]] = insertelement <8 x i8> [[TMP27]], i8 [[TMP20]], i32 3
+; DISABLED_MASKED_STRIDED-NEXT: [[TMP29:%.*]] = insertelement <8 x i8> [[TMP28]], i8 [[TMP21]], i32 4
+; DISABLED_MASKED_STRIDED-NEXT: [[TMP30:%.*]] = insertelement <8 x i8> [[TMP29]], i8 [[TMP22]], i32 5
+; DISABLED_MASKED_STRIDED-NEXT: [[TMP31:%.*]] = insertelement <8 x i8> [[TMP30]], i8 [[TMP23]], i32 6
+; DISABLED_MASKED_STRIDED-NEXT: [[TMP32:%.*]] = insertelement <8 x i8> [[TMP31]], i8 [[TMP24]], i32 7
; DISABLED_MASKED_STRIDED-NEXT: [[TMP33:%.*]] = getelementptr inbounds i8, ptr [[Q]], i32 [[INDEX]]
; DISABLED_MASKED_STRIDED-NEXT: store <8 x i8> [[TMP32]], ptr [[TMP33]], align 1
; DISABLED_MASKED_STRIDED-NEXT: [[INDEX_NEXT]] = add nuw i32 [[INDEX]], 8
diff --git a/llvm/test/Transforms/LoopVectorize/bounded-load.ll b/llvm/test/Transforms/LoopVectorize/bounded-load.ll
index 8bd0a1debdbec..3a4860b3bcd01 100644
--- a/llvm/test/Transforms/LoopVectorize/bounded-load.ll
+++ b/llvm/test/Transforms/LoopVectorize/bounded-load.ll
@@ -64,10 +64,10 @@ define i32 @bounded_load_non_pow2_modulus(ptr %A) {
; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP4]], align 4
; CHECK-NEXT: [[TMP11:%.*]] = load i32, ptr [[TMP6]], align 4
; CHECK-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP8]], align 4
-; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x i32> poison, i32 [[TMP9]], i64 0
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> [[TMP13]], i32 [[TMP10]], i64 1
-; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i64 2
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> [[TMP15]], i32 [[TMP12]], i64 3
+; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x i32> poison, i32 [[TMP9]], i32 0
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> [[TMP13]], i32 [[TMP10]], i32 1
+; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i32 2
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> [[TMP15]], i32 [[TMP12]], i32 3
; CHECK-NEXT: [[TMP17]] = add <4 x i32> [[VEC_PHI]], [[TMP16]]
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i32 [[INDEX]], 4
; CHECK-NEXT: [[VEC_IND_NEXT]] = add nuw nsw <4 x i32> [[VEC_IND]], splat (i32 4)
@@ -203,10 +203,10 @@ define i32 @bounded_load_srem_maybe_negative(ptr %A, i32 %n) {
; CHECK-NEXT: [[TMP11:%.*]] = load i32, ptr [[TMP5]], align 4
; CHECK-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP7]], align 4
; CHECK-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP9]], align 4
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> poison, i32 [[TMP10]], i64 0
-; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i64 1
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> [[TMP15]], i32 [[TMP12]], i64 2
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i32> [[TMP16]], i32 [[TMP13]], i64 3
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> poison, i32 [[TMP10]], i32 0
+; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i32 1
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> [[TMP15]], i32 [[TMP12]], i32 2
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i32> [[TMP16]], i32 [[TMP13]], i32 3
; CHECK-NEXT: [[TMP18]] = add <4 x i32> [[VEC_PHI]], [[TMP17]]
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i32 [[INDEX]], 4
; CHECK-NEXT: [[VEC_IND_NEXT]] = add nuw nsw <4 x i32> [[VEC_IND]], splat (i32 4)
diff --git a/llvm/test/Transforms/LoopVectorize/bounded-store.ll b/llvm/test/Transforms/LoopVectorize/bounded-store.ll
index 8a0b465c9e54a..3160e5c1e731b 100644
--- a/llvm/test/Transforms/LoopVectorize/bounded-store.ll
+++ b/llvm/test/Transforms/LoopVectorize/bounded-store.ll
@@ -100,10 +100,10 @@ define void @bounded_load_with_store_optsize(ptr noalias %A, ptr noalias %B) opt
; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP6]], align 4
; CHECK-NEXT: [[TMP11:%.*]] = load i32, ptr [[TMP7]], align 4
; CHECK-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP8]], align 4
-; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x i32> poison, i32 [[TMP9]], i64 0
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> [[TMP13]], i32 [[TMP10]], i64 1
-; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i64 2
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> [[TMP15]], i32 [[TMP12]], i64 3
+; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x i32> poison, i32 [[TMP9]], i32 0
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> [[TMP13]], i32 [[TMP10]], i32 1
+; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i32 2
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> [[TMP15]], i32 [[TMP12]], i32 3
; CHECK-NEXT: [[TMP17:%.*]] = getelementptr inbounds i32, ptr [[B]], i32 [[INDEX]]
; CHECK-NEXT: store <4 x i32> [[TMP16]], ptr [[TMP17]], align 4
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i32 [[INDEX]], 4
diff --git a/llvm/test/Transforms/LoopVectorize/byte-type-function-variants.ll b/llvm/test/Transforms/LoopVectorize/byte-type-function-variants.ll
index 70c3ced3b349d..799b1d83310d8 100644
--- a/llvm/test/Transforms/LoopVectorize/byte-type-function-variants.ll
+++ b/llvm/test/Transforms/LoopVectorize/byte-type-function-variants.ll
@@ -80,8 +80,8 @@ define void @byte_type_uniform(ptr noalias %dst, ptr readonly %src, b64 %uniform
; CHECK-NEXT: [[TMP3:%.*]] = call b64 @bar(b64 [[TMP1]], b64 [[UNIFORM]]) #[[ATTR1:[0-9]+]]
; CHECK-NEXT: [[TMP2:%.*]] = extractelement <2 x b64> [[WIDE_LOAD]], i64 1
; CHECK-NEXT: [[TMP4:%.*]] = call b64 @bar(b64 [[TMP2]], b64 [[UNIFORM]]) #[[ATTR1]]
-; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x b64> poison, b64 [[TMP3]], i64 0
-; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x b64> [[TMP5]], b64 [[TMP4]], i64 1
+; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x b64> poison, b64 [[TMP3]], i32 0
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x b64> [[TMP5]], b64 [[TMP4]], i32 1
; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds b64, ptr [[DST]], i64 [[INDEX]]
; CHECK-NEXT: store <2 x b64> [[TMP6]], ptr [[TMP7]], align 4
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 2
@@ -149,8 +149,8 @@ define void @byte_type_linear(ptr noalias %dst, ptr readonly %src, i64 %n) {
; CHECK-NEXT: [[TMP12:%.*]] = extractelement <2 x b64> [[WIDE_LOAD]], i64 1
; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x b64> [[TMP3]], i64 1
; CHECK-NEXT: [[TMP7:%.*]] = call b64 @baz(b64 [[TMP12]], b64 [[TMP5]]) #[[ATTR2]]
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x b64> poison, b64 [[TMP6]], i64 0
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x b64> [[TMP8]], b64 [[TMP7]], i64 1
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x b64> poison, b64 [[TMP6]], i32 0
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x b64> [[TMP8]], b64 [[TMP7]], i32 1
; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds b64, ptr [[DST]], i64 [[INDEX]]
; CHECK-NEXT: store <2 x b64> [[TMP9]], ptr [[TMP10]], align 4
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 2
diff --git a/llvm/test/Transforms/LoopVectorize/consecutive-ptr-uniforms.ll b/llvm/test/Transforms/LoopVectorize/consecutive-ptr-uniforms.ll
index 50b72c49bf6bf..81e2ebba96109 100644
--- a/llvm/test/Transforms/LoopVectorize/consecutive-ptr-uniforms.ll
+++ b/llvm/test/Transforms/LoopVectorize/consecutive-ptr-uniforms.ll
@@ -256,18 +256,18 @@ define i32 @interleaved_access_forward(ptr %p, i64 %n) {
; CHECK-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP4]], align 8
; CHECK-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP5]], align 8
; CHECK-NEXT: [[TMP14:%.*]] = load i32, ptr [[TMP6]], align 8
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> poison, i32 [[TMP11]], i64 0
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i32> [[TMP16]], i32 [[TMP12]], i64 1
-; CHECK-NEXT: [[TMP23:%.*]] = insertelement <4 x i32> [[TMP17]], i32 [[TMP13]], i64 2
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i32> [[TMP23]], i32 [[TMP14]], i64 3
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> poison, i32 [[TMP11]], i32 0
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i32> [[TMP16]], i32 [[TMP12]], i32 1
+; CHECK-NEXT: [[TMP23:%.*]] = insertelement <4 x i32> [[TMP17]], i32 [[TMP13]], i32 2
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i32> [[TMP23]], i32 [[TMP14]], i32 3
; CHECK-NEXT: [[TMP19:%.*]] = load i32, ptr [[TMP7]], align 8
; CHECK-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP8]], align 8
; CHECK-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP9]], align 8
; CHECK-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP10]], align 8
-; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> poison, i32 [[TMP19]], i64 0
-; CHECK-NEXT: [[TMP25:%.*]] = insertelement <4 x i32> [[TMP24]], i32 [[TMP20]], i64 1
-; CHECK-NEXT: [[TMP31:%.*]] = insertelement <4 x i32> [[TMP25]], i32 [[TMP21]], i64 2
-; CHECK-NEXT: [[TMP26:%.*]] = insertelement <4 x i32> [[TMP31]], i32 [[TMP22]], i64 3
+; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> poison, i32 [[TMP19]], i32 0
+; CHECK-NEXT: [[TMP25:%.*]] = insertelement <4 x i32> [[TMP24]], i32 [[TMP20]], i32 1
+; CHECK-NEXT: [[TMP31:%.*]] = insertelement <4 x i32> [[TMP25]], i32 [[TMP21]], i32 2
+; CHECK-NEXT: [[TMP26:%.*]] = insertelement <4 x i32> [[TMP31]], i32 [[TMP22]], i32 3
; CHECK-NEXT: [[TMP27:%.*]] = add <4 x i32> [[TMP18]], [[TMP26]]
; CHECK-NEXT: [[TMP28]] = add <4 x i32> [[VEC_PHI]], [[TMP27]]
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX1]], 4
@@ -402,18 +402,18 @@ define i32 @interleaved_access_reverse(ptr %p, i64 %n) {
; CHECK-NEXT: [[TMP15:%.*]] = load i32, ptr [[TMP7]], align 8
; CHECK-NEXT: [[TMP16:%.*]] = load i32, ptr [[TMP8]], align 8
; CHECK-NEXT: [[TMP17:%.*]] = load i32, ptr [[TMP9]], align 8
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i32> poison, i32 [[TMP14]], i64 0
-; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x i32> [[TMP19]], i32 [[TMP15]], i64 1
-; CHECK-NEXT: [[TMP26:%.*]] = insertelement <4 x i32> [[TMP20]], i32 [[TMP16]], i64 2
-; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i32> [[TMP26]], i32 [[TMP17]], i64 3
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i32> poison, i32 [[TMP14]], i32 0
+; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x i32> [[TMP19]], i32 [[TMP15]], i32 1
+; CHECK-NEXT: [[TMP26:%.*]] = insertelement <4 x i32> [[TMP20]], i32 [[TMP16]], i32 2
+; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i32> [[TMP26]], i32 [[TMP17]], i32 3
; CHECK-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP10]], align 8
; CHECK-NEXT: [[TMP23:%.*]] = load i32, ptr [[TMP11]], align 8
; CHECK-NEXT: [[TMP24:%.*]] = load i32, ptr [[TMP12]], align 8
; CHECK-NEXT: [[TMP25:%.*]] = load i32, ptr [[TMP13]], align 8
-; CHECK-NEXT: [[TMP27:%.*]] = insertelement <4 x i32> poison, i32 [[TMP22]], i64 0
-; CHECK-NEXT: [[TMP28:%.*]] = insertelement <4 x i32> [[TMP27]], i32 [[TMP23]], i64 1
-; CHECK-NEXT: [[TMP34:%.*]] = insertelement <4 x i32> [[TMP28]], i32 [[TMP24]], i64 2
-; CHECK-NEXT: [[TMP29:%.*]] = insertelement <4 x i32> [[TMP34]], i32 [[TMP25]], i64 3
+; CHECK-NEXT: [[TMP27:%.*]] = insertelement <4 x i32> poison, i32 [[TMP22]], i32 0
+; CHECK-NEXT: [[TMP28:%.*]] = insertelement <4 x i32> [[TMP27]], i32 [[TMP23]], i32 1
+; CHECK-NEXT: [[TMP34:%.*]] = insertelement <4 x i32> [[TMP28]], i32 [[TMP24]], i32 2
+; CHECK-NEXT: [[TMP29:%.*]] = insertelement <4 x i32> [[TMP34]], i32 [[TMP25]], i32 3
; CHECK-NEXT: [[TMP30:%.*]] = add <4 x i32> [[TMP21]], [[TMP29]]
; CHECK-NEXT: [[TMP31]] = add <4 x i32> [[VEC_PHI]], [[TMP30]]
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -550,10 +550,10 @@ define void @predicated_store(ptr %p, i32 %x, i64 %n) {
; CHECK-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP2]], align 8
; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP4]], align 8
; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP6]], align 8
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> poison, i32 [[TMP7]], i64 0
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i32> [[TMP16]], i32 [[TMP8]], i64 1
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i32> [[TMP17]], i32 [[TMP9]], i64 2
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> [[TMP18]], i32 [[TMP10]], i64 3
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> poison, i32 [[TMP7]], i32 0
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i32> [[TMP16]], i32 [[TMP8]], i32 1
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i32> [[TMP17]], i32 [[TMP9]], i32 2
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> [[TMP18]], i32 [[TMP10]], i32 3
; CHECK-NEXT: [[TMP15:%.*]] = icmp eq <4 x i32> [[TMP14]], [[BROADCAST_SPLAT]]
; CHECK-NEXT: [[TMP21:%.*]] = extractelement <4 x i1> [[TMP15]], i64 0
; CHECK-NEXT: br i1 [[TMP21]], label %[[PRED_STORE_IF:.*]], label %[[PRED_STORE_CONTINUE:.*]]
@@ -944,10 +944,10 @@ define void @pointer_iv_non_uniform_0(ptr %a, i64 %n) {
; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[NEXT_GEP1]], align 8
; CHECK-NEXT: [[TMP7:%.*]] = load i32, ptr [[NEXT_GEP2]], align 8
; CHECK-NEXT: [[TMP8:%.*]] = load i32, ptr [[NEXT_GEP3]], align 8
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <4 x i32> poison, i32 [[TMP5]], i64 0
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <4 x i32> [[TMP10]], i32 [[TMP6]], i64 1
-; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i32> [[TMP11]], i32 [[TMP7]], i64 2
-; CHECK-NEXT: [[TMP12:%.*]] = insertelement <4 x i32> [[TMP21]], i32 [[TMP8]], i64 3
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <4 x i32> poison, i32 [[TMP5]], i32 0
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <4 x i32> [[TMP10]], i32 [[TMP6]], i32 1
+; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i32> [[TMP11]], i32 [[TMP7]], i32 2
+; CHECK-NEXT: [[TMP12:%.*]] = insertelement <4 x i32> [[TMP21]], i32 [[TMP8]], i32 3
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i32, ptr [[NEXT_GEP]], i32 1
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds i32, ptr [[NEXT_GEP1]], i32 1
; CHECK-NEXT: [[TMP15:%.*]] = getelementptr inbounds i32, ptr [[NEXT_GEP2]], i32 1
@@ -956,10 +956,10 @@ define void @pointer_iv_non_uniform_0(ptr %a, i64 %n) {
; CHECK-NEXT: [[TMP18:%.*]] = load i32, ptr [[TMP14]], align 8
; CHECK-NEXT: [[TMP19:%.*]] = load i32, ptr [[TMP15]], align 8
; CHECK-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP16]], align 8
-; CHECK-NEXT: [[TMP22:%.*]] = insertelement <4 x i32> poison, i32 [[TMP17]], i64 0
-; CHECK-NEXT: [[TMP23:%.*]] = insertelement <4 x i32> [[TMP22]], i32 [[TMP18]], i64 1
-; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i32> [[TMP23]], i32 [[TMP19]], i64 2
-; CHECK-NEXT: [[TMP40:%.*]] = insertelement <4 x i32> [[TMP37]], i32 [[TMP20]], i64 3
+; CHECK-NEXT: [[TMP22:%.*]] = insertelement <4 x i32> poison, i32 [[TMP17]], i32 0
+; CHECK-NEXT: [[TMP23:%.*]] = insertelement <4 x i32> [[TMP22]], i32 [[TMP18]], i32 1
+; CHECK-NEXT: [[TMP37:%.*]] = insertelement <4 x i32> [[TMP23]], i32 [[TMP19]], i32 2
+; CHECK-NEXT: [[TMP40:%.*]] = insertelement <4 x i32> [[TMP37]], i32 [[TMP20]], i32 3
; CHECK-NEXT: [[TMP41:%.*]] = getelementptr inbounds i32, ptr [[NEXT_GEP]], i32 4
; CHECK-NEXT: [[TMP42:%.*]] = getelementptr inbounds i32, ptr [[NEXT_GEP1]], i32 4
; CHECK-NEXT: [[TMP43:%.*]] = getelementptr inbounds i32, ptr [[NEXT_GEP2]], i32 4
@@ -968,10 +968,10 @@ define void @pointer_iv_non_uniform_0(ptr %a, i64 %n) {
; CHECK-NEXT: [[TMP46:%.*]] = load i32, ptr [[TMP42]], align 8
; CHECK-NEXT: [[TMP47:%.*]] = load i32, ptr [[TMP43]], align 8
; CHECK-NEXT: [[TMP56:%.*]] = load i32, ptr [[TMP44]], align 8
-; CHECK-NEXT: [[TMP34:%.*]] = insertelement <4 x i32> poison, i32 [[TMP45]], i64 0
-; CHECK-NEXT: [[TMP35:%.*]] = insertelement <4 x i32> [[TMP34]], i32 [[TMP46]], i64 1
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i32> [[TMP35]], i32 [[TMP47]], i64 2
-; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> [[TMP36]], i32 [[TMP56]], i64 3
+; CHECK-NEXT: [[TMP34:%.*]] = insertelement <4 x i32> poison, i32 [[TMP45]], i32 0
+; CHECK-NEXT: [[TMP35:%.*]] = insertelement <4 x i32> [[TMP34]], i32 [[TMP46]], i32 1
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <4 x i32> [[TMP35]], i32 [[TMP47]], i32 2
+; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> [[TMP36]], i32 [[TMP56]], i32 3
; CHECK-NEXT: [[TMP25:%.*]] = sub <4 x i32> [[TMP24]], [[TMP12]]
; CHECK-NEXT: [[TMP39:%.*]] = sub <4 x i32> [[TMP12]], [[TMP40]]
; CHECK-NEXT: [[TMP26:%.*]] = getelementptr inbounds i32, ptr [[NEXT_GEP]], i32 2
@@ -1466,18 +1466,18 @@ define void @pointer_operand_geps_with_different_indexed_types(ptr %A, ptr %B, i
; CHECK-NEXT: [[TMP15:%.*]] = load i8, ptr [[TMP11]], align 1, !alias.scope [[META27]]
; CHECK-NEXT: [[TMP16:%.*]] = load i8, ptr [[TMP12]], align 1, !alias.scope [[META27]]
; CHECK-NEXT: [[TMP17:%.*]] = load i8, ptr [[TMP13]], align 1, !alias.scope [[META27]]
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i8> poison, i8 [[TMP14]], i64 0
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i8> [[TMP18]], i8 [[TMP15]], i64 1
-; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i8> [[TMP19]], i8 [[TMP16]], i64 2
-; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x i8> [[TMP21]], i8 [[TMP17]], i64 3
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i8> poison, i8 [[TMP14]], i32 0
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i8> [[TMP18]], i8 [[TMP15]], i32 1
+; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i8> [[TMP19]], i8 [[TMP16]], i32 2
+; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x i8> [[TMP21]], i8 [[TMP17]], i32 3
; CHECK-NEXT: [[TMP22:%.*]] = load i8, ptr [[TMP2]], align 1, !alias.scope [[META27]]
; CHECK-NEXT: [[TMP23:%.*]] = load i8, ptr [[TMP7]], align 1, !alias.scope [[META27]]
; CHECK-NEXT: [[TMP24:%.*]] = load i8, ptr [[TMP8]], align 1, !alias.scope [[META27]]
; CHECK-NEXT: [[TMP25:%.*]] = load i8, ptr [[TMP9]], align 1, !alias.scope [[META27]]
-; CHECK-NEXT: [[TMP26:%.*]] = insertelement <4 x i8> poison, i8 [[TMP22]], i64 0
-; CHECK-NEXT: [[TMP27:%.*]] = insertelement <4 x i8> [[TMP26]], i8 [[TMP23]], i64 1
-; CHECK-NEXT: [[TMP32:%.*]] = insertelement <4 x i8> [[TMP27]], i8 [[TMP24]], i64 2
-; CHECK-NEXT: [[TMP28:%.*]] = insertelement <4 x i8> [[TMP32]], i8 [[TMP25]], i64 3
+; CHECK-NEXT: [[TMP26:%.*]] = insertelement <4 x i8> poison, i8 [[TMP22]], i32 0
+; CHECK-NEXT: [[TMP27:%.*]] = insertelement <4 x i8> [[TMP26]], i8 [[TMP23]], i32 1
+; CHECK-NEXT: [[TMP32:%.*]] = insertelement <4 x i8> [[TMP27]], i8 [[TMP24]], i32 2
+; CHECK-NEXT: [[TMP28:%.*]] = insertelement <4 x i8> [[TMP32]], i8 [[TMP25]], i32 3
; CHECK-NEXT: [[TMP29:%.*]] = xor <4 x i8> [[TMP20]], [[TMP28]]
; CHECK-NEXT: [[TMP30:%.*]] = getelementptr inbounds i8, ptr [[B]], i64 [[INDEX1]]
; CHECK-NEXT: store <4 x i8> [[TMP29]], ptr [[TMP30]], align 1, !alias.scope [[META30:![0-9]+]], !noalias [[META27]]
diff --git a/llvm/test/Transforms/LoopVectorize/cse-casts.ll b/llvm/test/Transforms/LoopVectorize/cse-casts.ll
index df97c0d129654..50eda068975a8 100644
--- a/llvm/test/Transforms/LoopVectorize/cse-casts.ll
+++ b/llvm/test/Transforms/LoopVectorize/cse-casts.ll
@@ -7,7 +7,7 @@ define i8 @preserve_flags_when_cloning_trunc(i8 %start, ptr noalias %src, ptr no
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: br label %[[VECTOR_PH:.*]]
; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x i8> splat (i8 1), i8 [[START]], i64 0
+; CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x i8> splat (i8 1), i8 [[START]], i32 0
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/dereferenceable-info-from-assumption-constant-size.ll b/llvm/test/Transforms/LoopVectorize/dereferenceable-info-from-assumption-constant-size.ll
index cb4ad16e56b11..a324b22de419f 100644
--- a/llvm/test/Transforms/LoopVectorize/dereferenceable-info-from-assumption-constant-size.ll
+++ b/llvm/test/Transforms/LoopVectorize/dereferenceable-info-from-assumption-constant-size.ll
@@ -91,8 +91,8 @@ define void @align_deref_assumption_in_header_constant_trip_count_loop_invariant
; CHECK-NEXT: [[TMP3:%.*]] = icmp sge <2 x i32> [[WIDE_LOAD]], zeroinitializer
; CHECK-NEXT: [[TMP4:%.*]] = load i32, ptr [[A]], align 4
; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[A]], align 4
-; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP4]], i64 0
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP5]], i64 1
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP4]], i32 0
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP5]], i32 1
; CHECK-NEXT: [[PREDPHI:%.*]] = select <2 x i1> [[TMP3]], <2 x i32> [[WIDE_LOAD]], <2 x i32> [[TMP7]]
; CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds i32, ptr [[C]], i64 [[TMP0]]
; CHECK-NEXT: store <2 x i32> [[PREDPHI]], ptr [[TMP8]], align 4
diff --git a/llvm/test/Transforms/LoopVectorize/epilog-iv-select-cmp.ll b/llvm/test/Transforms/LoopVectorize/epilog-iv-select-cmp.ll
index aacfbeaf74483..495220ad64d42 100644
--- a/llvm/test/Transforms/LoopVectorize/epilog-iv-select-cmp.ll
+++ b/llvm/test/Transforms/LoopVectorize/epilog-iv-select-cmp.ll
@@ -476,14 +476,14 @@ define i64 @select_argmin_iv_not_canonical(i64 %num, ptr %src) {
; CHECK-NEXT: [[TMP21:%.*]] = load i8, ptr [[TMP13]], align 1
; CHECK-NEXT: [[TMP22:%.*]] = load i8, ptr [[TMP14]], align 1
; CHECK-NEXT: [[TMP23:%.*]] = load i8, ptr [[TMP15]], align 1
-; CHECK-NEXT: [[TMP24:%.*]] = insertelement <8 x i8> poison, i8 [[TMP16]], i64 0
-; CHECK-NEXT: [[TMP25:%.*]] = insertelement <8 x i8> [[TMP24]], i8 [[TMP17]], i64 1
-; CHECK-NEXT: [[TMP26:%.*]] = insertelement <8 x i8> [[TMP25]], i8 [[TMP18]], i64 2
-; CHECK-NEXT: [[TMP27:%.*]] = insertelement <8 x i8> [[TMP26]], i8 [[TMP19]], i64 3
-; CHECK-NEXT: [[TMP28:%.*]] = insertelement <8 x i8> [[TMP27]], i8 [[TMP20]], i64 4
-; CHECK-NEXT: [[TMP29:%.*]] = insertelement <8 x i8> [[TMP28]], i8 [[TMP21]], i64 5
-; CHECK-NEXT: [[TMP30:%.*]] = insertelement <8 x i8> [[TMP29]], i8 [[TMP22]], i64 6
-; CHECK-NEXT: [[TMP31:%.*]] = insertelement <8 x i8> [[TMP30]], i8 [[TMP23]], i64 7
+; CHECK-NEXT: [[TMP24:%.*]] = insertelement <8 x i8> poison, i8 [[TMP16]], i32 0
+; CHECK-NEXT: [[TMP25:%.*]] = insertelement <8 x i8> [[TMP24]], i8 [[TMP17]], i32 1
+; CHECK-NEXT: [[TMP26:%.*]] = insertelement <8 x i8> [[TMP25]], i8 [[TMP18]], i32 2
+; CHECK-NEXT: [[TMP27:%.*]] = insertelement <8 x i8> [[TMP26]], i8 [[TMP19]], i32 3
+; CHECK-NEXT: [[TMP28:%.*]] = insertelement <8 x i8> [[TMP27]], i8 [[TMP20]], i32 4
+; CHECK-NEXT: [[TMP29:%.*]] = insertelement <8 x i8> [[TMP28]], i8 [[TMP21]], i32 5
+; CHECK-NEXT: [[TMP30:%.*]] = insertelement <8 x i8> [[TMP29]], i8 [[TMP22]], i32 6
+; CHECK-NEXT: [[TMP31:%.*]] = insertelement <8 x i8> [[TMP30]], i8 [[TMP23]], i32 7
; CHECK-NEXT: [[TMP32]] = call <8 x i8> @llvm.umin.v8i8(<8 x i8> [[TMP31]], <8 x i8> [[VEC_PHI1]])
; CHECK-NEXT: [[TMP33:%.*]] = icmp ult <8 x i8> [[TMP31]], [[VEC_PHI1]]
; CHECK-NEXT: [[TMP34]] = select <8 x i1> [[TMP33]], <8 x i64> [[VEC_IND]], <8 x i64> [[VEC_PHI]]
diff --git a/llvm/test/Transforms/LoopVectorize/epilog-vectorization-any-of-reductions.ll b/llvm/test/Transforms/LoopVectorize/epilog-vectorization-any-of-reductions.ll
index 8d237eb9386f9..5b9ead613e1a8 100644
--- a/llvm/test/Transforms/LoopVectorize/epilog-vectorization-any-of-reductions.ll
+++ b/llvm/test/Transforms/LoopVectorize/epilog-vectorization-any-of-reductions.ll
@@ -355,14 +355,14 @@ define i1 @any_of_reduction_i1_epilog2(ptr %start, ptr %end, i64 %x) {
; CHECK-NEXT: [[TMP52:%.*]] = load i64, ptr [[TMP19]], align 8
; CHECK-NEXT: [[TMP53:%.*]] = load i64, ptr [[TMP20]], align 8
; CHECK-NEXT: [[TMP54:%.*]] = load i64, ptr [[TMP21]], align 8
-; CHECK-NEXT: [[TMP55:%.*]] = insertelement <8 x i64> poison, i64 [[TMP12]], i64 0
-; CHECK-NEXT: [[TMP56:%.*]] = insertelement <8 x i64> [[TMP55]], i64 [[TMP13]], i64 1
-; CHECK-NEXT: [[TMP57:%.*]] = insertelement <8 x i64> [[TMP56]], i64 [[TMP14]], i64 2
-; CHECK-NEXT: [[TMP58:%.*]] = insertelement <8 x i64> [[TMP57]], i64 [[TMP15]], i64 3
-; CHECK-NEXT: [[TMP59:%.*]] = insertelement <8 x i64> [[TMP58]], i64 [[TMP26]], i64 4
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <8 x i64> [[TMP59]], i64 [[TMP52]], i64 5
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <8 x i64> [[TMP60]], i64 [[TMP53]], i64 6
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <8 x i64> [[TMP61]], i64 [[TMP54]], i64 7
+; CHECK-NEXT: [[TMP55:%.*]] = insertelement <8 x i64> poison, i64 [[TMP12]], i32 0
+; CHECK-NEXT: [[TMP56:%.*]] = insertelement <8 x i64> [[TMP55]], i64 [[TMP13]], i32 1
+; CHECK-NEXT: [[TMP57:%.*]] = insertelement <8 x i64> [[TMP56]], i64 [[TMP14]], i32 2
+; CHECK-NEXT: [[TMP58:%.*]] = insertelement <8 x i64> [[TMP57]], i64 [[TMP15]], i32 3
+; CHECK-NEXT: [[TMP59:%.*]] = insertelement <8 x i64> [[TMP58]], i64 [[TMP26]], i32 4
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <8 x i64> [[TMP59]], i64 [[TMP52]], i32 5
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <8 x i64> [[TMP60]], i64 [[TMP53]], i32 6
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <8 x i64> [[TMP61]], i64 [[TMP54]], i32 7
; CHECK-NEXT: [[TMP63:%.*]] = icmp ne <8 x i64> [[TMP62]], [[BROADCAST_SPLAT]]
; CHECK-NEXT: [[TMP42]] = or <8 x i1> [[VEC_PHI]], [[TMP63]]
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 8
@@ -409,10 +409,10 @@ define i1 @any_of_reduction_i1_epilog2(ptr %start, ptr %end, i64 %x) {
; CHECK-NEXT: [[TMP35:%.*]] = load i64, ptr [[TMP31]], align 8
; CHECK-NEXT: [[TMP36:%.*]] = load i64, ptr [[TMP32]], align 8
; CHECK-NEXT: [[TMP37:%.*]] = load i64, ptr [[TMP33]], align 8
-; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i64> poison, i64 [[TMP34]], i64 0
-; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i64> [[TMP38]], i64 [[TMP35]], i64 1
-; CHECK-NEXT: [[TMP40:%.*]] = insertelement <4 x i64> [[TMP39]], i64 [[TMP36]], i64 2
-; CHECK-NEXT: [[TMP41:%.*]] = insertelement <4 x i64> [[TMP40]], i64 [[TMP37]], i64 3
+; CHECK-NEXT: [[TMP38:%.*]] = insertelement <4 x i64> poison, i64 [[TMP34]], i32 0
+; CHECK-NEXT: [[TMP39:%.*]] = insertelement <4 x i64> [[TMP38]], i64 [[TMP35]], i32 1
+; CHECK-NEXT: [[TMP40:%.*]] = insertelement <4 x i64> [[TMP39]], i64 [[TMP36]], i32 2
+; CHECK-NEXT: [[TMP41:%.*]] = insertelement <4 x i64> [[TMP40]], i64 [[TMP37]], i32 3
; CHECK-NEXT: [[TMP46:%.*]] = icmp ne <4 x i64> [[TMP41]], [[BROADCAST_SPLAT19]]
; CHECK-NEXT: [[TMP43]] = or <4 x i1> [[VEC_PHI12]], [[TMP46]]
; CHECK-NEXT: [[INDEX_NEXT20]] = add nuw i64 [[INDEX11]], 4
diff --git a/llvm/test/Transforms/LoopVectorize/epilog-vectorization-reductions.ll b/llvm/test/Transforms/LoopVectorize/epilog-vectorization-reductions.ll
index 9abca8923dc18..8bf5681863b53 100644
--- a/llvm/test/Transforms/LoopVectorize/epilog-vectorization-reductions.ll
+++ b/llvm/test/Transforms/LoopVectorize/epilog-vectorization-reductions.ll
@@ -38,7 +38,7 @@ define i64 @int_reduction_add(ptr %a, i64 %N) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i64 [ [[TMP3]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 5, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF2:%.*]] = and i64 [[N]], 3
; CHECK-NEXT: [[N_VEC3:%.*]] = sub i64 [[N]], [[N_MOD_VF2]]
-; CHECK-NEXT: [[TMP6:%.*]] = insertelement <4 x i64> zeroinitializer, i64 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <4 x i64> zeroinitializer, i64 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX4:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT7:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
@@ -212,7 +212,7 @@ define i16 @reduction_or_trunc(ptr noalias nocapture %ptr) {
; CHECK: [[VEC_EPILOG_PH]]:
; CHECK-NEXT: [[VEC_EPILOG_RESUME_VAL:%.*]] = phi i32 [ 256, %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP11]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX1:%.*]] = phi i32 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT4:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
@@ -312,8 +312,8 @@ define float @multiple_fp_rdx(ptr %A, i64 %N) {
; CHECK-NEXT: [[BC_MERGE_RDX3:%.*]] = phi float [ [[TMP6]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 1.000000e+01, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF4:%.*]] = and i64 [[N]], 3
; CHECK-NEXT: [[N_VEC5:%.*]] = sub i64 [[N]], [[N_MOD_VF4]]
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <4 x float> splat (float 1.000000e+00), float [[BC_MERGE_RDX]], i64 0
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <4 x float> zeroinitializer, float [[BC_MERGE_RDX3]], i64 0
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <4 x float> splat (float 1.000000e+00), float [[BC_MERGE_RDX]], i32 0
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <4 x float> zeroinitializer, float [[BC_MERGE_RDX3]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX6:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT10:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
@@ -392,7 +392,7 @@ define i32 @reduction_phi_start_val(ptr %A, i64 %N) {
; CHECK: [[VECTOR_PH]]:
; CHECK-NEXT: [[N_MOD_VF:%.*]] = and i64 [[N]], 7
; CHECK-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
-; CHECK-NEXT: [[TMP0:%.*]] = insertelement <8 x i32> zeroinitializer, i32 [[START_SUM]], i64 0
+; CHECK-NEXT: [[TMP0:%.*]] = insertelement <8 x i32> zeroinitializer, i32 [[START_SUM]], i32 0
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -415,7 +415,7 @@ define i32 @reduction_phi_start_val(ptr %A, i64 %N) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP4]], %[[VEC_EPILOG_ITER_CHECK]] ], [ [[START_SUM]], %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF2:%.*]] = and i64 [[N]], 3
; CHECK-NEXT: [[N_VEC3:%.*]] = sub i64 [[N]], [[N_MOD_VF2]]
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX4:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT7:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
@@ -516,7 +516,7 @@ define i64 @test_reduction_with_widen_induction_order_1(ptr %A, i64 %N) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i64 [ [[TMP3]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF2:%.*]] = and i64 [[N]], 3
; CHECK-NEXT: [[N_VEC3:%.*]] = sub i64 [[N]], [[N_MOD_VF2]]
-; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x i64> zeroinitializer, i64 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x i64> zeroinitializer, i64 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i64> poison, i64 [[BC_RESUME_VAL]], i64 0
; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
; CHECK-NEXT: [[INDUCTION:%.*]] = add nuw nsw <4 x i64> [[BROADCAST_SPLAT]], <i64 0, i64 1, i64 2, i64 3>
@@ -611,7 +611,7 @@ define i64 @test_reduction_with_widen_induction_order_2(ptr %A, i64 %N) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i64 [ [[TMP3]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF2:%.*]] = and i64 [[N]], 3
; CHECK-NEXT: [[N_VEC3:%.*]] = sub i64 [[N]], [[N_MOD_VF2]]
-; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x i64> zeroinitializer, i64 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x i64> zeroinitializer, i64 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i64> poison, i64 [[BC_RESUME_VAL]], i64 0
; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
; CHECK-NEXT: [[INDUCTION:%.*]] = add nuw nsw <4 x i64> [[BROADCAST_SPLAT]], <i64 0, i64 1, i64 2, i64 3>
@@ -787,7 +787,7 @@ define i16 @test_no_op_or_reduction_single_vector_iteration(i64 %N) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i16 [ [[TMP0]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_PH]] ]
; CHECK-NEXT: [[N_MOD_VF2:%.*]] = and i64 [[CLAMPED]], 3
; CHECK-NEXT: [[N_VEC3:%.*]] = sub i64 [[CLAMPED]], [[N_MOD_VF2]]
-; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x i16> zeroinitializer, i16 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x i16> zeroinitializer, i16 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: br label %[[VEC_EPILOG_MIDDLE_BLOCK:.*]]
@@ -858,7 +858,7 @@ define i16 @test_or_reduction_with_induction_single_vector_iteration(i64 %N) {
; CHECK-NEXT: [[N_MOD_VF2:%.*]] = and i64 [[CLAMPED]], 3
; CHECK-NEXT: [[N_VEC3:%.*]] = sub i64 [[CLAMPED]], [[N_MOD_VF2]]
; CHECK-NEXT: [[TMP2:%.*]] = trunc i64 [[N_VEC3]] to i32
-; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x i16> zeroinitializer, i16 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x i16> zeroinitializer, i16 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: [[TMP4:%.*]] = trunc i32 [[BC_RESUME_VAL]] to i16
; CHECK-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i16> poison, i16 [[TMP4]], i64 0
; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i16> [[BROADCAST_SPLATINSERT]], <4 x i16> poison, <4 x i32> zeroinitializer
@@ -1039,7 +1039,7 @@ define i64 @reduction_with_ptr_iv_inttoptr_exit_cond(ptr %base, ptr %src) {
; CHECK: [[VEC_EPILOG_PH]]:
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i64 [ [[TMP26]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_SCEVCHECK]] ]
; CHECK-NEXT: [[TMP17:%.*]] = getelementptr i8, ptr [[START]], i64 96
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> zeroinitializer, i64 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> zeroinitializer, i64 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: [[TMP20:%.*]] = load i8, ptr [[SRC]], align 1
; CHECK-NEXT: [[BROADCAST_SPLATINSERT4:%.*]] = insertelement <4 x i8> poison, i8 [[TMP20]], i64 0
; CHECK-NEXT: [[BROADCAST_SPLAT5:%.*]] = shufflevector <4 x i8> [[BROADCAST_SPLATINSERT4]], <4 x i8> poison, <4 x i32> zeroinitializer
@@ -1125,7 +1125,7 @@ define i32 @test_foldable_reduction(i64 %N) {
; CHECK-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ [[TMP2]], %[[VEC_EPILOG_ITER_CHECK]] ], [ 0, %[[VECTOR_MAIN_LOOP_ITER_CHECK]] ]
; CHECK-NEXT: [[N_MOD_VF3:%.*]] = and i64 [[TMP0]], 3
; CHECK-NEXT: [[N_VEC4:%.*]] = sub i64 [[TMP0]], [[N_MOD_VF3]]
-; CHECK-NEXT: [[TMP5:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i64 0
+; CHECK-NEXT: [[TMP5:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[BC_MERGE_RDX]], i32 0
; CHECK-NEXT: br label %[[VEC_EPILOG_VECTOR_BODY:.*]]
; CHECK: [[VEC_EPILOG_VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX5:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], %[[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT7:%.*]], %[[VEC_EPILOG_VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/find-last-iv-interleave.ll b/llvm/test/Transforms/LoopVectorize/find-last-iv-interleave.ll
index 1e7635ecaed30..589c5dcd1a6b6 100644
--- a/llvm/test/Transforms/LoopVectorize/find-last-iv-interleave.ll
+++ b/llvm/test/Transforms/LoopVectorize/find-last-iv-interleave.ll
@@ -188,18 +188,18 @@ define i64 @findlast_iv_step2_interleave(ptr %a, i64 %n) {
; CHECK-NEXT: [[TMP21:%.*]] = load i64, ptr [[TMP13]], align 8
; CHECK-NEXT: [[TMP22:%.*]] = load i64, ptr [[TMP14]], align 8
; CHECK-NEXT: [[TMP23:%.*]] = load i64, ptr [[TMP15]], align 8
-; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i64> poison, i64 [[TMP20]], i64 0
-; CHECK-NEXT: [[TMP25:%.*]] = insertelement <4 x i64> [[TMP24]], i64 [[TMP21]], i64 1
-; CHECK-NEXT: [[TMP26:%.*]] = insertelement <4 x i64> [[TMP25]], i64 [[TMP22]], i64 2
-; CHECK-NEXT: [[TMP27:%.*]] = insertelement <4 x i64> [[TMP26]], i64 [[TMP23]], i64 3
+; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i64> poison, i64 [[TMP20]], i32 0
+; CHECK-NEXT: [[TMP25:%.*]] = insertelement <4 x i64> [[TMP24]], i64 [[TMP21]], i32 1
+; CHECK-NEXT: [[TMP26:%.*]] = insertelement <4 x i64> [[TMP25]], i64 [[TMP22]], i32 2
+; CHECK-NEXT: [[TMP27:%.*]] = insertelement <4 x i64> [[TMP26]], i64 [[TMP23]], i32 3
; CHECK-NEXT: [[TMP28:%.*]] = load i64, ptr [[TMP16]], align 8
; CHECK-NEXT: [[TMP29:%.*]] = load i64, ptr [[TMP17]], align 8
; CHECK-NEXT: [[TMP30:%.*]] = load i64, ptr [[TMP18]], align 8
; CHECK-NEXT: [[TMP31:%.*]] = load i64, ptr [[TMP19]], align 8
-; CHECK-NEXT: [[TMP32:%.*]] = insertelement <4 x i64> poison, i64 [[TMP28]], i64 0
-; CHECK-NEXT: [[TMP33:%.*]] = insertelement <4 x i64> [[TMP32]], i64 [[TMP29]], i64 1
-; CHECK-NEXT: [[TMP34:%.*]] = insertelement <4 x i64> [[TMP33]], i64 [[TMP30]], i64 2
-; CHECK-NEXT: [[TMP35:%.*]] = insertelement <4 x i64> [[TMP34]], i64 [[TMP31]], i64 3
+; CHECK-NEXT: [[TMP32:%.*]] = insertelement <4 x i64> poison, i64 [[TMP28]], i32 0
+; CHECK-NEXT: [[TMP33:%.*]] = insertelement <4 x i64> [[TMP32]], i64 [[TMP29]], i32 1
+; CHECK-NEXT: [[TMP34:%.*]] = insertelement <4 x i64> [[TMP33]], i64 [[TMP30]], i32 2
+; CHECK-NEXT: [[TMP35:%.*]] = insertelement <4 x i64> [[TMP34]], i64 [[TMP31]], i32 3
; CHECK-NEXT: [[TMP36:%.*]] = icmp eq <4 x i64> [[TMP27]], splat (i64 42)
; CHECK-NEXT: [[TMP37:%.*]] = icmp eq <4 x i64> [[TMP35]], splat (i64 42)
; CHECK-NEXT: [[TMP38]] = select <4 x i1> [[TMP36]], <4 x i64> [[VEC_IND]], <4 x i64> [[VEC_PHI]]
diff --git a/llvm/test/Transforms/LoopVectorize/find-last-iv-sinkable-expr.ll b/llvm/test/Transforms/LoopVectorize/find-last-iv-sinkable-expr.ll
index 9edf48e1373bf..1da94feb156ba 100644
--- a/llvm/test/Transforms/LoopVectorize/find-last-iv-sinkable-expr.ll
+++ b/llvm/test/Transforms/LoopVectorize/find-last-iv-sinkable-expr.ll
@@ -317,10 +317,10 @@ define i64 @findlast_non_canonical_iv_with_expr(ptr %a, i64 %n) {
; CHECK-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP11]], align 8
; CHECK-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP12]], align 8
; CHECK-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP13]], align 8
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> poison, i64 [[TMP14]], i64 0
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 1
-; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 2
-; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 3
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> poison, i64 [[TMP14]], i32 0
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 1
+; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 2
+; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 3
; CHECK-NEXT: [[TMP22:%.*]] = icmp eq <4 x i64> [[TMP21]], splat (i64 42)
; CHECK-NEXT: [[TMP23:%.*]] = add <4 x i64> [[VEC_IND]], splat (i64 100)
; CHECK-NEXT: [[TMP24]] = select <4 x i1> [[TMP22]], <4 x i64> [[TMP23]], <4 x i64> [[VEC_PHI]]
diff --git a/llvm/test/Transforms/LoopVectorize/find-last-iv-sinkable-load.ll b/llvm/test/Transforms/LoopVectorize/find-last-iv-sinkable-load.ll
index a689c6b1f075f..3be567a8391ec 100644
--- a/llvm/test/Transforms/LoopVectorize/find-last-iv-sinkable-load.ll
+++ b/llvm/test/Transforms/LoopVectorize/find-last-iv-sinkable-load.ll
@@ -318,10 +318,10 @@ define i64 @findlast_load_scaled_iv(ptr noalias %a, ptr noalias %b, i64 %n) {
; CHECK-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
; CHECK-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP10]], align 8
; CHECK-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP11]], align 8
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i64 0
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 1
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 2
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 3
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i32 0
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 1
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 2
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 3
; CHECK-NEXT: [[TMP20:%.*]] = freeze <4 x i1> [[TMP2]]
; CHECK-NEXT: [[TMP21:%.*]] = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> [[TMP20]])
; CHECK-NEXT: [[TMP22]] = select i1 [[TMP21]], <4 x i1> [[TMP2]], <4 x i1> [[TMP0]]
@@ -549,10 +549,10 @@ define i64 @findlast_load_data_dependent_idx(ptr noalias %a, ptr noalias %b, ptr
; CHECK-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
; CHECK-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP10]], align 8
; CHECK-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP11]], align 8
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i64 0
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 1
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 2
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 3
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i32 0
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 1
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 2
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 3
; CHECK-NEXT: [[TMP20:%.*]] = freeze <4 x i1> [[TMP2]]
; CHECK-NEXT: [[TMP21:%.*]] = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> [[TMP20]])
; CHECK-NEXT: [[TMP22]] = select i1 [[TMP21]], <4 x i1> [[TMP2]], <4 x i1> [[TMP0]]
diff --git a/llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains.ll b/llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains.ll
index cb3d7b5369251..486240adbdcf8 100644
--- a/llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains.ll
+++ b/llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains.ll
@@ -1147,225 +1147,3 @@ End:
%res.2 = fadd double %res.1, %for.3
ret double %res.2
}
-
-; %for.2's users are in blocks that don't dominate each other. Sinking the
-; stores is not possible and after sinking %or out of the header for %for.1
-; there is no user of %for.2 dominating all its other users, so there is no
-; valid hoist point for %or.
-define void @test_chained_first_order_recurrences_users_in_incomparable_blocks(ptr noalias %A, ptr noalias %B, ptr noalias %C, i64 %n) {
-; CHECK-LABEL: define void @test_chained_first_order_recurrences_users_in_incomparable_blocks(
-; CHECK-SAME: ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]], i64 [[N:%.*]]) {
-; CHECK-NEXT: [[ENTRY:.*]]:
-; CHECK-NEXT: br label %[[LOOP:.*]]
-; CHECK: [[LOOP]]:
-; CHECK-NEXT: [[IV:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[LOOP_LATCH:.*]] ]
-; CHECK-NEXT: [[FOR_1:%.*]] = phi i32 [ 0, %[[ENTRY]] ], [ [[PREV:%.*]], %[[LOOP_LATCH]] ]
-; CHECK-NEXT: [[FOR_2:%.*]] = phi i32 [ 0, %[[ENTRY]] ], [ [[OR:%.*]], %[[LOOP_LATCH]] ]
-; CHECK-NEXT: [[OR]] = or i32 [[FOR_1]], 3
-; CHECK-NEXT: [[T:%.*]] = trunc i64 [[IV]] to i32
-; CHECK-NEXT: [[GEP_C:%.*]] = getelementptr inbounds i32, ptr [[C]], i64 [[IV]]
-; CHECK-NEXT: [[C:%.*]] = load i32, ptr [[GEP_C]], align 4
-; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 0
-; CHECK-NEXT: br i1 [[CMP]], label %[[THEN:.*]], label %[[ELSE:.*]]
-; CHECK: [[THEN]]:
-; CHECK-NEXT: [[GEP_A:%.*]] = getelementptr inbounds i32, ptr [[A]], i64 [[IV]]
-; CHECK-NEXT: store i32 [[FOR_2]], ptr [[GEP_A]], align 4
-; CHECK-NEXT: br label %[[MERGE:.*]]
-; CHECK: [[ELSE]]:
-; CHECK-NEXT: [[GEP_B:%.*]] = getelementptr inbounds i32, ptr [[B]], i64 [[IV]]
-; CHECK-NEXT: store i32 [[FOR_2]], ptr [[GEP_B]], align 4
-; CHECK-NEXT: br label %[[MERGE]]
-; CHECK: [[MERGE]]:
-; CHECK-NEXT: [[PREV]] = mul i32 [[T]], [[T]]
-; CHECK-NEXT: br label %[[LOOP_LATCH]]
-; CHECK: [[LOOP_LATCH]]:
-; CHECK-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1
-; CHECK-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_NEXT]], [[N]]
-; CHECK-NEXT: br i1 [[EC]], label %[[EXIT:.*]], label %[[LOOP]]
-; CHECK: [[EXIT]]:
-; CHECK-NEXT: ret void
-;
-entry:
- br label %loop
-
-loop:
- %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ]
- %for.1 = phi i32 [ 0, %entry ], [ %prev, %loop.latch ]
- %for.2 = phi i32 [ 0, %entry ], [ %or, %loop.latch ]
- %or = or i32 %for.1, 3
- %t = trunc i64 %iv to i32
- %gep.c = getelementptr inbounds i32, ptr %C, i64 %iv
- %c = load i32, ptr %gep.c, align 4
- %cmp = icmp sgt i32 %c, 0
- br i1 %cmp, label %then, label %else
-
-then:
- %gep.a = getelementptr inbounds i32, ptr %A, i64 %iv
- store i32 %for.2, ptr %gep.a, align 4
- br label %merge
-
-else:
- %gep.b = getelementptr inbounds i32, ptr %B, i64 %iv
- store i32 %for.2, ptr %gep.b, align 4
- br label %merge
-
-merge:
- %prev = mul i32 %t, %t
- br label %loop.latch
-
-loop.latch:
- %iv.next = add i64 %iv, 1
- %ec = icmp eq i64 %iv.next, %n
- br i1 %ec, label %exit, label %loop
-
-exit:
- ret void
-}
-
-; Same as above, but %for.2 has a single user. After sinking %or out of the
-; header for %for.1, %or is in a block incomparable to the block of %for.2's
-; user, so hoisting %or would break dominance for %or's other users.
-define void @test_chained_first_order_recurrences_hoist_into_incomparable_block(ptr noalias %A, ptr noalias %B, ptr noalias %C, i64 %n) {
-; CHECK-LABEL: define void @test_chained_first_order_recurrences_hoist_into_incomparable_block(
-; CHECK-SAME: ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]], i64 [[N:%.*]]) {
-; CHECK-NEXT: [[ENTRY:.*]]:
-; CHECK-NEXT: br label %[[LOOP:.*]]
-; CHECK: [[LOOP]]:
-; CHECK-NEXT: [[IV:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[LOOP_LATCH:.*]] ]
-; CHECK-NEXT: [[FOR_1:%.*]] = phi i32 [ 0, %[[ENTRY]] ], [ [[PREV:%.*]], %[[LOOP_LATCH]] ]
-; CHECK-NEXT: [[FOR_2:%.*]] = phi i32 [ 0, %[[ENTRY]] ], [ [[OR:%.*]], %[[LOOP_LATCH]] ]
-; CHECK-NEXT: [[OR]] = or i32 [[FOR_1]], 3
-; CHECK-NEXT: [[T:%.*]] = trunc i64 [[IV]] to i32
-; CHECK-NEXT: [[GEP_C:%.*]] = getelementptr inbounds i32, ptr [[C]], i64 [[IV]]
-; CHECK-NEXT: [[C:%.*]] = load i32, ptr [[GEP_C]], align 4
-; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 0
-; CHECK-NEXT: br i1 [[CMP]], label %[[THEN:.*]], label %[[ELSE:.*]]
-; CHECK: [[THEN]]:
-; CHECK-NEXT: [[GEP_A:%.*]] = getelementptr inbounds i32, ptr [[A]], i64 [[IV]]
-; CHECK-NEXT: store i32 [[FOR_2]], ptr [[GEP_A]], align 4
-; CHECK-NEXT: br label %[[MERGE:.*]]
-; CHECK: [[ELSE]]:
-; CHECK-NEXT: [[GEP_B:%.*]] = getelementptr inbounds i32, ptr [[B]], i64 [[IV]]
-; CHECK-NEXT: store i32 42, ptr [[GEP_B]], align 4
-; CHECK-NEXT: br label %[[MERGE]]
-; CHECK: [[MERGE]]:
-; CHECK-NEXT: [[PREV]] = mul i32 [[T]], [[T]]
-; CHECK-NEXT: br label %[[LOOP_LATCH]]
-; CHECK: [[LOOP_LATCH]]:
-; CHECK-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1
-; CHECK-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_NEXT]], [[N]]
-; CHECK-NEXT: br i1 [[EC]], label %[[EXIT:.*]], label %[[LOOP]]
-; CHECK: [[EXIT]]:
-; CHECK-NEXT: ret void
-;
-entry:
- br label %loop
-
-loop:
- %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ]
- %for.1 = phi i32 [ 0, %entry ], [ %prev, %loop.latch ]
- %for.2 = phi i32 [ 0, %entry ], [ %or, %loop.latch ]
- %or = or i32 %for.1, 3
- %t = trunc i64 %iv to i32
- %gep.c = getelementptr inbounds i32, ptr %C, i64 %iv
- %c = load i32, ptr %gep.c, align 4
- %cmp = icmp sgt i32 %c, 0
- br i1 %cmp, label %then, label %else
-
-then:
- %gep.a = getelementptr inbounds i32, ptr %A, i64 %iv
- store i32 %for.2, ptr %gep.a, align 4
- br label %merge
-
-else:
- %gep.b = getelementptr inbounds i32, ptr %B, i64 %iv
- store i32 42, ptr %gep.b, align 4
- br label %merge
-
-merge:
- %prev = mul i32 %t, %t
- br label %loop.latch
-
-loop.latch:
- %iv.next = add i64 %iv, 1
- %ec = icmp eq i64 %iv.next, %n
- br i1 %ec, label %exit, label %loop
-
-exit:
- ret void
-}
-
-; %for.2 is used by the %for.3 phi and by the store in %then. The %for.3 phi
-; dominates the store, so it is selected as hoist point, but hoisting recipes
-; before it would place them before the header phis.
-define void @test_chained_first_order_recurrences_hoist_point_is_phi(ptr noalias %A, ptr noalias %B, ptr noalias %C, i64 %n) {
-; CHECK-LABEL: define void @test_chained_first_order_recurrences_hoist_point_is_phi(
-; CHECK-SAME: ptr noalias [[A:%.*]], ptr noalias [[B:%.*]], ptr noalias [[C:%.*]], i64 [[N:%.*]]) {
-; CHECK-NEXT: [[ENTRY:.*]]:
-; CHECK-NEXT: br label %[[LOOP:.*]]
-; CHECK: [[LOOP]]:
-; CHECK-NEXT: [[IV:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[LOOP_LATCH:.*]] ]
-; CHECK-NEXT: [[FOR_1:%.*]] = phi i32 [ 0, %[[ENTRY]] ], [ [[PREV:%.*]], %[[LOOP_LATCH]] ]
-; CHECK-NEXT: [[FOR_2:%.*]] = phi i32 [ 0, %[[ENTRY]] ], [ [[OR:%.*]], %[[LOOP_LATCH]] ]
-; CHECK-NEXT: [[FOR_3:%.*]] = phi i32 [ 0, %[[ENTRY]] ], [ [[FOR_2]], %[[LOOP_LATCH]] ]
-; CHECK-NEXT: [[OR]] = or i32 [[FOR_1]], 3
-; CHECK-NEXT: [[T:%.*]] = trunc i64 [[IV]] to i32
-; CHECK-NEXT: [[GEP_C:%.*]] = getelementptr inbounds i32, ptr [[C]], i64 [[IV]]
-; CHECK-NEXT: [[C:%.*]] = load i32, ptr [[GEP_C]], align 4
-; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[C]], 0
-; CHECK-NEXT: br i1 [[CMP]], label %[[THEN:.*]], label %[[ELSE:.*]]
-; CHECK: [[THEN]]:
-; CHECK-NEXT: [[GEP_A:%.*]] = getelementptr inbounds i32, ptr [[A]], i64 [[IV]]
-; CHECK-NEXT: store i32 [[FOR_2]], ptr [[GEP_A]], align 4
-; CHECK-NEXT: br label %[[MERGE:.*]]
-; CHECK: [[ELSE]]:
-; CHECK-NEXT: [[GEP_B:%.*]] = getelementptr inbounds i32, ptr [[B]], i64 [[IV]]
-; CHECK-NEXT: store i32 [[FOR_3]], ptr [[GEP_B]], align 4
-; CHECK-NEXT: br label %[[MERGE]]
-; CHECK: [[MERGE]]:
-; CHECK-NEXT: [[PREV]] = mul i32 [[T]], [[T]]
-; CHECK-NEXT: br label %[[LOOP_LATCH]]
-; CHECK: [[LOOP_LATCH]]:
-; CHECK-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1
-; CHECK-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_NEXT]], [[N]]
-; CHECK-NEXT: br i1 [[EC]], label %[[EXIT:.*]], label %[[LOOP]]
-; CHECK: [[EXIT]]:
-; CHECK-NEXT: ret void
-;
-entry:
- br label %loop
-
-loop:
- %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ]
- %for.1 = phi i32 [ 0, %entry ], [ %prev, %loop.latch ]
- %for.2 = phi i32 [ 0, %entry ], [ %or, %loop.latch ]
- %for.3 = phi i32 [ 0, %entry ], [ %for.2, %loop.latch ]
- %or = or i32 %for.1, 3
- %t = trunc i64 %iv to i32
- %gep.c = getelementptr inbounds i32, ptr %C, i64 %iv
- %c = load i32, ptr %gep.c, align 4
- %cmp = icmp sgt i32 %c, 0
- br i1 %cmp, label %then, label %else
-
-then:
- %gep.a = getelementptr inbounds i32, ptr %A, i64 %iv
- store i32 %for.2, ptr %gep.a, align 4
- br label %merge
-
-else:
- %gep.b = getelementptr inbounds i32, ptr %B, i64 %iv
- store i32 %for.3, ptr %gep.b, align 4
- br label %merge
-
-merge:
- %prev = mul i32 %t, %t
- br label %loop.latch
-
-loop.latch:
- %iv.next = add i64 %iv, 1
- %ec = icmp eq i64 %iv.next, %n
- br i1 %ec, label %exit, label %loop
-
-exit:
- ret void
-}
diff --git a/llvm/test/Transforms/LoopVectorize/first-order-recurrence.ll b/llvm/test/Transforms/LoopVectorize/first-order-recurrence.ll
index d7de070feb66e..3e314f06829d0 100644
--- a/llvm/test/Transforms/LoopVectorize/first-order-recurrence.ll
+++ b/llvm/test/Transforms/LoopVectorize/first-order-recurrence.ll
@@ -1447,18 +1447,18 @@ define i32 @PR33613(ptr %b, double %j, i32 %d, i32 %n) {
; UNROLL-NO-IC-NEXT: [[TMP17:%.*]] = load double, ptr [[TMP9]], align 8
; UNROLL-NO-IC-NEXT: [[TMP18:%.*]] = load double, ptr [[TMP10]], align 8
; UNROLL-NO-IC-NEXT: [[TMP19:%.*]] = load double, ptr [[TMP11]], align 8
-; UNROLL-NO-IC-NEXT: [[TMP20:%.*]] = insertelement <4 x double> poison, double [[TMP16]], i64 0
-; UNROLL-NO-IC-NEXT: [[TMP21:%.*]] = insertelement <4 x double> [[TMP20]], double [[TMP17]], i64 1
-; UNROLL-NO-IC-NEXT: [[TMP22:%.*]] = insertelement <4 x double> [[TMP21]], double [[TMP18]], i64 2
-; UNROLL-NO-IC-NEXT: [[TMP23:%.*]] = insertelement <4 x double> [[TMP22]], double [[TMP19]], i64 3
+; UNROLL-NO-IC-NEXT: [[TMP20:%.*]] = insertelement <4 x double> poison, double [[TMP16]], i32 0
+; UNROLL-NO-IC-NEXT: [[TMP21:%.*]] = insertelement <4 x double> [[TMP20]], double [[TMP17]], i32 1
+; UNROLL-NO-IC-NEXT: [[TMP22:%.*]] = insertelement <4 x double> [[TMP21]], double [[TMP18]], i32 2
+; UNROLL-NO-IC-NEXT: [[TMP23:%.*]] = insertelement <4 x double> [[TMP22]], double [[TMP19]], i32 3
; UNROLL-NO-IC-NEXT: [[TMP24:%.*]] = load double, ptr [[TMP12]], align 8
; UNROLL-NO-IC-NEXT: [[TMP25:%.*]] = load double, ptr [[TMP13]], align 8
; UNROLL-NO-IC-NEXT: [[TMP26:%.*]] = load double, ptr [[TMP14]], align 8
; UNROLL-NO-IC-NEXT: [[TMP27:%.*]] = load double, ptr [[TMP15]], align 8
-; UNROLL-NO-IC-NEXT: [[TMP28:%.*]] = insertelement <4 x double> poison, double [[TMP24]], i64 0
-; UNROLL-NO-IC-NEXT: [[TMP29:%.*]] = insertelement <4 x double> [[TMP28]], double [[TMP25]], i64 1
-; UNROLL-NO-IC-NEXT: [[TMP30:%.*]] = insertelement <4 x double> [[TMP29]], double [[TMP26]], i64 2
-; UNROLL-NO-IC-NEXT: [[TMP31]] = insertelement <4 x double> [[TMP30]], double [[TMP27]], i64 3
+; UNROLL-NO-IC-NEXT: [[TMP28:%.*]] = insertelement <4 x double> poison, double [[TMP24]], i32 0
+; UNROLL-NO-IC-NEXT: [[TMP29:%.*]] = insertelement <4 x double> [[TMP28]], double [[TMP25]], i32 1
+; UNROLL-NO-IC-NEXT: [[TMP30:%.*]] = insertelement <4 x double> [[TMP29]], double [[TMP26]], i32 2
+; UNROLL-NO-IC-NEXT: [[TMP31]] = insertelement <4 x double> [[TMP30]], double [[TMP27]], i32 3
; UNROLL-NO-IC-NEXT: [[TMP32:%.*]] = shufflevector <4 x double> [[VECTOR_RECUR]], <4 x double> [[TMP23]], <4 x i32> <i32 3, i32 4, i32 5, i32 6>
; UNROLL-NO-IC-NEXT: [[TMP33:%.*]] = shufflevector <4 x double> [[TMP23]], <4 x double> [[TMP31]], <4 x i32> <i32 3, i32 4, i32 5, i32 6>
; UNROLL-NO-IC-NEXT: [[TMP34:%.*]] = fmul <4 x double> [[TMP32]], [[TMP23]]
@@ -1608,10 +1608,10 @@ define i32 @PR33613(ptr %b, double %j, i32 %d, i32 %n) {
; SINK-AFTER-NEXT: [[TMP9:%.*]] = load double, ptr [[TMP5]], align 8
; SINK-AFTER-NEXT: [[TMP10:%.*]] = load double, ptr [[TMP6]], align 8
; SINK-AFTER-NEXT: [[TMP11:%.*]] = load double, ptr [[TMP7]], align 8
-; SINK-AFTER-NEXT: [[TMP12:%.*]] = insertelement <4 x double> poison, double [[TMP8]], i64 0
-; SINK-AFTER-NEXT: [[TMP13:%.*]] = insertelement <4 x double> [[TMP12]], double [[TMP9]], i64 1
-; SINK-AFTER-NEXT: [[TMP14:%.*]] = insertelement <4 x double> [[TMP13]], double [[TMP10]], i64 2
-; SINK-AFTER-NEXT: [[TMP15]] = insertelement <4 x double> [[TMP14]], double [[TMP11]], i64 3
+; SINK-AFTER-NEXT: [[TMP12:%.*]] = insertelement <4 x double> poison, double [[TMP8]], i32 0
+; SINK-AFTER-NEXT: [[TMP13:%.*]] = insertelement <4 x double> [[TMP12]], double [[TMP9]], i32 1
+; SINK-AFTER-NEXT: [[TMP14:%.*]] = insertelement <4 x double> [[TMP13]], double [[TMP10]], i32 2
+; SINK-AFTER-NEXT: [[TMP15]] = insertelement <4 x double> [[TMP14]], double [[TMP11]], i32 3
; SINK-AFTER-NEXT: [[TMP16:%.*]] = shufflevector <4 x double> [[VECTOR_RECUR]], <4 x double> [[TMP15]], <4 x i32> <i32 3, i32 4, i32 5, i32 6>
; SINK-AFTER-NEXT: [[TMP17:%.*]] = fmul <4 x double> [[TMP16]], [[TMP15]]
; SINK-AFTER-NEXT: [[TMP18:%.*]] = fcmp une <4 x double> [[TMP17]], zeroinitializer
@@ -1922,18 +1922,18 @@ define void @PR34711(ptr noalias %a, ptr noalias %b, ptr noalias %c, i64 %n) {
; UNROLL-NO-IC-NEXT: [[TMP20:%.*]] = load i16, ptr [[TMP10]], align 2
; UNROLL-NO-IC-NEXT: [[TMP21:%.*]] = load i16, ptr [[TMP11]], align 2
; UNROLL-NO-IC-NEXT: [[TMP22:%.*]] = load i16, ptr [[TMP12]], align 2
-; UNROLL-NO-IC-NEXT: [[TMP23:%.*]] = insertelement <4 x i16> poison, i16 [[TMP19]], i64 0
-; UNROLL-NO-IC-NEXT: [[TMP24:%.*]] = insertelement <4 x i16> [[TMP23]], i16 [[TMP20]], i64 1
-; UNROLL-NO-IC-NEXT: [[TMP25:%.*]] = insertelement <4 x i16> [[TMP24]], i16 [[TMP21]], i64 2
-; UNROLL-NO-IC-NEXT: [[TMP26:%.*]] = insertelement <4 x i16> [[TMP25]], i16 [[TMP22]], i64 3
+; UNROLL-NO-IC-NEXT: [[TMP23:%.*]] = insertelement <4 x i16> poison, i16 [[TMP19]], i32 0
+; UNROLL-NO-IC-NEXT: [[TMP24:%.*]] = insertelement <4 x i16> [[TMP23]], i16 [[TMP20]], i32 1
+; UNROLL-NO-IC-NEXT: [[TMP25:%.*]] = insertelement <4 x i16> [[TMP24]], i16 [[TMP21]], i32 2
+; UNROLL-NO-IC-NEXT: [[TMP26:%.*]] = insertelement <4 x i16> [[TMP25]], i16 [[TMP22]], i32 3
; UNROLL-NO-IC-NEXT: [[TMP27:%.*]] = load i16, ptr [[TMP13]], align 2
; UNROLL-NO-IC-NEXT: [[TMP28:%.*]] = load i16, ptr [[TMP14]], align 2
; UNROLL-NO-IC-NEXT: [[TMP29:%.*]] = load i16, ptr [[TMP15]], align 2
; UNROLL-NO-IC-NEXT: [[TMP30:%.*]] = load i16, ptr [[TMP16]], align 2
-; UNROLL-NO-IC-NEXT: [[TMP31:%.*]] = insertelement <4 x i16> poison, i16 [[TMP27]], i64 0
-; UNROLL-NO-IC-NEXT: [[TMP32:%.*]] = insertelement <4 x i16> [[TMP31]], i16 [[TMP28]], i64 1
-; UNROLL-NO-IC-NEXT: [[TMP33:%.*]] = insertelement <4 x i16> [[TMP32]], i16 [[TMP29]], i64 2
-; UNROLL-NO-IC-NEXT: [[TMP34]] = insertelement <4 x i16> [[TMP33]], i16 [[TMP30]], i64 3
+; UNROLL-NO-IC-NEXT: [[TMP31:%.*]] = insertelement <4 x i16> poison, i16 [[TMP27]], i32 0
+; UNROLL-NO-IC-NEXT: [[TMP32:%.*]] = insertelement <4 x i16> [[TMP31]], i16 [[TMP28]], i32 1
+; UNROLL-NO-IC-NEXT: [[TMP33:%.*]] = insertelement <4 x i16> [[TMP32]], i16 [[TMP29]], i32 2
+; UNROLL-NO-IC-NEXT: [[TMP34]] = insertelement <4 x i16> [[TMP33]], i16 [[TMP30]], i32 3
; UNROLL-NO-IC-NEXT: [[TMP35:%.*]] = shufflevector <4 x i16> [[VECTOR_RECUR]], <4 x i16> [[TMP26]], <4 x i32> <i32 3, i32 4, i32 5, i32 6>
; UNROLL-NO-IC-NEXT: [[TMP36:%.*]] = shufflevector <4 x i16> [[TMP26]], <4 x i16> [[TMP34]], <4 x i32> <i32 3, i32 4, i32 5, i32 6>
; UNROLL-NO-IC-NEXT: [[TMP37:%.*]] = sext <4 x i16> [[TMP35]] to <4 x i32>
@@ -2061,10 +2061,10 @@ define void @PR34711(ptr noalias %a, ptr noalias %b, ptr noalias %c, i64 %n) {
; SINK-AFTER-NEXT: [[TMP11:%.*]] = load i16, ptr [[TMP6]], align 2
; SINK-AFTER-NEXT: [[TMP12:%.*]] = load i16, ptr [[TMP7]], align 2
; SINK-AFTER-NEXT: [[TMP13:%.*]] = load i16, ptr [[TMP8]], align 2
-; SINK-AFTER-NEXT: [[TMP14:%.*]] = insertelement <4 x i16> poison, i16 [[TMP10]], i64 0
-; SINK-AFTER-NEXT: [[TMP15:%.*]] = insertelement <4 x i16> [[TMP14]], i16 [[TMP11]], i64 1
-; SINK-AFTER-NEXT: [[TMP16:%.*]] = insertelement <4 x i16> [[TMP15]], i16 [[TMP12]], i64 2
-; SINK-AFTER-NEXT: [[TMP17]] = insertelement <4 x i16> [[TMP16]], i16 [[TMP13]], i64 3
+; SINK-AFTER-NEXT: [[TMP14:%.*]] = insertelement <4 x i16> poison, i16 [[TMP10]], i32 0
+; SINK-AFTER-NEXT: [[TMP15:%.*]] = insertelement <4 x i16> [[TMP14]], i16 [[TMP11]], i32 1
+; SINK-AFTER-NEXT: [[TMP16:%.*]] = insertelement <4 x i16> [[TMP15]], i16 [[TMP12]], i32 2
+; SINK-AFTER-NEXT: [[TMP17]] = insertelement <4 x i16> [[TMP16]], i16 [[TMP13]], i32 3
; SINK-AFTER-NEXT: [[TMP18:%.*]] = shufflevector <4 x i16> [[VECTOR_RECUR]], <4 x i16> [[TMP17]], <4 x i32> <i32 3, i32 4, i32 5, i32 6>
; SINK-AFTER-NEXT: [[TMP19:%.*]] = sext <4 x i16> [[TMP18]] to <4 x i32>
; SINK-AFTER-NEXT: [[TMP20:%.*]] = sext <4 x i16> [[TMP17]] to <4 x i32>
diff --git a/llvm/test/Transforms/LoopVectorize/forked-pointers.ll b/llvm/test/Transforms/LoopVectorize/forked-pointers.ll
index c21046986e1ec..ea2fd95c79611 100644
--- a/llvm/test/Transforms/LoopVectorize/forked-pointers.ll
+++ b/llvm/test/Transforms/LoopVectorize/forked-pointers.ll
@@ -64,10 +64,10 @@ define void @forked_ptrs_different_base_same_offset(ptr nocapture readonly %Base
; CHECK-NEXT: [[TMP18:%.*]] = load float, ptr [[TMP12]], align 4
; CHECK-NEXT: [[TMP19:%.*]] = load float, ptr [[TMP14]], align 4
; CHECK-NEXT: [[TMP20:%.*]] = load float, ptr [[TMP16]], align 4
-; CHECK-NEXT: [[TMP29:%.*]] = insertelement <4 x float> poison, float [[TMP17]], i64 0
-; CHECK-NEXT: [[TMP30:%.*]] = insertelement <4 x float> [[TMP29]], float [[TMP18]], i64 1
-; CHECK-NEXT: [[TMP31:%.*]] = insertelement <4 x float> [[TMP30]], float [[TMP19]], i64 2
-; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x float> [[TMP31]], float [[TMP20]], i64 3
+; CHECK-NEXT: [[TMP29:%.*]] = insertelement <4 x float> poison, float [[TMP17]], i32 0
+; CHECK-NEXT: [[TMP30:%.*]] = insertelement <4 x float> [[TMP29]], float [[TMP18]], i32 1
+; CHECK-NEXT: [[TMP31:%.*]] = insertelement <4 x float> [[TMP30]], float [[TMP19]], i32 2
+; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x float> [[TMP31]], float [[TMP20]], i32 3
; CHECK-NEXT: [[TMP25:%.*]] = getelementptr inbounds float, ptr [[BASE1]], i64 [[INDEX]]
; CHECK-NEXT: store <4 x float> [[TMP24]], ptr [[TMP25]], align 4
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
diff --git a/llvm/test/Transforms/LoopVectorize/gather-scatter.ll b/llvm/test/Transforms/LoopVectorize/gather-scatter.ll
index 99eadd3865bcf..2293dc69043c2 100644
--- a/llvm/test/Transforms/LoopVectorize/gather-scatter.ll
+++ b/llvm/test/Transforms/LoopVectorize/gather-scatter.ll
@@ -52,10 +52,10 @@ define void @gather_i32(ptr noalias %src, ptr noalias %offsets.addr, ptr noalias
; GATHER-SCATTER-DISABLED-NEXT: [[TMP10:%.*]] = load float, ptr [[TMP6]], align 4
; GATHER-SCATTER-DISABLED-NEXT: [[TMP11:%.*]] = load float, ptr [[TMP7]], align 4
; GATHER-SCATTER-DISABLED-NEXT: [[TMP12:%.*]] = load float, ptr [[TMP8]], align 4
-; GATHER-SCATTER-DISABLED-NEXT: [[TMP13:%.*]] = insertelement <4 x float> poison, float [[TMP9]], i64 0
-; GATHER-SCATTER-DISABLED-NEXT: [[TMP14:%.*]] = insertelement <4 x float> [[TMP13]], float [[TMP10]], i64 1
-; GATHER-SCATTER-DISABLED-NEXT: [[TMP15:%.*]] = insertelement <4 x float> [[TMP14]], float [[TMP11]], i64 2
-; GATHER-SCATTER-DISABLED-NEXT: [[TMP16:%.*]] = insertelement <4 x float> [[TMP15]], float [[TMP12]], i64 3
+; GATHER-SCATTER-DISABLED-NEXT: [[TMP13:%.*]] = insertelement <4 x float> poison, float [[TMP9]], i32 0
+; GATHER-SCATTER-DISABLED-NEXT: [[TMP14:%.*]] = insertelement <4 x float> [[TMP13]], float [[TMP10]], i32 1
+; GATHER-SCATTER-DISABLED-NEXT: [[TMP15:%.*]] = insertelement <4 x float> [[TMP14]], float [[TMP11]], i32 2
+; GATHER-SCATTER-DISABLED-NEXT: [[TMP16:%.*]] = insertelement <4 x float> [[TMP15]], float [[TMP12]], i32 3
; GATHER-SCATTER-DISABLED-NEXT: [[TMP17:%.*]] = getelementptr inbounds float, ptr [[DST]], i64 [[INDEX]]
; GATHER-SCATTER-DISABLED-NEXT: store <4 x float> [[TMP16]], ptr [[TMP17]], align 4
; GATHER-SCATTER-DISABLED-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
diff --git a/llvm/test/Transforms/LoopVectorize/histograms.ll b/llvm/test/Transforms/LoopVectorize/histograms.ll
index 895ff9e9c3b20..78e315e015856 100644
--- a/llvm/test/Transforms/LoopVectorize/histograms.ll
+++ b/llvm/test/Transforms/LoopVectorize/histograms.ll
@@ -17,8 +17,8 @@ define void @simple_histogram(ptr noalias %buckets, ptr readonly %indices) {
; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds i32, ptr [[BUCKETS]], i64 [[TMP2]]
; CHECK-NEXT: [[TMP4:%.*]] = extractelement <2 x i64> [[TMP1]], i64 1
; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds i32, ptr [[BUCKETS]], i64 [[TMP4]]
-; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x ptr> poison, ptr [[TMP3]], i64 0
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x ptr> [[TMP6]], ptr [[TMP5]], i64 1
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x ptr> poison, ptr [[TMP3]], i32 0
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x ptr> [[TMP6]], ptr [[TMP5]], i32 1
; CHECK-NEXT: call void @llvm.experimental.vector.histogram.add.v2p0.i32(<2 x ptr> [[TMP7]], i32 1, <2 x i1> splat (i1 true))
; CHECK-NEXT: [[IV_NEXT]] = add nuw i64 [[IV]], 2
; CHECK-NEXT: [[TMP8:%.*]] = icmp eq i64 [[IV_NEXT]], 1000
@@ -66,12 +66,12 @@ define void @histogram_extra_use_of_bucket_value(ptr noalias %buckets, ptr reado
; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds i32, ptr [[BUCKETS]], i64 [[TMP3]]
; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x i64> [[TMP2]], i64 1
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, ptr [[BUCKETS]], i64 [[TMP5]]
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x ptr> poison, ptr [[TMP4]], i64 0
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x ptr> [[TMP7]], ptr [[TMP6]], i64 1
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x ptr> poison, ptr [[TMP4]], i32 0
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x ptr> [[TMP7]], ptr [[TMP6]], i32 1
; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP4]], align 4
; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP6]], align 4
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i32> poison, i32 [[TMP9]], i64 0
-; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x i32> [[TMP11]], i32 [[TMP10]], i64 1
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i32> poison, i32 [[TMP9]], i32 0
+; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x i32> [[TMP11]], i32 [[TMP10]], i32 1
; CHECK-NEXT: call void @llvm.experimental.vector.histogram.add.v2p0.i32(<2 x ptr> [[TMP8]], i32 1, <2 x i1> splat (i1 true))
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i32, ptr [[OUT]], i64 [[INDEX]]
; CHECK-NEXT: store <2 x i32> [[TMP12]], ptr [[TMP13]], align 4
@@ -123,12 +123,12 @@ define void @histogram_extra_use_of_update(ptr noalias %buckets, ptr readonly %i
; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds i32, ptr [[BUCKETS]], i64 [[TMP3]]
; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x i64> [[TMP2]], i64 1
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i32, ptr [[BUCKETS]], i64 [[TMP5]]
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x ptr> poison, ptr [[TMP4]], i64 0
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x ptr> [[TMP7]], ptr [[TMP6]], i64 1
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x ptr> poison, ptr [[TMP4]], i32 0
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x ptr> [[TMP7]], ptr [[TMP6]], i32 1
; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP4]], align 4
; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP6]], align 4
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i32> poison, i32 [[TMP9]], i64 0
-; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x i32> [[TMP11]], i32 [[TMP10]], i64 1
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i32> poison, i32 [[TMP9]], i32 0
+; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x i32> [[TMP11]], i32 [[TMP10]], i32 1
; CHECK-NEXT: [[TMP13:%.*]] = add nsw <2 x i32> [[TMP12]], splat (i32 1)
; CHECK-NEXT: call void @llvm.experimental.vector.histogram.add.v2p0.i32(<2 x ptr> [[TMP8]], i32 1, <2 x i1> splat (i1 true))
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds i32, ptr [[OUT]], i64 [[INDEX]]
diff --git a/llvm/test/Transforms/LoopVectorize/hoist-and-sink-mem-ops-with-invariant-pointers.ll b/llvm/test/Transforms/LoopVectorize/hoist-and-sink-mem-ops-with-invariant-pointers.ll
index 9afd6ca0cd583..9ec4ac2181ae3 100644
--- a/llvm/test/Transforms/LoopVectorize/hoist-and-sink-mem-ops-with-invariant-pointers.ll
+++ b/llvm/test/Transforms/LoopVectorize/hoist-and-sink-mem-ops-with-invariant-pointers.ll
@@ -275,10 +275,10 @@ define void @load_store_noalias_via_tbaa(ptr %p, ptr %q, ptr %n) {
; CHECK-NEXT: [[TMP29:%.*]] = load float, ptr [[TMP25]], align 4, !tbaa [[FLOAT_TBAA27]], !alias.scope [[META31]]
; CHECK-NEXT: [[TMP30:%.*]] = load float, ptr [[TMP26]], align 4, !tbaa [[FLOAT_TBAA27]], !alias.scope [[META31]]
; CHECK-NEXT: [[TMP31:%.*]] = load float, ptr [[TMP27]], align 4, !tbaa [[FLOAT_TBAA27]], !alias.scope [[META31]]
-; CHECK-NEXT: [[TMP32:%.*]] = insertelement <4 x float> poison, float [[TMP28]], i64 0
-; CHECK-NEXT: [[TMP33:%.*]] = insertelement <4 x float> [[TMP32]], float [[TMP29]], i64 1
-; CHECK-NEXT: [[TMP34:%.*]] = insertelement <4 x float> [[TMP33]], float [[TMP30]], i64 2
-; CHECK-NEXT: [[TMP35:%.*]] = insertelement <4 x float> [[TMP34]], float [[TMP31]], i64 3
+; CHECK-NEXT: [[TMP32:%.*]] = insertelement <4 x float> poison, float [[TMP28]], i32 0
+; CHECK-NEXT: [[TMP33:%.*]] = insertelement <4 x float> [[TMP32]], float [[TMP29]], i32 1
+; CHECK-NEXT: [[TMP34:%.*]] = insertelement <4 x float> [[TMP33]], float [[TMP30]], i32 2
+; CHECK-NEXT: [[TMP35:%.*]] = insertelement <4 x float> [[TMP34]], float [[TMP31]], i32 3
; CHECK-NEXT: [[TMP36:%.*]] = fadd <4 x float> [[BROADCAST_SPLAT]], [[TMP35]]
; CHECK-NEXT: [[TMP37:%.*]] = extractelement <4 x float> [[TMP36]], i64 3
; CHECK-NEXT: store float [[TMP37]], ptr [[P]], align 4, !tbaa [[FLOAT_TBAA27]], !alias.scope [[META33:![0-9]+]], !noalias [[META28]]
diff --git a/llvm/test/Transforms/LoopVectorize/hoist-predicated-loads-with-predicated-stores.ll b/llvm/test/Transforms/LoopVectorize/hoist-predicated-loads-with-predicated-stores.ll
index b3a7b495f1205..109acbfd92de2 100644
--- a/llvm/test/Transforms/LoopVectorize/hoist-predicated-loads-with-predicated-stores.ll
+++ b/llvm/test/Transforms/LoopVectorize/hoist-predicated-loads-with-predicated-stores.ll
@@ -30,8 +30,8 @@ define void @test_stores_noalias_via_rt_checks_after_loads(ptr %dst, ptr %src, p
; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i32 [[TMP0]]
; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP3]], align 4, !alias.scope [[META3:![0-9]+]]
; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[TMP4]], align 4, !alias.scope [[META3]]
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> poison, i32 [[TMP5]], i64 0
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i32> [[TMP7]], i32 [[TMP6]], i64 1
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> poison, i32 [[TMP5]], i32 0
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i32> [[TMP7]], i32 [[TMP6]], i32 1
; CHECK-NEXT: [[TMP9:%.*]] = sub <2 x i32> [[TMP8]], splat (i32 5)
; CHECK-NEXT: [[TMP10:%.*]] = add <2 x i32> [[TMP8]], splat (i32 10)
; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds i32, ptr [[DST]], i32 [[INDEX]]
@@ -259,8 +259,8 @@ define void @test_noalias_store_via_runtime_checks(ptr %dst, ptr %dst.1, ptr %sr
; CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i32 [[TMP0]]
; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP7]], align 4, !alias.scope [[META30:![0-9]+]]
; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP8]], align 4, !alias.scope [[META30]]
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i32> poison, i32 [[TMP9]], i64 0
-; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x i32> [[TMP11]], i32 [[TMP10]], i64 1
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i32> poison, i32 [[TMP9]], i32 0
+; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x i32> [[TMP11]], i32 [[TMP10]], i32 1
; CHECK-NEXT: [[TMP13:%.*]] = sub <2 x i32> [[TMP12]], splat (i32 5)
; CHECK-NEXT: [[TMP14:%.*]] = add <2 x i32> [[TMP12]], splat (i32 10)
; CHECK-NEXT: [[TMP15:%.*]] = getelementptr inbounds i32, ptr [[DST]], i32 [[INDEX]]
@@ -361,8 +361,8 @@ define void @test_memory_op_between_loads_alias(ptr %dst, ptr %src, ptr %cond, p
; CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i32 [[TMP0]]
; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP7]], align 4, !alias.scope [[META38]], !noalias [[META40]]
; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP8]], align 4, !alias.scope [[META38]], !noalias [[META40]]
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i32> poison, i32 [[TMP9]], i64 0
-; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x i32> [[TMP11]], i32 [[TMP10]], i64 1
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i32> poison, i32 [[TMP9]], i32 0
+; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x i32> [[TMP11]], i32 [[TMP10]], i32 1
; CHECK-NEXT: [[TMP13:%.*]] = add <2 x i32> [[TMP12]], splat (i32 10)
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds i32, ptr [[DST]], i32 [[INDEX]]
; CHECK-NEXT: [[TMP15:%.*]] = getelementptr inbounds i32, ptr [[DST]], i32 [[TMP0]]
@@ -473,8 +473,8 @@ define void @test_memory_op_between_loads_no_alias_via_rt_checks(ptr %dst, ptr %
; CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i32 [[TMP0]]
; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP7]], align 4, !alias.scope [[META53:![0-9]+]]
; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP8]], align 4, !alias.scope [[META53]]
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i32> poison, i32 [[TMP9]], i64 0
-; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x i32> [[TMP11]], i32 [[TMP10]], i64 1
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i32> poison, i32 [[TMP9]], i32 0
+; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x i32> [[TMP11]], i32 [[TMP10]], i32 1
; CHECK-NEXT: [[TMP13:%.*]] = add <2 x i32> [[TMP12]], splat (i32 10)
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds i32, ptr [[DST]], i32 [[INDEX]]
; CHECK-NEXT: [[TMP15:%.*]] = getelementptr inbounds i32, ptr [[DST]], i32 [[TMP0]]
@@ -747,13 +747,13 @@ define void @sink_multiple_store_groups_noalias_via_scev(ptr %dst, ptr %src) {
; CHECK-NEXT: [[TMP5:%.*]] = getelementptr i8, ptr [[TMP3]], i64 152
; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[TMP4]], align 4, !alias.scope [[META78:![0-9]+]]
; CHECK-NEXT: [[TMP7:%.*]] = load i32, ptr [[TMP5]], align 4, !alias.scope [[META78]]
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i32> poison, i32 [[TMP6]], i64 0
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i32> [[TMP8]], i32 [[TMP7]], i64 1
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i32> poison, i32 [[TMP6]], i32 0
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i32> [[TMP8]], i32 [[TMP7]], i32 1
; CHECK-NEXT: [[TMP10:%.*]] = icmp eq <2 x i32> [[TMP9]], zeroinitializer
; CHECK-NEXT: [[TMP11:%.*]] = load double, ptr [[TMP2]], align 8, !alias.scope [[META78]]
; CHECK-NEXT: [[TMP12:%.*]] = load double, ptr [[TMP3]], align 8, !alias.scope [[META78]]
-; CHECK-NEXT: [[TMP13:%.*]] = insertelement <2 x double> poison, double [[TMP11]], i64 0
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <2 x double> [[TMP13]], double [[TMP12]], i64 1
+; CHECK-NEXT: [[TMP13:%.*]] = insertelement <2 x double> poison, double [[TMP11]], i32 0
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <2 x double> [[TMP13]], double [[TMP12]], i32 1
; CHECK-NEXT: [[TMP15:%.*]] = fadd <2 x double> [[TMP14]], splat (double 8.000000e+00)
; CHECK-NEXT: [[TMP16:%.*]] = getelementptr double, ptr [[DST]], i64 [[TMP0]]
; CHECK-NEXT: [[TMP17:%.*]] = getelementptr double, ptr [[DST]], i64 [[TMP1]]
@@ -843,13 +843,13 @@ define void @sink_multiple_store_groups_alias_via_scev(ptr %dst, ptr %src) {
; CHECK-NEXT: [[TMP5:%.*]] = getelementptr i8, ptr [[TMP3]], i64 152
; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[TMP4]], align 4, !alias.scope [[META85:![0-9]+]]
; CHECK-NEXT: [[TMP7:%.*]] = load i32, ptr [[TMP5]], align 4, !alias.scope [[META85]]
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i32> poison, i32 [[TMP6]], i64 0
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i32> [[TMP8]], i32 [[TMP7]], i64 1
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i32> poison, i32 [[TMP6]], i32 0
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i32> [[TMP8]], i32 [[TMP7]], i32 1
; CHECK-NEXT: [[TMP10:%.*]] = icmp eq <2 x i32> [[TMP9]], zeroinitializer
; CHECK-NEXT: [[TMP11:%.*]] = load double, ptr [[TMP2]], align 8, !alias.scope [[META85]]
; CHECK-NEXT: [[TMP12:%.*]] = load double, ptr [[TMP3]], align 8, !alias.scope [[META85]]
-; CHECK-NEXT: [[TMP13:%.*]] = insertelement <2 x double> poison, double [[TMP11]], i64 0
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <2 x double> [[TMP13]], double [[TMP12]], i64 1
+; CHECK-NEXT: [[TMP13:%.*]] = insertelement <2 x double> poison, double [[TMP11]], i32 0
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <2 x double> [[TMP13]], double [[TMP12]], i32 1
; CHECK-NEXT: [[TMP15:%.*]] = xor <2 x i1> [[TMP10]], splat (i1 true)
; CHECK-NEXT: [[TMP16:%.*]] = fadd <2 x double> [[TMP14]], splat (double 8.000000e+00)
; CHECK-NEXT: [[TMP17:%.*]] = extractelement <2 x i1> [[TMP15]], i64 0
diff --git a/llvm/test/Transforms/LoopVectorize/hoist-predicated-loads.ll b/llvm/test/Transforms/LoopVectorize/hoist-predicated-loads.ll
index 843b71a507f3a..c6436de1023a8 100644
--- a/llvm/test/Transforms/LoopVectorize/hoist-predicated-loads.ll
+++ b/llvm/test/Transforms/LoopVectorize/hoist-predicated-loads.ll
@@ -30,8 +30,8 @@ define void @test(ptr %dst, ptr %src, ptr %cond) {
; CHECK-NEXT: [[TMP15:%.*]] = icmp ule <2 x i32> [[WIDE_LOAD]], splat (i32 11)
; CHECK-NEXT: [[TMP18:%.*]] = load i32, ptr [[TMP8]], align 4, !alias.scope [[META3:![0-9]+]]
; CHECK-NEXT: [[TMP7:%.*]] = load i32, ptr [[TMP9]], align 4, !alias.scope [[META3]]
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <2 x i32> poison, i32 [[TMP18]], i64 0
-; CHECK-NEXT: [[TMP36:%.*]] = insertelement <2 x i32> [[TMP19]], i32 [[TMP7]], i64 1
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <2 x i32> poison, i32 [[TMP18]], i32 0
+; CHECK-NEXT: [[TMP36:%.*]] = insertelement <2 x i32> [[TMP19]], i32 [[TMP7]], i32 1
; CHECK-NEXT: [[TMP25:%.*]] = add <2 x i32> [[TMP36]], splat (i32 10)
; CHECK-NEXT: [[PREDPHI:%.*]] = select <2 x i1> [[TMP15]], <2 x i32> [[TMP36]], <2 x i32> [[TMP25]]
; CHECK-NEXT: [[TMP37:%.*]] = getelementptr inbounds i32, ptr [[DST]], i32 [[INDEX]]
@@ -444,8 +444,8 @@ define void @different_alignments_same_address(ptr %dst, ptr %src, ptr %cond) {
; CHECK-NEXT: [[TMP15:%.*]] = icmp ule <2 x i32> [[WIDE_LOAD]], splat (i32 11)
; CHECK-NEXT: [[TMP18:%.*]] = load i32, ptr [[TMP8]], align 2, !alias.scope [[META39:![0-9]+]]
; CHECK-NEXT: [[TMP7:%.*]] = load i32, ptr [[TMP9]], align 2, !alias.scope [[META39]]
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <2 x i32> poison, i32 [[TMP18]], i64 0
-; CHECK-NEXT: [[TMP25:%.*]] = insertelement <2 x i32> [[TMP19]], i32 [[TMP7]], i64 1
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <2 x i32> poison, i32 [[TMP18]], i32 0
+; CHECK-NEXT: [[TMP25:%.*]] = insertelement <2 x i32> [[TMP19]], i32 [[TMP7]], i32 1
; CHECK-NEXT: [[TMP26:%.*]] = add <2 x i32> [[TMP25]], splat (i32 10)
; CHECK-NEXT: [[PREDPHI:%.*]] = select <2 x i1> [[TMP15]], <2 x i32> [[TMP25]], <2 x i32> [[TMP26]]
; CHECK-NEXT: [[TMP35:%.*]] = getelementptr inbounds i32, ptr [[DST]], i32 [[INDEX]]
@@ -583,8 +583,8 @@ define void @duplicate_gep(ptr %dst, ptr %src, ptr %cond) {
; CHECK-NEXT: [[TMP15:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i32 [[TMP5]]
; CHECK-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP10]], align 4, !alias.scope [[META49:![0-9]+]]
; CHECK-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP15]], align 4, !alias.scope [[META49]]
-; CHECK-NEXT: [[TMP23:%.*]] = insertelement <2 x i32> poison, i32 [[TMP22]], i64 0
-; CHECK-NEXT: [[TMP29:%.*]] = insertelement <2 x i32> [[TMP23]], i32 [[TMP8]], i64 1
+; CHECK-NEXT: [[TMP23:%.*]] = insertelement <2 x i32> poison, i32 [[TMP22]], i32 0
+; CHECK-NEXT: [[TMP29:%.*]] = insertelement <2 x i32> [[TMP23]], i32 [[TMP8]], i32 1
; CHECK-NEXT: [[TMP19:%.*]] = add <2 x i32> [[TMP29]], splat (i32 10)
; CHECK-NEXT: [[PREDPHI:%.*]] = select <2 x i1> [[TMP7]], <2 x i32> [[TMP29]], <2 x i32> [[TMP19]]
; CHECK-NEXT: [[TMP30:%.*]] = getelementptr inbounds i32, ptr [[DST]], i32 [[INDEX]]
@@ -661,8 +661,8 @@ define void @non_unit_stride_i64(ptr %dst, ptr %src, ptr %cond) {
; CHECK-NEXT: [[TMP17:%.*]] = getelementptr inbounds i64, ptr [[SRC]], i32 [[TMP7]]
; CHECK-NEXT: [[TMP24:%.*]] = load i32, ptr [[TMP12]], align 4, !alias.scope [[META59:![0-9]+]]
; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP17]], align 4, !alias.scope [[META59]]
-; CHECK-NEXT: [[TMP25:%.*]] = insertelement <2 x i32> poison, i32 [[TMP24]], i64 0
-; CHECK-NEXT: [[TMP31:%.*]] = insertelement <2 x i32> [[TMP25]], i32 [[TMP10]], i64 1
+; CHECK-NEXT: [[TMP25:%.*]] = insertelement <2 x i32> poison, i32 [[TMP24]], i32 0
+; CHECK-NEXT: [[TMP31:%.*]] = insertelement <2 x i32> [[TMP25]], i32 [[TMP10]], i32 1
; CHECK-NEXT: [[TMP21:%.*]] = add <2 x i32> [[TMP31]], splat (i32 10)
; CHECK-NEXT: [[PREDPHI:%.*]] = select <2 x i1> [[TMP9]], <2 x i32> [[TMP31]], <2 x i32> [[TMP21]]
; CHECK-NEXT: [[TMP32:%.*]] = getelementptr inbounds i32, ptr [[DST]], i32 [[INDEX]]
diff --git a/llvm/test/Transforms/LoopVectorize/if-pred-stores.ll b/llvm/test/Transforms/LoopVectorize/if-pred-stores.ll
index 4615e95e0cd91..a9cfaafdbbf40 100644
--- a/llvm/test/Transforms/LoopVectorize/if-pred-stores.ll
+++ b/llvm/test/Transforms/LoopVectorize/if-pred-stores.ll
@@ -318,7 +318,7 @@ define void @bug18724(i1 %cond, ptr %ptr, i1 %cond.2, i64 %v.1, i32 %v.2) {
; VEC-NEXT: [[N_MOD_VF:%.*]] = and i64 [[TMP4]], 1
; VEC-NEXT: [[N_VEC:%.*]] = sub i64 [[TMP4]], [[N_MOD_VF]]
; VEC-NEXT: [[TMP5:%.*]] = add i64 [[V_1]], [[N_VEC]]
-; VEC-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[V_2]], i64 0
+; VEC-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[V_2]], i32 0
; VEC-NEXT: br label %[[VECTOR_BODY:.*]]
; VEC: [[VECTOR_BODY]]:
; VEC-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[PRED_STORE_CONTINUE2:.*]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/induction.ll b/llvm/test/Transforms/LoopVectorize/induction.ll
index 1683f784daf75..bb4972771c32c 100644
--- a/llvm/test/Transforms/LoopVectorize/induction.ll
+++ b/llvm/test/Transforms/LoopVectorize/induction.ll
@@ -877,14 +877,14 @@ define float @scalarize_induction_variable_02(ptr %a, ptr %b, i64 %n) {
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds float, ptr [[A]], i64 [[TMP4]]
; CHECK-NEXT: [[TMP7:%.*]] = load float, ptr [[TMP5]], align 4
; CHECK-NEXT: [[TMP8:%.*]] = load float, ptr [[TMP6]], align 4
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x float> poison, float [[TMP7]], i64 0
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x float> [[TMP9]], float [[TMP8]], i64 1
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x float> poison, float [[TMP7]], i32 0
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x float> [[TMP9]], float [[TMP8]], i32 1
; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds float, ptr [[B:%.*]], i64 [[OFFSET_IDX]]
; CHECK-NEXT: [[TMP12:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[TMP4]]
; CHECK-NEXT: [[TMP13:%.*]] = load float, ptr [[TMP11]], align 4
; CHECK-NEXT: [[TMP14:%.*]] = load float, ptr [[TMP12]], align 4
-; CHECK-NEXT: [[TMP15:%.*]] = insertelement <2 x float> poison, float [[TMP13]], i64 0
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <2 x float> [[TMP15]], float [[TMP14]], i64 1
+; CHECK-NEXT: [[TMP15:%.*]] = insertelement <2 x float> poison, float [[TMP13]], i32 0
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <2 x float> [[TMP15]], float [[TMP14]], i32 1
; CHECK-NEXT: [[TMP17:%.*]] = fadd fast <2 x float> [[VEC_PHI]], splat (float 1.000000e+00)
; CHECK-NEXT: [[TMP18:%.*]] = fadd fast <2 x float> [[TMP17]], [[TMP10]]
; CHECK-NEXT: [[TMP19]] = fadd fast <2 x float> [[TMP18]], [[TMP16]]
@@ -938,14 +938,14 @@ define float @scalarize_induction_variable_02(ptr %a, ptr %b, i64 %n) {
; IND-NEXT: [[TMP14:%.*]] = getelementptr inbounds float, ptr [[A]], i64 [[TMP8]]
; IND-NEXT: [[TMP7:%.*]] = load float, ptr [[TMP5]], align 4
; IND-NEXT: [[TMP29:%.*]] = load float, ptr [[TMP14]], align 4
-; IND-NEXT: [[TMP30:%.*]] = insertelement <2 x float> poison, float [[TMP7]], i64 0
-; IND-NEXT: [[TMP9:%.*]] = insertelement <2 x float> [[TMP30]], float [[TMP29]], i64 1
+; IND-NEXT: [[TMP30:%.*]] = insertelement <2 x float> poison, float [[TMP7]], i32 0
+; IND-NEXT: [[TMP9:%.*]] = insertelement <2 x float> [[TMP30]], float [[TMP29]], i32 1
; IND-NEXT: [[TMP10:%.*]] = getelementptr inbounds float, ptr [[B:%.*]], i64 [[OFFSET_IDX]]
; IND-NEXT: [[TMP11:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[TMP8]]
; IND-NEXT: [[TMP12:%.*]] = load float, ptr [[TMP10]], align 4
; IND-NEXT: [[TMP13:%.*]] = load float, ptr [[TMP11]], align 4
-; IND-NEXT: [[TMP28:%.*]] = insertelement <2 x float> poison, float [[TMP12]], i64 0
-; IND-NEXT: [[TMP15:%.*]] = insertelement <2 x float> [[TMP28]], float [[TMP13]], i64 1
+; IND-NEXT: [[TMP28:%.*]] = insertelement <2 x float> poison, float [[TMP12]], i32 0
+; IND-NEXT: [[TMP15:%.*]] = insertelement <2 x float> [[TMP28]], float [[TMP13]], i32 1
; IND-NEXT: [[TMP16:%.*]] = fadd fast <2 x float> [[VEC_PHI]], splat (float 1.000000e+00)
; IND-NEXT: [[TMP17:%.*]] = fadd fast <2 x float> [[TMP16]], [[TMP9]]
; IND-NEXT: [[TMP18]] = fadd fast <2 x float> [[TMP17]], [[TMP15]]
@@ -1004,24 +1004,24 @@ define float @scalarize_induction_variable_02(ptr %a, ptr %b, i64 %n) {
; UNROLL-NEXT: [[TMP9:%.*]] = getelementptr inbounds float, ptr [[A]], i64 [[TMP24]]
; UNROLL-NEXT: [[TMP49:%.*]] = load float, ptr [[TMP48]], align 4
; UNROLL-NEXT: [[TMP11:%.*]] = load float, ptr [[TMP10]], align 4
-; UNROLL-NEXT: [[TMP28:%.*]] = insertelement <2 x float> poison, float [[TMP49]], i64 0
-; UNROLL-NEXT: [[TMP13:%.*]] = insertelement <2 x float> [[TMP28]], float [[TMP11]], i64 1
+; UNROLL-NEXT: [[TMP28:%.*]] = insertelement <2 x float> poison, float [[TMP49]], i32 0
+; UNROLL-NEXT: [[TMP13:%.*]] = insertelement <2 x float> [[TMP28]], float [[TMP11]], i32 1
; UNROLL-NEXT: [[TMP14:%.*]] = load float, ptr [[TMP8]], align 4
; UNROLL-NEXT: [[TMP15:%.*]] = load float, ptr [[TMP9]], align 4
-; UNROLL-NEXT: [[TMP45:%.*]] = insertelement <2 x float> poison, float [[TMP14]], i64 0
-; UNROLL-NEXT: [[TMP17:%.*]] = insertelement <2 x float> [[TMP45]], float [[TMP15]], i64 1
+; UNROLL-NEXT: [[TMP45:%.*]] = insertelement <2 x float> poison, float [[TMP14]], i32 0
+; UNROLL-NEXT: [[TMP17:%.*]] = insertelement <2 x float> [[TMP45]], float [[TMP15]], i32 1
; UNROLL-NEXT: [[TMP18:%.*]] = getelementptr inbounds float, ptr [[B:%.*]], i64 [[OFFSET_IDX]]
; UNROLL-NEXT: [[TMP19:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[TMP12]]
; UNROLL-NEXT: [[TMP20:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[TMP16]]
; UNROLL-NEXT: [[TMP21:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[TMP24]]
; UNROLL-NEXT: [[TMP22:%.*]] = load float, ptr [[TMP18]], align 4
; UNROLL-NEXT: [[TMP23:%.*]] = load float, ptr [[TMP19]], align 4
-; UNROLL-NEXT: [[TMP46:%.*]] = insertelement <2 x float> poison, float [[TMP22]], i64 0
-; UNROLL-NEXT: [[TMP25:%.*]] = insertelement <2 x float> [[TMP46]], float [[TMP23]], i64 1
+; UNROLL-NEXT: [[TMP46:%.*]] = insertelement <2 x float> poison, float [[TMP22]], i32 0
+; UNROLL-NEXT: [[TMP25:%.*]] = insertelement <2 x float> [[TMP46]], float [[TMP23]], i32 1
; UNROLL-NEXT: [[TMP26:%.*]] = load float, ptr [[TMP20]], align 4
; UNROLL-NEXT: [[TMP27:%.*]] = load float, ptr [[TMP21]], align 4
-; UNROLL-NEXT: [[TMP47:%.*]] = insertelement <2 x float> poison, float [[TMP26]], i64 0
-; UNROLL-NEXT: [[TMP29:%.*]] = insertelement <2 x float> [[TMP47]], float [[TMP27]], i64 1
+; UNROLL-NEXT: [[TMP47:%.*]] = insertelement <2 x float> poison, float [[TMP26]], i32 0
+; UNROLL-NEXT: [[TMP29:%.*]] = insertelement <2 x float> [[TMP47]], float [[TMP27]], i32 1
; UNROLL-NEXT: [[TMP30:%.*]] = fadd fast <2 x float> [[VEC_PHI]], splat (float 1.000000e+00)
; UNROLL-NEXT: [[TMP31:%.*]] = fadd fast <2 x float> [[VEC_PHI1]], splat (float 1.000000e+00)
; UNROLL-NEXT: [[TMP32:%.*]] = fadd fast <2 x float> [[TMP30]], [[TMP13]]
@@ -1084,24 +1084,24 @@ define float @scalarize_induction_variable_02(ptr %a, ptr %b, i64 %n) {
; UNROLL-NO-IC-NEXT: [[TMP10:%.*]] = getelementptr inbounds float, ptr [[A]], i64 [[TMP6]]
; UNROLL-NO-IC-NEXT: [[TMP11:%.*]] = load float, ptr [[TMP7]], align 4
; UNROLL-NO-IC-NEXT: [[TMP12:%.*]] = load float, ptr [[TMP8]], align 4
-; UNROLL-NO-IC-NEXT: [[TMP13:%.*]] = insertelement <2 x float> poison, float [[TMP11]], i64 0
-; UNROLL-NO-IC-NEXT: [[TMP14:%.*]] = insertelement <2 x float> [[TMP13]], float [[TMP12]], i64 1
+; UNROLL-NO-IC-NEXT: [[TMP13:%.*]] = insertelement <2 x float> poison, float [[TMP11]], i32 0
+; UNROLL-NO-IC-NEXT: [[TMP14:%.*]] = insertelement <2 x float> [[TMP13]], float [[TMP12]], i32 1
; UNROLL-NO-IC-NEXT: [[TMP15:%.*]] = load float, ptr [[TMP9]], align 4
; UNROLL-NO-IC-NEXT: [[TMP16:%.*]] = load float, ptr [[TMP10]], align 4
-; UNROLL-NO-IC-NEXT: [[TMP17:%.*]] = insertelement <2 x float> poison, float [[TMP15]], i64 0
-; UNROLL-NO-IC-NEXT: [[TMP18:%.*]] = insertelement <2 x float> [[TMP17]], float [[TMP16]], i64 1
+; UNROLL-NO-IC-NEXT: [[TMP17:%.*]] = insertelement <2 x float> poison, float [[TMP15]], i32 0
+; UNROLL-NO-IC-NEXT: [[TMP18:%.*]] = insertelement <2 x float> [[TMP17]], float [[TMP16]], i32 1
; UNROLL-NO-IC-NEXT: [[TMP19:%.*]] = getelementptr inbounds float, ptr [[B:%.*]], i64 [[OFFSET_IDX]]
; UNROLL-NO-IC-NEXT: [[TMP20:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[TMP4]]
; UNROLL-NO-IC-NEXT: [[TMP21:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[TMP5]]
; UNROLL-NO-IC-NEXT: [[TMP22:%.*]] = getelementptr inbounds float, ptr [[B]], i64 [[TMP6]]
; UNROLL-NO-IC-NEXT: [[TMP23:%.*]] = load float, ptr [[TMP19]], align 4
; UNROLL-NO-IC-NEXT: [[TMP24:%.*]] = load float, ptr [[TMP20]], align 4
-; UNROLL-NO-IC-NEXT: [[TMP25:%.*]] = insertelement <2 x float> poison, float [[TMP23]], i64 0
-; UNROLL-NO-IC-NEXT: [[TMP26:%.*]] = insertelement <2 x float> [[TMP25]], float [[TMP24]], i64 1
+; UNROLL-NO-IC-NEXT: [[TMP25:%.*]] = insertelement <2 x float> poison, float [[TMP23]], i32 0
+; UNROLL-NO-IC-NEXT: [[TMP26:%.*]] = insertelement <2 x float> [[TMP25]], float [[TMP24]], i32 1
; UNROLL-NO-IC-NEXT: [[TMP27:%.*]] = load float, ptr [[TMP21]], align 4
; UNROLL-NO-IC-NEXT: [[TMP28:%.*]] = load float, ptr [[TMP22]], align 4
-; UNROLL-NO-IC-NEXT: [[TMP29:%.*]] = insertelement <2 x float> poison, float [[TMP27]], i64 0
-; UNROLL-NO-IC-NEXT: [[TMP30:%.*]] = insertelement <2 x float> [[TMP29]], float [[TMP28]], i64 1
+; UNROLL-NO-IC-NEXT: [[TMP29:%.*]] = insertelement <2 x float> poison, float [[TMP27]], i32 0
+; UNROLL-NO-IC-NEXT: [[TMP30:%.*]] = insertelement <2 x float> [[TMP29]], float [[TMP28]], i32 1
; UNROLL-NO-IC-NEXT: [[TMP31:%.*]] = fadd fast <2 x float> [[VEC_PHI]], splat (float 1.000000e+00)
; UNROLL-NO-IC-NEXT: [[TMP32:%.*]] = fadd fast <2 x float> [[VEC_PHI1]], splat (float 1.000000e+00)
; UNROLL-NO-IC-NEXT: [[TMP33:%.*]] = fadd fast <2 x float> [[TMP31]], [[TMP14]]
@@ -1253,8 +1253,8 @@ define void @scalarize_induction_variable_03(ptr %p, i32 %y, i64 %n) {
; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[PAIR_I32]], ptr [[P]], i64 [[TMP1]], i32 1
; CHECK-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP2]], align 8
; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP3]], align 8
-; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP4]], i64 0
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP5]], i64 1
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> poison, i32 [[TMP4]], i32 0
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i32> [[TMP6]], i32 [[TMP5]], i32 1
; CHECK-NEXT: [[TMP8:%.*]] = xor <2 x i32> [[TMP7]], [[BROADCAST_SPLAT]]
; CHECK-NEXT: [[TMP9:%.*]] = extractelement <2 x i32> [[TMP8]], i64 0
; CHECK-NEXT: store i32 [[TMP9]], ptr [[TMP2]], align 8
@@ -1299,8 +1299,8 @@ define void @scalarize_induction_variable_03(ptr %p, i32 %y, i64 %n) {
; IND-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[PAIR_I32]], ptr [[P]], i64 [[TMP5]], i32 1
; IND-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP1]], align 8
; IND-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP2]], align 8
-; IND-NEXT: [[TMP13:%.*]] = insertelement <2 x i32> poison, i32 [[TMP3]], i64 0
-; IND-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> [[TMP13]], i32 [[TMP4]], i64 1
+; IND-NEXT: [[TMP13:%.*]] = insertelement <2 x i32> poison, i32 [[TMP3]], i32 0
+; IND-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> [[TMP13]], i32 [[TMP4]], i32 1
; IND-NEXT: [[TMP7:%.*]] = xor <2 x i32> [[TMP6]], [[BROADCAST_SPLAT]]
; IND-NEXT: [[TMP8:%.*]] = extractelement <2 x i32> [[TMP7]], i64 0
; IND-NEXT: store i32 [[TMP8]], ptr [[TMP1]], align 8
@@ -1349,12 +1349,12 @@ define void @scalarize_induction_variable_03(ptr %p, i32 %y, i64 %n) {
; UNROLL-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[PAIR_I32]], ptr [[P]], i64 [[TMP9]], i32 1
; UNROLL-NEXT: [[TMP7:%.*]] = load i32, ptr [[TMP3]], align 8
; UNROLL-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP4]], align 8
-; UNROLL-NEXT: [[TMP13:%.*]] = insertelement <2 x i32> poison, i32 [[TMP7]], i64 0
-; UNROLL-NEXT: [[TMP10:%.*]] = insertelement <2 x i32> [[TMP13]], i32 [[TMP8]], i64 1
+; UNROLL-NEXT: [[TMP13:%.*]] = insertelement <2 x i32> poison, i32 [[TMP7]], i32 0
+; UNROLL-NEXT: [[TMP10:%.*]] = insertelement <2 x i32> [[TMP13]], i32 [[TMP8]], i32 1
; UNROLL-NEXT: [[TMP11:%.*]] = load i32, ptr [[TMP5]], align 8
; UNROLL-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP6]], align 8
-; UNROLL-NEXT: [[TMP24:%.*]] = insertelement <2 x i32> poison, i32 [[TMP11]], i64 0
-; UNROLL-NEXT: [[TMP14:%.*]] = insertelement <2 x i32> [[TMP24]], i32 [[TMP12]], i64 1
+; UNROLL-NEXT: [[TMP24:%.*]] = insertelement <2 x i32> poison, i32 [[TMP11]], i32 0
+; UNROLL-NEXT: [[TMP14:%.*]] = insertelement <2 x i32> [[TMP24]], i32 [[TMP12]], i32 1
; UNROLL-NEXT: [[TMP15:%.*]] = xor <2 x i32> [[TMP10]], [[BROADCAST_SPLAT]]
; UNROLL-NEXT: [[TMP16:%.*]] = xor <2 x i32> [[TMP14]], [[BROADCAST_SPLAT]]
; UNROLL-NEXT: [[TMP17:%.*]] = extractelement <2 x i32> [[TMP15]], i64 0
@@ -1408,12 +1408,12 @@ define void @scalarize_induction_variable_03(ptr %p, i32 %y, i64 %n) {
; UNROLL-NO-IC-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[PAIR_I32]], ptr [[P]], i64 [[TMP3]], i32 1
; UNROLL-NO-IC-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP4]], align 8
; UNROLL-NO-IC-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP5]], align 8
-; UNROLL-NO-IC-NEXT: [[TMP10:%.*]] = insertelement <2 x i32> poison, i32 [[TMP8]], i64 0
-; UNROLL-NO-IC-NEXT: [[TMP11:%.*]] = insertelement <2 x i32> [[TMP10]], i32 [[TMP9]], i64 1
+; UNROLL-NO-IC-NEXT: [[TMP10:%.*]] = insertelement <2 x i32> poison, i32 [[TMP8]], i32 0
+; UNROLL-NO-IC-NEXT: [[TMP11:%.*]] = insertelement <2 x i32> [[TMP10]], i32 [[TMP9]], i32 1
; UNROLL-NO-IC-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP6]], align 8
; UNROLL-NO-IC-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP7]], align 8
-; UNROLL-NO-IC-NEXT: [[TMP14:%.*]] = insertelement <2 x i32> poison, i32 [[TMP12]], i64 0
-; UNROLL-NO-IC-NEXT: [[TMP15:%.*]] = insertelement <2 x i32> [[TMP14]], i32 [[TMP13]], i64 1
+; UNROLL-NO-IC-NEXT: [[TMP14:%.*]] = insertelement <2 x i32> poison, i32 [[TMP12]], i32 0
+; UNROLL-NO-IC-NEXT: [[TMP15:%.*]] = insertelement <2 x i32> [[TMP14]], i32 [[TMP13]], i32 1
; UNROLL-NO-IC-NEXT: [[TMP16:%.*]] = xor <2 x i32> [[TMP11]], [[BROADCAST_SPLAT]]
; UNROLL-NO-IC-NEXT: [[TMP17:%.*]] = xor <2 x i32> [[TMP15]], [[BROADCAST_SPLAT]]
; UNROLL-NO-IC-NEXT: [[TMP18:%.*]] = extractelement <2 x i32> [[TMP16]], i64 0
@@ -3074,7 +3074,7 @@ define i32 @testoverflowcheck() {
; CHECK-NEXT: [[N_VEC:%.*]] = sub i32 [[TMP3]], [[N_MOD_VF]]
; CHECK-NEXT: [[DOTCAST:%.*]] = trunc i32 [[N_VEC]] to i8
; CHECK-NEXT: [[IND_END:%.*]] = add i8 [[DOTPR_I]], [[DOTCAST]]
-; CHECK-NEXT: [[TMP4:%.*]] = insertelement <2 x i32> splat (i32 -1), i32 [[C_PROMOTED_I]], i64 0
+; CHECK-NEXT: [[TMP4:%.*]] = insertelement <2 x i32> splat (i32 -1), i32 [[C_PROMOTED_I]], i32 0
; CHECK-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <2 x i32> poison, i32 [[TMP0]], i64 0
; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <2 x i32> [[BROADCAST_SPLATINSERT]], <2 x i32> poison, <2 x i32> zeroinitializer
; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]
@@ -3119,7 +3119,7 @@ define i32 @testoverflowcheck() {
; IND-NEXT: [[N_VEC:%.*]] = sub i32 [[TMP3]], [[N_MOD_VF]]
; IND-NEXT: [[DOTCAST:%.*]] = trunc i32 [[N_VEC]] to i8
; IND-NEXT: [[IND_END:%.*]] = add i8 [[DOTPR_I]], [[DOTCAST]]
-; IND-NEXT: [[TMP8:%.*]] = insertelement <2 x i32> splat (i32 -1), i32 [[C_PROMOTED_I]], i64 0
+; IND-NEXT: [[TMP8:%.*]] = insertelement <2 x i32> splat (i32 -1), i32 [[C_PROMOTED_I]], i32 0
; IND-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <2 x i32> poison, i32 [[TMP0]], i64 0
; IND-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <2 x i32> [[BROADCAST_SPLATINSERT]], <2 x i32> poison, <2 x i32> zeroinitializer
; IND-NEXT: br label [[VECTOR_BODY:%.*]]
@@ -3164,7 +3164,7 @@ define i32 @testoverflowcheck() {
; UNROLL-NEXT: [[N_VEC:%.*]] = sub i32 [[TMP3]], [[N_MOD_VF]]
; UNROLL-NEXT: [[DOTCAST:%.*]] = trunc i32 [[N_VEC]] to i8
; UNROLL-NEXT: [[IND_END:%.*]] = add i8 [[DOTPR_I]], [[DOTCAST]]
-; UNROLL-NEXT: [[TMP9:%.*]] = insertelement <2 x i32> splat (i32 -1), i32 [[C_PROMOTED_I]], i64 0
+; UNROLL-NEXT: [[TMP9:%.*]] = insertelement <2 x i32> splat (i32 -1), i32 [[C_PROMOTED_I]], i32 0
; UNROLL-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <2 x i32> poison, i32 [[TMP0]], i64 0
; UNROLL-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <2 x i32> [[BROADCAST_SPLATINSERT]], <2 x i32> poison, <2 x i32> zeroinitializer
; UNROLL-NEXT: br label [[VECTOR_BODY:%.*]]
@@ -3212,7 +3212,7 @@ define i32 @testoverflowcheck() {
; UNROLL-NO-IC-NEXT: [[N_VEC:%.*]] = sub i32 [[TMP3]], [[N_MOD_VF]]
; UNROLL-NO-IC-NEXT: [[DOTCAST:%.*]] = trunc i32 [[N_VEC]] to i8
; UNROLL-NO-IC-NEXT: [[IND_END:%.*]] = add i8 [[DOTPR_I]], [[DOTCAST]]
-; UNROLL-NO-IC-NEXT: [[TMP4:%.*]] = insertelement <2 x i32> splat (i32 -1), i32 [[C_PROMOTED_I]], i64 0
+; UNROLL-NO-IC-NEXT: [[TMP4:%.*]] = insertelement <2 x i32> splat (i32 -1), i32 [[C_PROMOTED_I]], i32 0
; UNROLL-NO-IC-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <2 x i32> poison, i32 [[TMP0]], i64 0
; UNROLL-NO-IC-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <2 x i32> [[BROADCAST_SPLATINSERT]], <2 x i32> poison, <2 x i32> zeroinitializer
; UNROLL-NO-IC-NEXT: br label [[VECTOR_BODY:%.*]]
@@ -3260,7 +3260,7 @@ define i32 @testoverflowcheck() {
; INTERLEAVE-NEXT: [[N_VEC:%.*]] = sub i32 [[TMP3]], [[N_MOD_VF]]
; INTERLEAVE-NEXT: [[DOTCAST:%.*]] = trunc i32 [[N_VEC]] to i8
; INTERLEAVE-NEXT: [[IND_END:%.*]] = add i8 [[DOTPR_I]], [[DOTCAST]]
-; INTERLEAVE-NEXT: [[TMP9:%.*]] = insertelement <4 x i32> splat (i32 -1), i32 [[C_PROMOTED_I]], i64 0
+; INTERLEAVE-NEXT: [[TMP9:%.*]] = insertelement <4 x i32> splat (i32 -1), i32 [[C_PROMOTED_I]], i32 0
; INTERLEAVE-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i32> poison, i32 [[TMP0]], i64 0
; INTERLEAVE-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i32> [[BROADCAST_SPLATINSERT]], <4 x i32> poison, <4 x i32> zeroinitializer
; INTERLEAVE-NEXT: br label [[VECTOR_BODY:%.*]]
@@ -4965,7 +4965,7 @@ define i32 @PR32419(i32 %a, i16 %b) {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[VECTOR_PH:%.*]]
; CHECK: vector.ph:
-; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[A:%.*]], i64 0
+; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[A:%.*]], i32 0
; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]
; CHECK: vector.body:
; CHECK-NEXT: [[INDEX:%.*]] = phi i32 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_UREM_CONTINUE2:%.*]] ]
@@ -5008,7 +5008,7 @@ define i32 @PR32419(i32 %a, i16 %b) {
; IND-NEXT: entry:
; IND-NEXT: br label [[VECTOR_PH:%.*]]
; IND: vector.ph:
-; IND-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[A:%.*]], i64 0
+; IND-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[A:%.*]], i32 0
; IND-NEXT: br label [[VECTOR_BODY:%.*]]
; IND: vector.body:
; IND-NEXT: [[INDEX:%.*]] = phi i32 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_UREM_CONTINUE2:%.*]] ]
@@ -5051,7 +5051,7 @@ define i32 @PR32419(i32 %a, i16 %b) {
; UNROLL-NEXT: entry:
; UNROLL-NEXT: br label [[VECTOR_PH:%.*]]
; UNROLL: vector.ph:
-; UNROLL-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[A:%.*]], i64 0
+; UNROLL-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[A:%.*]], i32 0
; UNROLL-NEXT: br label [[VECTOR_BODY:%.*]]
; UNROLL: vector.body:
; UNROLL-NEXT: [[INDEX:%.*]] = phi i32 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_UREM_CONTINUE7:%.*]] ]
@@ -5119,7 +5119,7 @@ define i32 @PR32419(i32 %a, i16 %b) {
; UNROLL-NO-IC-NEXT: entry:
; UNROLL-NO-IC-NEXT: br label [[VECTOR_PH:%.*]]
; UNROLL-NO-IC: vector.ph:
-; UNROLL-NO-IC-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[A:%.*]], i64 0
+; UNROLL-NO-IC-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[A:%.*]], i32 0
; UNROLL-NO-IC-NEXT: br label [[VECTOR_BODY:%.*]]
; UNROLL-NO-IC: vector.body:
; UNROLL-NO-IC-NEXT: [[INDEX:%.*]] = phi i32 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_UREM_CONTINUE7:%.*]] ]
@@ -5187,7 +5187,7 @@ define i32 @PR32419(i32 %a, i16 %b) {
; INTERLEAVE-NEXT: entry:
; INTERLEAVE-NEXT: br label [[VECTOR_PH:%.*]]
; INTERLEAVE: vector.ph:
-; INTERLEAVE-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[A:%.*]], i64 0
+; INTERLEAVE-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[A:%.*]], i32 0
; INTERLEAVE-NEXT: br label [[VECTOR_BODY:%.*]]
; INTERLEAVE: vector.body:
; INTERLEAVE-NEXT: [[INDEX:%.*]] = phi i32 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_UREM_CONTINUE15:%.*]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/interleaved-accesses-metadata.ll b/llvm/test/Transforms/LoopVectorize/interleaved-accesses-metadata.ll
index 3067970b929b9..dc52704d02bb9 100644
--- a/llvm/test/Transforms/LoopVectorize/interleaved-accesses-metadata.ll
+++ b/llvm/test/Transforms/LoopVectorize/interleaved-accesses-metadata.ll
@@ -25,16 +25,16 @@ define void @merge_tbaa_interleave_group(ptr nocapture readonly %p, ptr noalias
; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT_VEC4R]], ptr [[P]], i64 [[TMP1]], i32 0
; CHECK-NEXT: [[TMP4:%.*]] = load double, ptr [[TMP2]], align 8, !tbaa [[TBAA0:![0-9]+]]
; CHECK-NEXT: [[TMP5:%.*]] = load double, ptr [[TMP3]], align 8, !tbaa [[TBAA0]]
-; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x double> poison, double [[TMP4]], i64 0
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x double> [[TMP6]], double [[TMP5]], i64 1
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x double> poison, double [[TMP4]], i32 0
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x double> [[TMP6]], double [[TMP5]], i32 1
; CHECK-NEXT: [[TMP8:%.*]] = fmul <2 x double> [[TMP7]], splat (double 2.000000e+00)
; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds [20 x [[STRUCT_VEC2R:%.*]]], ptr [[CP]], i64 0, i64 [[INDEX]], i32 0
; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT_VEC4R]], ptr [[P]], i64 [[INDEX]], i32 1
; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT_VEC4R]], ptr [[P]], i64 [[TMP1]], i32 1
; CHECK-NEXT: [[TMP12:%.*]] = load double, ptr [[TMP10]], align 8, !tbaa [[TBAA5:![0-9]+]]
; CHECK-NEXT: [[TMP13:%.*]] = load double, ptr [[TMP11]], align 8, !tbaa [[TBAA5]]
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <2 x double> poison, double [[TMP12]], i64 0
-; CHECK-NEXT: [[TMP15:%.*]] = insertelement <2 x double> [[TMP14]], double [[TMP13]], i64 1
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <2 x double> poison, double [[TMP12]], i32 0
+; CHECK-NEXT: [[TMP15:%.*]] = insertelement <2 x double> [[TMP14]], double [[TMP13]], i32 1
; CHECK-NEXT: [[TMP16:%.*]] = fmul <2 x double> [[TMP15]], splat (double 3.000000e+00)
; CHECK-NEXT: [[TMP17:%.*]] = shufflevector <2 x double> [[TMP8]], <2 x double> [[TMP16]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
; CHECK-NEXT: [[INTERLEAVED_VEC:%.*]] = shufflevector <4 x double> [[TMP17]], <4 x double> poison, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
diff --git a/llvm/test/Transforms/LoopVectorize/interleaved-accesses-requiring-scev-predicates.ll b/llvm/test/Transforms/LoopVectorize/interleaved-accesses-requiring-scev-predicates.ll
index 5f52b29a00d98..16f598743a28e 100644
--- a/llvm/test/Transforms/LoopVectorize/interleaved-accesses-requiring-scev-predicates.ll
+++ b/llvm/test/Transforms/LoopVectorize/interleaved-accesses-requiring-scev-predicates.ll
@@ -142,10 +142,10 @@ define void @wrap_predicate_for_interleave_group_wraps_for_known_trip_count(ptr
; CHECK-NEXT: [[TMP11:%.*]] = load i32, ptr [[TMP7]], align 4
; CHECK-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP8]], align 4
; CHECK-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP9]], align 4
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> poison, i32 [[TMP10]], i64 0
-; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i64 1
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> [[TMP15]], i32 [[TMP12]], i64 2
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i32> [[TMP16]], i32 [[TMP13]], i64 3
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> poison, i32 [[TMP10]], i32 0
+; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i32 1
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> [[TMP15]], i32 [[TMP12]], i32 2
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i32> [[TMP16]], i32 [[TMP13]], i32 3
; CHECK-NEXT: [[TMP18:%.*]] = getelementptr inbounds nuw i32, ptr [[OUT]], i64 [[INDEX]]
; CHECK-NEXT: store <4 x i32> [[TMP17]], ptr [[TMP18]], align 4
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
diff --git a/llvm/test/Transforms/LoopVectorize/interleaved-accesses.ll b/llvm/test/Transforms/LoopVectorize/interleaved-accesses.ll
index 7de0f1a53b448..c320e73428c39 100644
--- a/llvm/test/Transforms/LoopVectorize/interleaved-accesses.ll
+++ b/llvm/test/Transforms/LoopVectorize/interleaved-accesses.ll
@@ -574,10 +574,10 @@ define void @load_gap_reverse(ptr noalias nocapture %P1, ptr noalias nocapture %
; CHECK-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
; CHECK-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP10]], align 8
; CHECK-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP11]], align 8
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i64 0
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP13]], i64 1
-; CHECK-NEXT: [[TMP30:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP14]], i64 2
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP30]], i64 [[TMP15]], i64 3
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i32 0
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP13]], i32 1
+; CHECK-NEXT: [[TMP30:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP14]], i32 2
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP30]], i64 [[TMP15]], i32 3
; CHECK-NEXT: [[TMP20:%.*]] = sub nsw <4 x i64> [[TMP19]], [[VEC_IND]]
; CHECK-NEXT: [[TMP21:%.*]] = extractelement <4 x i64> [[TMP3]], i64 0
; CHECK-NEXT: store i64 [[TMP21]], ptr [[TMP4]], align 8
diff --git a/llvm/test/Transforms/LoopVectorize/invariant-store-vectorization.ll b/llvm/test/Transforms/LoopVectorize/invariant-store-vectorization.ll
index 578cbb7959cff..c82f85e265e7a 100644
--- a/llvm/test/Transforms/LoopVectorize/invariant-store-vectorization.ll
+++ b/llvm/test/Transforms/LoopVectorize/invariant-store-vectorization.ll
@@ -388,7 +388,7 @@ define void @multiple_uniform_stores(ptr nocapture %var1, ptr nocapture readonly
; CHECK-NEXT: [[N_MOD_VF:%.*]] = and i64 [[TMP8]], 3
; CHECK-NEXT: [[N_VEC:%.*]] = sub i64 [[TMP8]], [[N_MOD_VF]]
; CHECK-NEXT: [[IND_END:%.*]] = add i64 [[TMP4]], [[N_VEC]]
-; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX5_PROMOTED]], i64 0
+; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[ARRAYIDX5_PROMOTED]], i32 0
; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]
; CHECK: vector.body:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/load-deref-pred-align.ll b/llvm/test/Transforms/LoopVectorize/load-deref-pred-align.ll
index bc5450eb79f4f..049039c096e24 100644
--- a/llvm/test/Transforms/LoopVectorize/load-deref-pred-align.ll
+++ b/llvm/test/Transforms/LoopVectorize/load-deref-pred-align.ll
@@ -475,8 +475,8 @@ define i16 @test_strided_access(i64 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds i16, ptr [[ALLOCA]], i64 [[TMP7]]
; CHECK-NEXT: [[TMP9:%.*]] = load i16, ptr [[TMP6]], align 2
; CHECK-NEXT: [[TMP10:%.*]] = load i16, ptr [[TMP8]], align 2
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i16> poison, i16 [[TMP9]], i64 0
-; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x i16> [[TMP11]], i16 [[TMP10]], i64 1
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i16> poison, i16 [[TMP9]], i32 0
+; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x i16> [[TMP11]], i16 [[TMP10]], i32 1
; CHECK-NEXT: [[PREDPHI:%.*]] = select <2 x i1> [[TMP3]], <2 x i16> [[TMP12]], <2 x i16> zeroinitializer
; CHECK-NEXT: [[TMP13]] = add <2 x i16> [[VEC_PHI]], [[PREDPHI]]
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 2
diff --git a/llvm/test/Transforms/LoopVectorize/load-deref-pred-neg-off.ll b/llvm/test/Transforms/LoopVectorize/load-deref-pred-neg-off.ll
index 90d796d26ac53..e40746a79474a 100644
--- a/llvm/test/Transforms/LoopVectorize/load-deref-pred-neg-off.ll
+++ b/llvm/test/Transforms/LoopVectorize/load-deref-pred-neg-off.ll
@@ -26,8 +26,8 @@ define i8 @test_negative_off(i16 %len, ptr %test_base) {
; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds i1, ptr [[TEST_BASE]], i16 [[TMP1]]
; CHECK-NEXT: [[TMP4:%.*]] = load i1, ptr [[TMP2]], align 1
; CHECK-NEXT: [[TMP5:%.*]] = load i1, ptr [[TMP3]], align 1
-; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i1> poison, i1 [[TMP4]], i64 0
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i1> [[TMP6]], i1 [[TMP5]], i64 1
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i1> poison, i1 [[TMP4]], i32 0
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i1> [[TMP6]], i1 [[TMP5]], i32 1
; CHECK-NEXT: br i1 [[TMP4]], label [[PRED_LOAD_IF:%.*]], label [[PRED_LOAD_CONTINUE:%.*]]
; CHECK: pred.load.if:
; CHECK-NEXT: [[TMP9:%.*]] = getelementptr i8, ptr [[ALLOCA]], i16 [[OFFSET_IDX]]
diff --git a/llvm/test/Transforms/LoopVectorize/narrow-interleave-groups-scalable-vf.ll b/llvm/test/Transforms/LoopVectorize/narrow-interleave-groups-scalable-vf.ll
index f55a988cc4190..d6005797577de 100644
--- a/llvm/test/Transforms/LoopVectorize/narrow-interleave-groups-scalable-vf.ll
+++ b/llvm/test/Transforms/LoopVectorize/narrow-interleave-groups-scalable-vf.ll
@@ -109,14 +109,14 @@ define void @scalablevf_distinct_args(ptr %dst.start, i8 %a0, i8 %a1, i8 %a2, i8
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: br label %[[VECTOR_PH:.*]]
; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x i8> poison, i8 [[A0]], i64 0
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i8> [[TMP13]], i8 [[A1]], i64 1
-; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i8> [[TMP14]], i8 [[A2]], i64 2
-; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x i8> [[TMP15]], i8 [[A3]], i64 3
-; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x i8> poison, i8 [[B0]], i64 0
-; CHECK-NEXT: [[TMP5:%.*]] = insertelement <4 x i8> [[TMP4]], i8 [[B1]], i64 1
-; CHECK-NEXT: [[TMP6:%.*]] = insertelement <4 x i8> [[TMP5]], i8 [[B2]], i64 2
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <4 x i8> [[TMP6]], i8 [[B3]], i64 3
+; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x i8> poison, i8 [[A0]], i32 0
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i8> [[TMP13]], i8 [[A1]], i32 1
+; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i8> [[TMP14]], i8 [[A2]], i32 2
+; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x i8> [[TMP15]], i8 [[A3]], i32 3
+; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x i8> poison, i8 [[B0]], i32 0
+; CHECK-NEXT: [[TMP5:%.*]] = insertelement <4 x i8> [[TMP4]], i8 [[B1]], i32 1
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <4 x i8> [[TMP5]], i8 [[B2]], i32 2
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <4 x i8> [[TMP6]], i8 [[B3]], i32 3
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/narrow-to-single-scalar.ll b/llvm/test/Transforms/LoopVectorize/narrow-to-single-scalar.ll
index adf02a9a7f1fd..c6bb9a47d32b5 100644
--- a/llvm/test/Transforms/LoopVectorize/narrow-to-single-scalar.ll
+++ b/llvm/test/Transforms/LoopVectorize/narrow-to-single-scalar.ll
@@ -313,10 +313,10 @@ define void @narrow_scatter_with_uniform_addr_to_scalar_unroll(ptr noalias %src,
; VF4IC1-NEXT: [[TMP24:%.*]] = load i16, ptr [[TMP20]], align 4
; VF4IC1-NEXT: [[TMP25:%.*]] = load i16, ptr [[TMP21]], align 4
; VF4IC1-NEXT: [[TMP16:%.*]] = load i16, ptr [[TMP22]], align 4
-; VF4IC1-NEXT: [[TMP17:%.*]] = insertelement <4 x i16> poison, i16 [[TMP23]], i64 0
-; VF4IC1-NEXT: [[TMP18:%.*]] = insertelement <4 x i16> [[TMP17]], i16 [[TMP24]], i64 1
-; VF4IC1-NEXT: [[TMP19:%.*]] = insertelement <4 x i16> [[TMP18]], i16 [[TMP25]], i64 2
-; VF4IC1-NEXT: [[BROADCAST_SPLAT:%.*]] = insertelement <4 x i16> [[TMP19]], i16 [[TMP16]], i64 3
+; VF4IC1-NEXT: [[TMP17:%.*]] = insertelement <4 x i16> poison, i16 [[TMP23]], i32 0
+; VF4IC1-NEXT: [[TMP18:%.*]] = insertelement <4 x i16> [[TMP17]], i16 [[TMP24]], i32 1
+; VF4IC1-NEXT: [[TMP19:%.*]] = insertelement <4 x i16> [[TMP18]], i16 [[TMP25]], i32 2
+; VF4IC1-NEXT: [[BROADCAST_SPLAT:%.*]] = insertelement <4 x i16> [[TMP19]], i16 [[TMP16]], i32 3
; VF4IC1-NEXT: [[TMP10:%.*]] = trunc <4 x i16> [[BROADCAST_SPLAT]] to <4 x i8>
; VF4IC1-NEXT: [[TMP11:%.*]] = extractelement <4 x i8> [[TMP10]], i64 3
; VF4IC1-NEXT: store i8 [[TMP11]], ptr [[DST2]], align 4
diff --git a/llvm/test/Transforms/LoopVectorize/outer_loop_contiguous.ll b/llvm/test/Transforms/LoopVectorize/outer_loop_contiguous.ll
index 56ac3f6fe523c..9a5a32eddf4c3 100644
--- a/llvm/test/Transforms/LoopVectorize/outer_loop_contiguous.ll
+++ b/llvm/test/Transforms/LoopVectorize/outer_loop_contiguous.ll
@@ -14,55 +14,71 @@ define void @scale_rows(ptr noalias %A, ptr noalias %scale, i64 %N, i64 %M) {
; CHECK-LABEL: define void @scale_rows(
; CHECK-SAME: ptr noalias [[A:%.*]], ptr noalias [[SCALE:%.*]], i64 [[N:%.*]], i64 [[M:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[CMP_OUTER:%.*]] = icmp sgt i64 [[N]], 0
+; CHECK-NEXT: br i1 [[CMP_OUTER]], label %[[OUTER_PH:.*]], [[EXIT:label %.*]]
+; CHECK: [[OUTER_PH]]:
+; CHECK-NEXT: [[CMP_INNER:%.*]] = icmp sgt i64 [[M]], 0
; CHECK-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[N]], 4
; CHECK-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP0:%.*]] = and i64 [[N]], 3
-; CHECK-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[TMP0]]
+; CHECK-NEXT: [[N_MOD_VF:%.*]] = and i64 [[N]], 3
+; CHECK-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
; CHECK-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i64> poison, i64 [[M]], i64 0
; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
-; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[OUTER_LATCH4:.*]] ]
-; CHECK-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[OUTER_LATCH4]] ]
-; CHECK-NEXT: [[WIDE_GEP:%.*]] = getelementptr inbounds float, ptr [[SCALE]], <4 x i64> [[VEC_IND]]
-; CHECK-NEXT: [[TMP1:%.*]] = extractelement <4 x ptr> [[WIDE_GEP]], i64 0
-; CHECK-NEXT: [[WIDE_LOAD:%.*]] = load <4 x float>, ptr [[TMP1]], align 4
-; CHECK-NEXT: [[TMP2:%.*]] = mul nsw <4 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
-; CHECK-NEXT: br label %[[INNER_BODY1:.*]]
-; CHECK: [[INNER_BODY1]]:
-; CHECK-NEXT: [[J2:%.*]] = phi <4 x i64> [ zeroinitializer, %[[VECTOR_BODY]] ], [ [[TMP5:%.*]], %[[INNER_BODY1]] ]
-; CHECK-NEXT: [[TMP3:%.*]] = add nsw <4 x i64> [[TMP2]], [[J2]]
-; CHECK-NEXT: [[WIDE_GEP3:%.*]] = getelementptr inbounds float, ptr [[A]], <4 x i64> [[TMP3]]
-; CHECK-NEXT: [[WIDE_MASKED_GATHER:%.*]] = call <4 x float> @llvm.masked.gather.v4f32.v4p0(<4 x ptr> align 4 [[WIDE_GEP3]], <4 x i1> splat (i1 true), <4 x float> poison)
-; CHECK-NEXT: [[TMP4:%.*]] = fmul <4 x float> [[WIDE_MASKED_GATHER]], [[WIDE_LOAD]]
-; CHECK-NEXT: call void @llvm.masked.scatter.v4f32.v4p0(<4 x float> [[TMP4]], <4 x ptr> align 4 [[WIDE_GEP3]], <4 x i1> splat (i1 true))
-; CHECK-NEXT: [[TMP5]] = add nuw nsw <4 x i64> [[J2]], splat (i64 1)
-; CHECK-NEXT: [[TMP6:%.*]] = icmp eq <4 x i64> [[TMP5]], [[BROADCAST_SPLAT]]
-; CHECK-NEXT: [[TMP7:%.*]] = extractelement <4 x i1> [[TMP6]], i64 0
-; CHECK-NEXT: br i1 [[TMP7]], label %[[OUTER_LATCH4]], label %[[INNER_BODY1]]
-; CHECK: [[OUTER_LATCH4]]:
+; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_LATCH:.*]] ]
+; CHECK-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[VECTOR_LATCH]] ]
+; CHECK-NEXT: [[TMP0:%.*]] = getelementptr inbounds float, ptr [[SCALE]], <4 x i64> [[VEC_IND]]
+; CHECK-NEXT: [[TMP10:%.*]] = extractelement <4 x ptr> [[TMP0]], i64 0
+; CHECK-NEXT: [[WIDE_MASKED_GATHER:%.*]] = load <4 x float>, ptr [[TMP10]], align 4
+; CHECK-NEXT: br i1 [[CMP_INNER]], label %[[INNER_PH1:.*]], label %[[VECTOR_LATCH]]
+; CHECK: [[INNER_PH1]]:
+; CHECK-NEXT: [[TMP1:%.*]] = mul nsw <4 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
+; CHECK-NEXT: br label %[[INNER_BODY2:.*]]
+; CHECK: [[INNER_BODY2]]:
+; CHECK-NEXT: [[TMP2:%.*]] = phi <4 x i64> [ zeroinitializer, %[[INNER_PH1]] ], [ [[TMP6:%.*]], %[[INNER_BODY2]] ]
+; CHECK-NEXT: [[TMP3:%.*]] = add nsw <4 x i64> [[TMP1]], [[TMP2]]
+; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds float, ptr [[A]], <4 x i64> [[TMP3]]
+; CHECK-NEXT: [[WIDE_MASKED_GATHER3:%.*]] = call <4 x float> @llvm.masked.gather.v4f32.v4p0(<4 x ptr> align 4 [[TMP4]], <4 x i1> splat (i1 true), <4 x float> poison)
+; CHECK-NEXT: [[TMP5:%.*]] = fmul <4 x float> [[WIDE_MASKED_GATHER3]], [[WIDE_MASKED_GATHER]]
+; CHECK-NEXT: call void @llvm.masked.scatter.v4f32.v4p0(<4 x float> [[TMP5]], <4 x ptr> align 4 [[TMP4]], <4 x i1> splat (i1 true))
+; CHECK-NEXT: [[TMP6]] = add nuw nsw <4 x i64> [[TMP2]], splat (i64 1)
+; CHECK-NEXT: [[TMP7:%.*]] = icmp eq <4 x i64> [[TMP6]], [[BROADCAST_SPLAT]]
+; CHECK-NEXT: [[TMP8:%.*]] = extractelement <4 x i1> [[TMP7]], i64 0
+; CHECK-NEXT: br i1 [[TMP8]], label %[[OUTER_LATCH_LOOPEXIT4:.*]], label %[[INNER_BODY2]]
+; CHECK: [[OUTER_LATCH_LOOPEXIT4]]:
+; CHECK-NEXT: br label %[[VECTOR_LATCH]]
+; CHECK: [[VECTOR_LATCH]]:
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
; CHECK-NEXT: [[VEC_IND_NEXT]] = add nuw nsw <4 x i64> [[VEC_IND]], splat (i64 4)
-; CHECK-NEXT: [[TMP8:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
-; CHECK-NEXT: br i1 [[TMP8]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]]
+; CHECK-NEXT: [[TMP9:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
+; CHECK-NEXT: br i1 [[TMP9]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]]
; CHECK: [[MIDDLE_BLOCK]]:
; CHECK-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[N]], [[N_VEC]]
-; CHECK-NEXT: br i1 [[CMP_N]], [[EXIT:label %.*]], label %[[SCALAR_PH]]
+; CHECK-NEXT: br i1 [[CMP_N]], [[EXIT_LOOPEXIT:label %.*]], label %[[SCALAR_PH]]
; CHECK: [[SCALAR_PH]]:
;
entry:
+ %cmp.outer = icmp sgt i64 %N, 0
+ br i1 %cmp.outer, label %outer.ph, label %exit
+
+outer.ph:
+ %cmp.inner = icmp sgt i64 %M, 0
br label %outer.header
outer.header:
- %i = phi i64 [ 0, %entry ], [ %i.next, %outer.latch ]
+ %i = phi i64 [ 0, %outer.ph ], [ %i.next, %outer.latch ]
%scale.ptr = getelementptr inbounds float, ptr %scale, i64 %i
%scale.val = load float, ptr %scale.ptr, align 4
+ br i1 %cmp.inner, label %inner.ph, label %outer.latch
+
+inner.ph:
%i.mul.M = mul nsw i64 %i, %M
br label %inner.body
inner.body:
- %j = phi i64 [ 0, %outer.header ], [ %j.next, %inner.body ]
+ %j = phi i64 [ 0, %inner.ph ], [ %j.next, %inner.body ]
%idx = add nsw i64 %i.mul.M, %j
%A.ptr = getelementptr inbounds float, ptr %A, i64 %idx
%A.val = load float, ptr %A.ptr, align 4
@@ -92,56 +108,72 @@ define void @stride2_float_load(ptr noalias %A, ptr noalias %scale, i64 %N, i64
; CHECK-LABEL: define void @stride2_float_load(
; CHECK-SAME: ptr noalias [[A:%.*]], ptr noalias [[SCALE:%.*]], i64 [[N:%.*]], i64 [[M:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[CMP_OUTER:%.*]] = icmp sgt i64 [[N]], 0
+; CHECK-NEXT: br i1 [[CMP_OUTER]], label %[[OUTER_PH:.*]], [[EXIT:label %.*]]
+; CHECK: [[OUTER_PH]]:
+; CHECK-NEXT: [[CMP_INNER:%.*]] = icmp sgt i64 [[M]], 0
; CHECK-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[N]], 4
; CHECK-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP0:%.*]] = and i64 [[N]], 3
-; CHECK-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[TMP0]]
+; CHECK-NEXT: [[N_MOD_VF:%.*]] = and i64 [[N]], 3
+; CHECK-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
; CHECK-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i64> poison, i64 [[M]], i64 0
; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
-; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[OUTER_LATCH5:.*]] ]
-; CHECK-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[OUTER_LATCH5]] ]
-; CHECK-NEXT: [[TMP1:%.*]] = shl nuw nsw <4 x i64> [[VEC_IND]], splat (i64 1)
-; CHECK-NEXT: [[WIDE_GEP:%.*]] = getelementptr inbounds float, ptr [[SCALE]], <4 x i64> [[TMP1]]
-; CHECK-NEXT: [[WIDE_MASKED_GATHER:%.*]] = call <4 x float> @llvm.masked.gather.v4f32.v4p0(<4 x ptr> align 4 [[WIDE_GEP]], <4 x i1> splat (i1 true), <4 x float> poison)
+; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_LATCH:.*]] ]
+; CHECK-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[VECTOR_LATCH]] ]
+; CHECK-NEXT: [[TMP0:%.*]] = shl nuw nsw <4 x i64> [[VEC_IND]], splat (i64 1)
+; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds float, ptr [[SCALE]], <4 x i64> [[TMP0]]
+; CHECK-NEXT: [[WIDE_MASKED_GATHER:%.*]] = call <4 x float> @llvm.masked.gather.v4f32.v4p0(<4 x ptr> align 4 [[TMP1]], <4 x i1> splat (i1 true), <4 x float> poison)
+; CHECK-NEXT: br i1 [[CMP_INNER]], label %[[INNER_PH1:.*]], label %[[VECTOR_LATCH]]
+; CHECK: [[INNER_PH1]]:
; CHECK-NEXT: [[TMP2:%.*]] = mul nsw <4 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
-; CHECK-NEXT: br label %[[INNER_BODY1:.*]]
-; CHECK: [[INNER_BODY1]]:
-; CHECK-NEXT: [[J2:%.*]] = phi <4 x i64> [ zeroinitializer, %[[VECTOR_BODY]] ], [ [[TMP5:%.*]], %[[INNER_BODY1]] ]
-; CHECK-NEXT: [[TMP3:%.*]] = add nsw <4 x i64> [[TMP2]], [[J2]]
-; CHECK-NEXT: [[WIDE_GEP3:%.*]] = getelementptr inbounds float, ptr [[A]], <4 x i64> [[TMP3]]
-; CHECK-NEXT: [[WIDE_MASKED_GATHER4:%.*]] = call <4 x float> @llvm.masked.gather.v4f32.v4p0(<4 x ptr> align 4 [[WIDE_GEP3]], <4 x i1> splat (i1 true), <4 x float> poison)
-; CHECK-NEXT: [[TMP4:%.*]] = fmul <4 x float> [[WIDE_MASKED_GATHER4]], [[WIDE_MASKED_GATHER]]
-; CHECK-NEXT: call void @llvm.masked.scatter.v4f32.v4p0(<4 x float> [[TMP4]], <4 x ptr> align 4 [[WIDE_GEP3]], <4 x i1> splat (i1 true))
-; CHECK-NEXT: [[TMP5]] = add nuw nsw <4 x i64> [[J2]], splat (i64 1)
-; CHECK-NEXT: [[TMP6:%.*]] = icmp eq <4 x i64> [[TMP5]], [[BROADCAST_SPLAT]]
-; CHECK-NEXT: [[TMP7:%.*]] = extractelement <4 x i1> [[TMP6]], i64 0
-; CHECK-NEXT: br i1 [[TMP7]], label %[[OUTER_LATCH5]], label %[[INNER_BODY1]]
-; CHECK: [[OUTER_LATCH5]]:
+; CHECK-NEXT: br label %[[INNER_BODY2:.*]]
+; CHECK: [[INNER_BODY2]]:
+; CHECK-NEXT: [[TMP3:%.*]] = phi <4 x i64> [ zeroinitializer, %[[INNER_PH1]] ], [ [[TMP7:%.*]], %[[INNER_BODY2]] ]
+; CHECK-NEXT: [[TMP4:%.*]] = add nsw <4 x i64> [[TMP2]], [[TMP3]]
+; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds float, ptr [[A]], <4 x i64> [[TMP4]]
+; CHECK-NEXT: [[WIDE_MASKED_GATHER3:%.*]] = call <4 x float> @llvm.masked.gather.v4f32.v4p0(<4 x ptr> align 4 [[TMP5]], <4 x i1> splat (i1 true), <4 x float> poison)
+; CHECK-NEXT: [[TMP6:%.*]] = fmul <4 x float> [[WIDE_MASKED_GATHER3]], [[WIDE_MASKED_GATHER]]
+; CHECK-NEXT: call void @llvm.masked.scatter.v4f32.v4p0(<4 x float> [[TMP6]], <4 x ptr> align 4 [[TMP5]], <4 x i1> splat (i1 true))
+; CHECK-NEXT: [[TMP7]] = add nuw nsw <4 x i64> [[TMP3]], splat (i64 1)
+; CHECK-NEXT: [[TMP8:%.*]] = icmp eq <4 x i64> [[TMP7]], [[BROADCAST_SPLAT]]
+; CHECK-NEXT: [[TMP9:%.*]] = extractelement <4 x i1> [[TMP8]], i64 0
+; CHECK-NEXT: br i1 [[TMP9]], label %[[OUTER_LATCH_LOOPEXIT4:.*]], label %[[INNER_BODY2]]
+; CHECK: [[OUTER_LATCH_LOOPEXIT4]]:
+; CHECK-NEXT: br label %[[VECTOR_LATCH]]
+; CHECK: [[VECTOR_LATCH]]:
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
; CHECK-NEXT: [[VEC_IND_NEXT]] = add nuw nsw <4 x i64> [[VEC_IND]], splat (i64 4)
-; CHECK-NEXT: [[TMP8:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
-; CHECK-NEXT: br i1 [[TMP8]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP4:![0-9]+]]
+; CHECK-NEXT: [[TMP10:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
+; CHECK-NEXT: br i1 [[TMP10]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP4:![0-9]+]]
; CHECK: [[MIDDLE_BLOCK]]:
; CHECK-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[N]], [[N_VEC]]
-; CHECK-NEXT: br i1 [[CMP_N]], [[EXIT:label %.*]], label %[[SCALAR_PH]]
+; CHECK-NEXT: br i1 [[CMP_N]], [[EXIT_LOOPEXIT:label %.*]], label %[[SCALAR_PH]]
; CHECK: [[SCALAR_PH]]:
;
entry:
+ %cmp.outer = icmp sgt i64 %N, 0
+ br i1 %cmp.outer, label %outer.ph, label %exit
+
+outer.ph:
+ %cmp.inner = icmp sgt i64 %M, 0
br label %outer.header
outer.header:
- %i = phi i64 [ 0, %entry ], [ %i.next, %outer.latch ]
+ %i = phi i64 [ 0, %outer.ph ], [ %i.next, %outer.latch ]
%i2 = shl nuw nsw i64 %i, 1
%scale.ptr = getelementptr inbounds float, ptr %scale, i64 %i2
%scale.val = load float, ptr %scale.ptr, align 4
+ br i1 %cmp.inner, label %inner.ph, label %outer.latch
+
+inner.ph:
%i.mul.M = mul nsw i64 %i, %M
br label %inner.body
inner.body:
- %j = phi i64 [ 0, %outer.header ], [ %j.next, %inner.body ]
+ %j = phi i64 [ 0, %inner.ph ], [ %j.next, %inner.body ]
%idx = add nsw i64 %i.mul.M, %j
%A.ptr = getelementptr inbounds float, ptr %A, i64 %idx
%A.val = load float, ptr %A.ptr, align 4
@@ -170,55 +202,71 @@ define void @stride1_double_load(ptr noalias %A, ptr noalias %scale, i64 %N, i64
; CHECK-LABEL: define void @stride1_double_load(
; CHECK-SAME: ptr noalias [[A:%.*]], ptr noalias [[SCALE:%.*]], i64 [[N:%.*]], i64 [[M:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[CMP_OUTER:%.*]] = icmp sgt i64 [[N]], 0
+; CHECK-NEXT: br i1 [[CMP_OUTER]], label %[[OUTER_PH:.*]], [[EXIT:label %.*]]
+; CHECK: [[OUTER_PH]]:
+; CHECK-NEXT: [[CMP_INNER:%.*]] = icmp sgt i64 [[M]], 0
; CHECK-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[N]], 4
; CHECK-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP0:%.*]] = and i64 [[N]], 3
-; CHECK-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[TMP0]]
+; CHECK-NEXT: [[N_MOD_VF:%.*]] = and i64 [[N]], 3
+; CHECK-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[N_MOD_VF]]
; CHECK-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i64> poison, i64 [[M]], i64 0
; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
-; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[OUTER_LATCH4:.*]] ]
-; CHECK-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[OUTER_LATCH4]] ]
-; CHECK-NEXT: [[WIDE_GEP:%.*]] = getelementptr inbounds double, ptr [[SCALE]], <4 x i64> [[VEC_IND]]
-; CHECK-NEXT: [[TMP1:%.*]] = extractelement <4 x ptr> [[WIDE_GEP]], i64 0
-; CHECK-NEXT: [[WIDE_LOAD:%.*]] = load <4 x double>, ptr [[TMP1]], align 8
-; CHECK-NEXT: [[TMP2:%.*]] = mul nsw <4 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
-; CHECK-NEXT: br label %[[INNER_BODY1:.*]]
-; CHECK: [[INNER_BODY1]]:
-; CHECK-NEXT: [[J2:%.*]] = phi <4 x i64> [ zeroinitializer, %[[VECTOR_BODY]] ], [ [[TMP5:%.*]], %[[INNER_BODY1]] ]
-; CHECK-NEXT: [[TMP3:%.*]] = add nsw <4 x i64> [[TMP2]], [[J2]]
-; CHECK-NEXT: [[WIDE_GEP3:%.*]] = getelementptr inbounds double, ptr [[A]], <4 x i64> [[TMP3]]
-; CHECK-NEXT: [[WIDE_MASKED_GATHER:%.*]] = call <4 x double> @llvm.masked.gather.v4f64.v4p0(<4 x ptr> align 8 [[WIDE_GEP3]], <4 x i1> splat (i1 true), <4 x double> poison)
-; CHECK-NEXT: [[TMP4:%.*]] = fmul <4 x double> [[WIDE_MASKED_GATHER]], [[WIDE_LOAD]]
-; CHECK-NEXT: call void @llvm.masked.scatter.v4f64.v4p0(<4 x double> [[TMP4]], <4 x ptr> align 8 [[WIDE_GEP3]], <4 x i1> splat (i1 true))
-; CHECK-NEXT: [[TMP5]] = add nuw nsw <4 x i64> [[J2]], splat (i64 1)
-; CHECK-NEXT: [[TMP6:%.*]] = icmp eq <4 x i64> [[TMP5]], [[BROADCAST_SPLAT]]
-; CHECK-NEXT: [[TMP7:%.*]] = extractelement <4 x i1> [[TMP6]], i64 0
-; CHECK-NEXT: br i1 [[TMP7]], label %[[OUTER_LATCH4]], label %[[INNER_BODY1]]
-; CHECK: [[OUTER_LATCH4]]:
+; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_LATCH:.*]] ]
+; CHECK-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[VECTOR_LATCH]] ]
+; CHECK-NEXT: [[TMP0:%.*]] = getelementptr inbounds double, ptr [[SCALE]], <4 x i64> [[VEC_IND]]
+; CHECK-NEXT: [[TMP10:%.*]] = extractelement <4 x ptr> [[TMP0]], i64 0
+; CHECK-NEXT: [[WIDE_MASKED_GATHER:%.*]] = load <4 x double>, ptr [[TMP10]], align 8
+; CHECK-NEXT: br i1 [[CMP_INNER]], label %[[INNER_PH1:.*]], label %[[VECTOR_LATCH]]
+; CHECK: [[INNER_PH1]]:
+; CHECK-NEXT: [[TMP1:%.*]] = mul nsw <4 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
+; CHECK-NEXT: br label %[[INNER_BODY2:.*]]
+; CHECK: [[INNER_BODY2]]:
+; CHECK-NEXT: [[TMP2:%.*]] = phi <4 x i64> [ zeroinitializer, %[[INNER_PH1]] ], [ [[TMP6:%.*]], %[[INNER_BODY2]] ]
+; CHECK-NEXT: [[TMP3:%.*]] = add nsw <4 x i64> [[TMP1]], [[TMP2]]
+; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds double, ptr [[A]], <4 x i64> [[TMP3]]
+; CHECK-NEXT: [[WIDE_MASKED_GATHER3:%.*]] = call <4 x double> @llvm.masked.gather.v4f64.v4p0(<4 x ptr> align 8 [[TMP4]], <4 x i1> splat (i1 true), <4 x double> poison)
+; CHECK-NEXT: [[TMP5:%.*]] = fmul <4 x double> [[WIDE_MASKED_GATHER3]], [[WIDE_MASKED_GATHER]]
+; CHECK-NEXT: call void @llvm.masked.scatter.v4f64.v4p0(<4 x double> [[TMP5]], <4 x ptr> align 8 [[TMP4]], <4 x i1> splat (i1 true))
+; CHECK-NEXT: [[TMP6]] = add nuw nsw <4 x i64> [[TMP2]], splat (i64 1)
+; CHECK-NEXT: [[TMP7:%.*]] = icmp eq <4 x i64> [[TMP6]], [[BROADCAST_SPLAT]]
+; CHECK-NEXT: [[TMP8:%.*]] = extractelement <4 x i1> [[TMP7]], i64 0
+; CHECK-NEXT: br i1 [[TMP8]], label %[[OUTER_LATCH_LOOPEXIT4:.*]], label %[[INNER_BODY2]]
+; CHECK: [[OUTER_LATCH_LOOPEXIT4]]:
+; CHECK-NEXT: br label %[[VECTOR_LATCH]]
+; CHECK: [[VECTOR_LATCH]]:
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
; CHECK-NEXT: [[VEC_IND_NEXT]] = add nuw nsw <4 x i64> [[VEC_IND]], splat (i64 4)
-; CHECK-NEXT: [[TMP8:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
-; CHECK-NEXT: br i1 [[TMP8]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP6:![0-9]+]]
+; CHECK-NEXT: [[TMP9:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
+; CHECK-NEXT: br i1 [[TMP9]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP6:![0-9]+]]
; CHECK: [[MIDDLE_BLOCK]]:
; CHECK-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[N]], [[N_VEC]]
-; CHECK-NEXT: br i1 [[CMP_N]], [[EXIT:label %.*]], label %[[SCALAR_PH]]
+; CHECK-NEXT: br i1 [[CMP_N]], [[EXIT_LOOPEXIT:label %.*]], label %[[SCALAR_PH]]
; CHECK: [[SCALAR_PH]]:
;
entry:
+ %cmp.outer = icmp sgt i64 %N, 0
+ br i1 %cmp.outer, label %outer.ph, label %exit
+
+outer.ph:
+ %cmp.inner = icmp sgt i64 %M, 0
br label %outer.header
outer.header:
- %i = phi i64 [ 0, %entry ], [ %i.next, %outer.latch ]
+ %i = phi i64 [ 0, %outer.ph ], [ %i.next, %outer.latch ]
%scale.ptr = getelementptr inbounds double, ptr %scale, i64 %i
%scale.val = load double, ptr %scale.ptr, align 8
+ br i1 %cmp.inner, label %inner.ph, label %outer.latch
+
+inner.ph:
%i.mul.M = mul nsw i64 %i, %M
br label %inner.body
inner.body:
- %j = phi i64 [ 0, %outer.header ], [ %j.next, %inner.body ]
+ %j = phi i64 [ 0, %inner.ph ], [ %j.next, %inner.body ]
%idx = add nsw i64 %i.mul.M, %j
%A.ptr = getelementptr inbounds double, ptr %A, i64 %idx
%A.val = load double, ptr %A.ptr, align 8
@@ -237,247 +285,6 @@ exit:
ret void
}
-; --- stride-1 i1 load and store (NOT contiguous) ---
-; for (i = 0; i < N; i++) {
-; bool b = flags[i];
-; for (j = 0; j < M; j++)
-; A[i*M+j] = b;
-; flags[i] = !b;
-; }
-;
-; flags[i] has stride 1 in units of i1, but i1 is bit-packed in vectors: 4
-; consecutive i1 scalars span 4 bytes, while a <4 x i1> access covers a single
-; byte.
-; FIXME: The accesses are widened to a packed <4 x i1> load and store, which
-; cover the wrong bytes. They should remain a gather and scatter.
-define void @stride1_i1_load_store(ptr noalias %A, ptr noalias %flags, i64 %N, i64 %M) {
-; CHECK-LABEL: define void @stride1_i1_load_store(
-; CHECK-SAME: ptr noalias [[A:%.*]], ptr noalias [[FLAGS:%.*]], i64 [[N:%.*]], i64 [[M:%.*]]) {
-; CHECK-NEXT: [[ENTRY:.*:]]
-; CHECK-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[N]], 4
-; CHECK-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
-; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP0:%.*]] = and i64 [[N]], 3
-; CHECK-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[TMP0]]
-; CHECK-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i64> poison, i64 [[M]], i64 0
-; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
-; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
-; CHECK: [[VECTOR_BODY]]:
-; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[OUTER_LATCH4:.*]] ]
-; CHECK-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[OUTER_LATCH4]] ]
-; CHECK-NEXT: [[WIDE_GEP:%.*]] = getelementptr inbounds i1, ptr [[FLAGS]], <4 x i64> [[VEC_IND]]
-; CHECK-NEXT: [[TMP1:%.*]] = extractelement <4 x ptr> [[WIDE_GEP]], i64 0
-; CHECK-NEXT: [[WIDE_LOAD:%.*]] = load <4 x i1>, ptr [[TMP1]], align 1
-; CHECK-NEXT: [[TMP2:%.*]] = mul nsw <4 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
-; CHECK-NEXT: [[TMP3:%.*]] = zext <4 x i1> [[WIDE_LOAD]] to <4 x i8>
-; CHECK-NEXT: br label %[[INNER_BODY1:.*]]
-; CHECK: [[INNER_BODY1]]:
-; CHECK-NEXT: [[J2:%.*]] = phi <4 x i64> [ zeroinitializer, %[[VECTOR_BODY]] ], [ [[TMP5:%.*]], %[[INNER_BODY1]] ]
-; CHECK-NEXT: [[TMP4:%.*]] = add nsw <4 x i64> [[TMP2]], [[J2]]
-; CHECK-NEXT: [[WIDE_GEP3:%.*]] = getelementptr inbounds i8, ptr [[A]], <4 x i64> [[TMP4]]
-; CHECK-NEXT: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> [[TMP3]], <4 x ptr> align 1 [[WIDE_GEP3]], <4 x i1> splat (i1 true))
-; CHECK-NEXT: [[TMP5]] = add nuw nsw <4 x i64> [[J2]], splat (i64 1)
-; CHECK-NEXT: [[TMP6:%.*]] = icmp eq <4 x i64> [[TMP5]], [[BROADCAST_SPLAT]]
-; CHECK-NEXT: [[TMP7:%.*]] = extractelement <4 x i1> [[TMP6]], i64 0
-; CHECK-NEXT: br i1 [[TMP7]], label %[[OUTER_LATCH4]], label %[[INNER_BODY1]]
-; CHECK: [[OUTER_LATCH4]]:
-; CHECK-NEXT: [[TMP8:%.*]] = xor <4 x i1> [[WIDE_LOAD]], splat (i1 true)
-; CHECK-NEXT: [[TMP9:%.*]] = extractelement <4 x ptr> [[WIDE_GEP]], i64 0
-; CHECK-NEXT: store <4 x i1> [[TMP8]], ptr [[TMP9]], align 1
-; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
-; CHECK-NEXT: [[VEC_IND_NEXT]] = add nuw nsw <4 x i64> [[VEC_IND]], splat (i64 4)
-; CHECK-NEXT: [[TMP10:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
-; CHECK-NEXT: br i1 [[TMP10]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP8:![0-9]+]]
-; CHECK: [[MIDDLE_BLOCK]]:
-; CHECK-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[N]], [[N_VEC]]
-; CHECK-NEXT: br i1 [[CMP_N]], [[EXIT:label %.*]], label %[[SCALAR_PH]]
-; CHECK: [[SCALAR_PH]]:
-;
-entry:
- br label %outer.header
-
-outer.header:
- %i = phi i64 [ 0, %entry ], [ %i.next, %outer.latch ]
- %flags.ptr = getelementptr inbounds i1, ptr %flags, i64 %i
- %flag = load i1, ptr %flags.ptr, align 1
- %i.mul.M = mul nsw i64 %i, %M
- %flag.ext = zext i1 %flag to i8
- br label %inner.body
-
-inner.body:
- %j = phi i64 [ 0, %outer.header ], [ %j.next, %inner.body ]
- %idx = add nsw i64 %i.mul.M, %j
- %A.ptr = getelementptr inbounds i8, ptr %A, i64 %idx
- store i8 %flag.ext, ptr %A.ptr, align 1
- %j.next = add nuw nsw i64 %j, 1
- %j.cmp = icmp eq i64 %j.next, %M
- br i1 %j.cmp, label %outer.latch, label %inner.body
-
-outer.latch:
- %flag.not = xor i1 %flag, true
- store i1 %flag.not, ptr %flags.ptr, align 1
- %i.next = add nuw nsw i64 %i, 1
- %i.cmp = icmp eq i64 %i.next, %N
- br i1 %i.cmp, label %exit, label %outer.header, !llvm.loop !0
-
-exit:
- ret void
-}
-
-; --- stride-1 i4 load and store (NOT contiguous) ---
-; Same as above with i4, which is also bit-packed in vectors: 4 consecutive i4
-; scalars span 4 bytes, while a <4 x i4> access covers 2 bytes.
-; FIXME: Same as above, the accesses are widened to a packed <4 x i4> load and
-; store.
-define void @stride1_i4_load_store(ptr noalias %A, ptr noalias %vals, i64 %N, i64 %M) {
-; CHECK-LABEL: define void @stride1_i4_load_store(
-; CHECK-SAME: ptr noalias [[A:%.*]], ptr noalias [[VALS:%.*]], i64 [[N:%.*]], i64 [[M:%.*]]) {
-; CHECK-NEXT: [[ENTRY:.*:]]
-; CHECK-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[N]], 4
-; CHECK-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
-; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP0:%.*]] = and i64 [[N]], 3
-; CHECK-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[TMP0]]
-; CHECK-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i64> poison, i64 [[M]], i64 0
-; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
-; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
-; CHECK: [[VECTOR_BODY]]:
-; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[OUTER_LATCH4:.*]] ]
-; CHECK-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[OUTER_LATCH4]] ]
-; CHECK-NEXT: [[WIDE_GEP:%.*]] = getelementptr inbounds i4, ptr [[VALS]], <4 x i64> [[VEC_IND]]
-; CHECK-NEXT: [[TMP1:%.*]] = extractelement <4 x ptr> [[WIDE_GEP]], i64 0
-; CHECK-NEXT: [[WIDE_LOAD:%.*]] = load <4 x i4>, ptr [[TMP1]], align 1
-; CHECK-NEXT: [[TMP2:%.*]] = mul nsw <4 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
-; CHECK-NEXT: [[TMP3:%.*]] = zext <4 x i4> [[WIDE_LOAD]] to <4 x i8>
-; CHECK-NEXT: br label %[[INNER_BODY1:.*]]
-; CHECK: [[INNER_BODY1]]:
-; CHECK-NEXT: [[J2:%.*]] = phi <4 x i64> [ zeroinitializer, %[[VECTOR_BODY]] ], [ [[TMP5:%.*]], %[[INNER_BODY1]] ]
-; CHECK-NEXT: [[TMP4:%.*]] = add nsw <4 x i64> [[TMP2]], [[J2]]
-; CHECK-NEXT: [[WIDE_GEP3:%.*]] = getelementptr inbounds i8, ptr [[A]], <4 x i64> [[TMP4]]
-; CHECK-NEXT: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> [[TMP3]], <4 x ptr> align 1 [[WIDE_GEP3]], <4 x i1> splat (i1 true))
-; CHECK-NEXT: [[TMP5]] = add nuw nsw <4 x i64> [[J2]], splat (i64 1)
-; CHECK-NEXT: [[TMP6:%.*]] = icmp eq <4 x i64> [[TMP5]], [[BROADCAST_SPLAT]]
-; CHECK-NEXT: [[TMP7:%.*]] = extractelement <4 x i1> [[TMP6]], i64 0
-; CHECK-NEXT: br i1 [[TMP7]], label %[[OUTER_LATCH4]], label %[[INNER_BODY1]]
-; CHECK: [[OUTER_LATCH4]]:
-; CHECK-NEXT: [[TMP8:%.*]] = add <4 x i4> [[WIDE_LOAD]], splat (i4 1)
-; CHECK-NEXT: [[TMP9:%.*]] = extractelement <4 x ptr> [[WIDE_GEP]], i64 0
-; CHECK-NEXT: store <4 x i4> [[TMP8]], ptr [[TMP9]], align 1
-; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
-; CHECK-NEXT: [[VEC_IND_NEXT]] = add nuw nsw <4 x i64> [[VEC_IND]], splat (i64 4)
-; CHECK-NEXT: [[TMP10:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
-; CHECK-NEXT: br i1 [[TMP10]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP10:![0-9]+]]
-; CHECK: [[MIDDLE_BLOCK]]:
-; CHECK-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[N]], [[N_VEC]]
-; CHECK-NEXT: br i1 [[CMP_N]], [[EXIT:label %.*]], label %[[SCALAR_PH]]
-; CHECK: [[SCALAR_PH]]:
-;
-entry:
- br label %outer.header
-
-outer.header:
- %i = phi i64 [ 0, %entry ], [ %i.next, %outer.latch ]
- %vals.ptr = getelementptr inbounds i4, ptr %vals, i64 %i
- %val = load i4, ptr %vals.ptr, align 1
- %i.mul.M = mul nsw i64 %i, %M
- %val.ext = zext i4 %val to i8
- br label %inner.body
-
-inner.body:
- %j = phi i64 [ 0, %outer.header ], [ %j.next, %inner.body ]
- %idx = add nsw i64 %i.mul.M, %j
- %A.ptr = getelementptr inbounds i8, ptr %A, i64 %idx
- store i8 %val.ext, ptr %A.ptr, align 1
- %j.next = add nuw nsw i64 %j, 1
- %j.cmp = icmp eq i64 %j.next, %M
- br i1 %j.cmp, label %outer.latch, label %inner.body
-
-outer.latch:
- %val.inc = add i4 %val, 1
- store i4 %val.inc, ptr %vals.ptr, align 1
- %i.next = add nuw nsw i64 %i, 1
- %i.cmp = icmp eq i64 %i.next, %N
- br i1 %i.cmp, label %exit, label %outer.header, !llvm.loop !0
-
-exit:
- ret void
-}
-
-; --- stride-1 i8 load and store ---
-; Same as above with i8, which is not bit-packed in vectors, so a <4 x i8>
-; access covers the same bytes as 4 consecutive i8 scalars.
-define void @stride1_i8_load_store(ptr noalias %A, ptr noalias %vals, i64 %N, i64 %M) {
-; CHECK-LABEL: define void @stride1_i8_load_store(
-; CHECK-SAME: ptr noalias [[A:%.*]], ptr noalias [[VALS:%.*]], i64 [[N:%.*]], i64 [[M:%.*]]) {
-; CHECK-NEXT: [[ENTRY:.*:]]
-; CHECK-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[N]], 4
-; CHECK-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
-; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP0:%.*]] = and i64 [[N]], 3
-; CHECK-NEXT: [[N_VEC:%.*]] = sub i64 [[N]], [[TMP0]]
-; CHECK-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i64> poison, i64 [[M]], i64 0
-; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
-; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
-; CHECK: [[VECTOR_BODY]]:
-; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[OUTER_LATCH4:.*]] ]
-; CHECK-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[OUTER_LATCH4]] ]
-; CHECK-NEXT: [[WIDE_GEP:%.*]] = getelementptr inbounds i8, ptr [[VALS]], <4 x i64> [[VEC_IND]]
-; CHECK-NEXT: [[TMP1:%.*]] = extractelement <4 x ptr> [[WIDE_GEP]], i64 0
-; CHECK-NEXT: [[WIDE_LOAD:%.*]] = load <4 x i8>, ptr [[TMP1]], align 1
-; CHECK-NEXT: [[TMP2:%.*]] = mul nsw <4 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
-; CHECK-NEXT: br label %[[INNER_BODY1:.*]]
-; CHECK: [[INNER_BODY1]]:
-; CHECK-NEXT: [[J2:%.*]] = phi <4 x i64> [ zeroinitializer, %[[VECTOR_BODY]] ], [ [[TMP4:%.*]], %[[INNER_BODY1]] ]
-; CHECK-NEXT: [[TMP3:%.*]] = add nsw <4 x i64> [[TMP2]], [[J2]]
-; CHECK-NEXT: [[WIDE_GEP3:%.*]] = getelementptr inbounds i8, ptr [[A]], <4 x i64> [[TMP3]]
-; CHECK-NEXT: call void @llvm.masked.scatter.v4i8.v4p0(<4 x i8> [[WIDE_LOAD]], <4 x ptr> align 1 [[WIDE_GEP3]], <4 x i1> splat (i1 true))
-; CHECK-NEXT: [[TMP4]] = add nuw nsw <4 x i64> [[J2]], splat (i64 1)
-; CHECK-NEXT: [[TMP5:%.*]] = icmp eq <4 x i64> [[TMP4]], [[BROADCAST_SPLAT]]
-; CHECK-NEXT: [[TMP6:%.*]] = extractelement <4 x i1> [[TMP5]], i64 0
-; CHECK-NEXT: br i1 [[TMP6]], label %[[OUTER_LATCH4]], label %[[INNER_BODY1]]
-; CHECK: [[OUTER_LATCH4]]:
-; CHECK-NEXT: [[TMP7:%.*]] = add <4 x i8> [[WIDE_LOAD]], splat (i8 1)
-; CHECK-NEXT: [[TMP8:%.*]] = extractelement <4 x ptr> [[WIDE_GEP]], i64 0
-; CHECK-NEXT: store <4 x i8> [[TMP7]], ptr [[TMP8]], align 1
-; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
-; CHECK-NEXT: [[VEC_IND_NEXT]] = add nuw nsw <4 x i64> [[VEC_IND]], splat (i64 4)
-; CHECK-NEXT: [[TMP9:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
-; CHECK-NEXT: br i1 [[TMP9]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP12:![0-9]+]]
-; CHECK: [[MIDDLE_BLOCK]]:
-; CHECK-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[N]], [[N_VEC]]
-; CHECK-NEXT: br i1 [[CMP_N]], [[EXIT:label %.*]], label %[[SCALAR_PH]]
-; CHECK: [[SCALAR_PH]]:
-;
-entry:
- br label %outer.header
-
-outer.header:
- %i = phi i64 [ 0, %entry ], [ %i.next, %outer.latch ]
- %vals.ptr = getelementptr inbounds i8, ptr %vals, i64 %i
- %val = load i8, ptr %vals.ptr, align 1
- %i.mul.M = mul nsw i64 %i, %M
- br label %inner.body
-
-inner.body:
- %j = phi i64 [ 0, %outer.header ], [ %j.next, %inner.body ]
- %idx = add nsw i64 %i.mul.M, %j
- %A.ptr = getelementptr inbounds i8, ptr %A, i64 %idx
- store i8 %val, ptr %A.ptr, align 1
- %j.next = add nuw nsw i64 %j, 1
- %j.cmp = icmp eq i64 %j.next, %M
- br i1 %j.cmp, label %outer.latch, label %inner.body
-
-outer.latch:
- %val.inc = add i8 %val, 1
- store i8 %val.inc, ptr %vals.ptr, align 1
- %i.next = add nuw nsw i64 %i, 1
- %i.cmp = icmp eq i64 %i.next, %N
- br i1 %i.cmp, label %exit, label %outer.header, !llvm.loop !0
-
-exit:
- ret void
-}
-
!0 = distinct !{!0, !1, !2}
!1 = !{!"llvm.loop.vectorize.width", i32 4}
!2 = !{!"llvm.loop.vectorize.enable"}
diff --git a/llvm/test/Transforms/LoopVectorize/phi-cost.ll b/llvm/test/Transforms/LoopVectorize/phi-cost.ll
index 929467d5ecc28..7f73bd891df71 100644
--- a/llvm/test/Transforms/LoopVectorize/phi-cost.ll
+++ b/llvm/test/Transforms/LoopVectorize/phi-cost.ll
@@ -184,7 +184,7 @@ define i32 @red_phi_0(i32 %start, ptr %src) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: br label %[[VECTOR_PH:.*]]
; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[START]], i64 0
+; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> zeroinitializer, i32 [[START]], i32 0
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/pr34681.ll b/llvm/test/Transforms/LoopVectorize/pr34681.ll
index d6d144f41a024..c958aa7740575 100644
--- a/llvm/test/Transforms/LoopVectorize/pr34681.ll
+++ b/llvm/test/Transforms/LoopVectorize/pr34681.ll
@@ -73,10 +73,10 @@ define i32 @foo1(i32 %N, ptr nocapture readnone %A, ptr nocapture readonly %B, i
; CHECK-NEXT: [[TMP21:%.*]] = load i16, ptr [[TMP15]], align 2
; CHECK-NEXT: [[TMP22:%.*]] = load i16, ptr [[TMP17]], align 2
; CHECK-NEXT: [[TMP23:%.*]] = load i16, ptr [[TMP19]], align 2
-; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i16> poison, i16 [[TMP20]], i64 0
-; CHECK-NEXT: [[TMP25:%.*]] = insertelement <4 x i16> [[TMP24]], i16 [[TMP21]], i64 1
-; CHECK-NEXT: [[TMP26:%.*]] = insertelement <4 x i16> [[TMP25]], i16 [[TMP22]], i64 2
-; CHECK-NEXT: [[TMP27:%.*]] = insertelement <4 x i16> [[TMP26]], i16 [[TMP23]], i64 3
+; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i16> poison, i16 [[TMP20]], i32 0
+; CHECK-NEXT: [[TMP25:%.*]] = insertelement <4 x i16> [[TMP24]], i16 [[TMP21]], i32 1
+; CHECK-NEXT: [[TMP26:%.*]] = insertelement <4 x i16> [[TMP25]], i16 [[TMP22]], i32 2
+; CHECK-NEXT: [[TMP27:%.*]] = insertelement <4 x i16> [[TMP26]], i16 [[TMP23]], i32 3
; CHECK-NEXT: [[TMP28:%.*]] = sext <4 x i16> [[TMP27]] to <4 x i32>
; CHECK-NEXT: [[TMP29]] = add <4 x i32> [[VEC_PHI]], [[TMP28]]
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i32 [[INDEX]], 4
@@ -178,10 +178,10 @@ define i32 @foo2(i16 zeroext %N, ptr nocapture readnone %A, ptr nocapture readon
; CHECK-NEXT: [[TMP18:%.*]] = load i16, ptr [[TMP12]], align 2
; CHECK-NEXT: [[TMP19:%.*]] = load i16, ptr [[TMP14]], align 2
; CHECK-NEXT: [[TMP20:%.*]] = load i16, ptr [[TMP16]], align 2
-; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i16> poison, i16 [[TMP17]], i64 0
-; CHECK-NEXT: [[TMP22:%.*]] = insertelement <4 x i16> [[TMP21]], i16 [[TMP18]], i64 1
-; CHECK-NEXT: [[TMP23:%.*]] = insertelement <4 x i16> [[TMP22]], i16 [[TMP19]], i64 2
-; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i16> [[TMP23]], i16 [[TMP20]], i64 3
+; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i16> poison, i16 [[TMP17]], i32 0
+; CHECK-NEXT: [[TMP22:%.*]] = insertelement <4 x i16> [[TMP21]], i16 [[TMP18]], i32 1
+; CHECK-NEXT: [[TMP23:%.*]] = insertelement <4 x i16> [[TMP22]], i16 [[TMP19]], i32 2
+; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i16> [[TMP23]], i16 [[TMP20]], i32 3
; CHECK-NEXT: [[TMP25:%.*]] = sext <4 x i16> [[TMP24]] to <4 x i32>
; CHECK-NEXT: [[TMP26]] = add <4 x i32> [[VEC_PHI]], [[TMP25]]
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i32 [[INDEX]], 4
diff --git a/llvm/test/Transforms/LoopVectorize/pr39417-optsize-scevchecks.ll b/llvm/test/Transforms/LoopVectorize/pr39417-optsize-scevchecks.ll
index 2f7024d2af63d..f750a953a0e55 100644
--- a/llvm/test/Transforms/LoopVectorize/pr39417-optsize-scevchecks.ll
+++ b/llvm/test/Transforms/LoopVectorize/pr39417-optsize-scevchecks.ll
@@ -70,10 +70,10 @@ define void @scev4stride1(ptr noalias nocapture %a, ptr noalias nocapture readon
; CHECK-NEXT: [[TMP14:%.*]] = load i32, ptr [[TMP8]], align 4
; CHECK-NEXT: [[TMP15:%.*]] = load i32, ptr [[TMP10]], align 4
; CHECK-NEXT: [[TMP16:%.*]] = load i32, ptr [[TMP12]], align 4
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i32> poison, i32 [[TMP13]], i64 0
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i32> [[TMP17]], i32 [[TMP14]], i64 1
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i32> [[TMP18]], i32 [[TMP15]], i64 2
-; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x i32> [[TMP19]], i32 [[TMP16]], i64 3
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i32> poison, i32 [[TMP13]], i32 0
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i32> [[TMP17]], i32 [[TMP14]], i32 1
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i32> [[TMP18]], i32 [[TMP15]], i32 2
+; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x i32> [[TMP19]], i32 [[TMP16]], i32 3
; CHECK-NEXT: [[TMP21:%.*]] = getelementptr inbounds i32, ptr [[A]], i32 [[INDEX]]
; CHECK-NEXT: store <4 x i32> [[TMP20]], ptr [[TMP21]], align 4
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i32 [[INDEX]], 4
diff --git a/llvm/test/Transforms/LoopVectorize/preserve-inbounds-gep-with-pointer-casts.ll b/llvm/test/Transforms/LoopVectorize/preserve-inbounds-gep-with-pointer-casts.ll
index 9a3e3461cb23b..48cdf384cf9eb 100644
--- a/llvm/test/Transforms/LoopVectorize/preserve-inbounds-gep-with-pointer-casts.ll
+++ b/llvm/test/Transforms/LoopVectorize/preserve-inbounds-gep-with-pointer-casts.ll
@@ -105,10 +105,10 @@ define void @addrspacecast_in_ptr_chain(ptr addrspace(1) %src, ptr noalias %dst)
; CHECK-NEXT: [[TMP14:%.*]] = load double, ptr [[TMP5]], align 8
; CHECK-NEXT: [[TMP6:%.*]] = extractelement <4 x ptr> [[TMP2]], i64 3
; CHECK-NEXT: [[TMP15:%.*]] = load double, ptr [[TMP6]], align 8
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x double> poison, double [[TMP12]], i64 0
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x double> [[TMP16]], double [[TMP13]], i64 1
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x double> [[TMP17]], double [[TMP14]], i64 2
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x double> [[TMP18]], double [[TMP15]], i64 3
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x double> poison, double [[TMP12]], i32 0
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x double> [[TMP16]], double [[TMP13]], i32 1
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x double> [[TMP17]], double [[TMP14]], i32 2
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x double> [[TMP18]], double [[TMP15]], i32 3
; CHECK-NEXT: [[TMP8:%.*]] = extractelement <4 x ptr> [[TMP7]], i64 0
; CHECK-NEXT: [[TMP20:%.*]] = load double, ptr [[TMP8]], align 8
; CHECK-NEXT: [[TMP9:%.*]] = extractelement <4 x ptr> [[TMP7]], i64 1
@@ -117,10 +117,10 @@ define void @addrspacecast_in_ptr_chain(ptr addrspace(1) %src, ptr noalias %dst)
; CHECK-NEXT: [[TMP22:%.*]] = load double, ptr [[TMP10]], align 8
; CHECK-NEXT: [[TMP11:%.*]] = extractelement <4 x ptr> [[TMP7]], i64 3
; CHECK-NEXT: [[TMP23:%.*]] = load double, ptr [[TMP11]], align 8
-; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x double> poison, double [[TMP20]], i64 0
-; CHECK-NEXT: [[TMP25:%.*]] = insertelement <4 x double> [[TMP24]], double [[TMP21]], i64 1
-; CHECK-NEXT: [[TMP26:%.*]] = insertelement <4 x double> [[TMP25]], double [[TMP22]], i64 2
-; CHECK-NEXT: [[TMP27:%.*]] = insertelement <4 x double> [[TMP26]], double [[TMP23]], i64 3
+; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x double> poison, double [[TMP20]], i32 0
+; CHECK-NEXT: [[TMP25:%.*]] = insertelement <4 x double> [[TMP24]], double [[TMP21]], i32 1
+; CHECK-NEXT: [[TMP26:%.*]] = insertelement <4 x double> [[TMP25]], double [[TMP22]], i32 2
+; CHECK-NEXT: [[TMP27:%.*]] = insertelement <4 x double> [[TMP26]], double [[TMP23]], i32 3
; CHECK-NEXT: [[TMP28:%.*]] = getelementptr inbounds double, ptr [[DST]], i64 [[INDEX]]
; CHECK-NEXT: [[TMP29:%.*]] = getelementptr inbounds double, ptr [[TMP28]], i64 4
; CHECK-NEXT: store <4 x double> [[TMP19]], ptr [[TMP28]], align 8
diff --git a/llvm/test/Transforms/LoopVectorize/reduction-inloop-pred.ll b/llvm/test/Transforms/LoopVectorize/reduction-inloop-pred.ll
index 4af6dc27732ab..e5902c7202676 100644
--- a/llvm/test/Transforms/LoopVectorize/reduction-inloop-pred.ll
+++ b/llvm/test/Transforms/LoopVectorize/reduction-inloop-pred.ll
@@ -672,7 +672,7 @@ define float @reduction_conditional(ptr %A, ptr %B, ptr %C, float %S) {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[VECTOR_PH:%.*]]
; CHECK: vector.ph:
-; CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x float> zeroinitializer, float [[S:%.*]], i64 0
+; CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x float> zeroinitializer, float [[S:%.*]], i32 0
; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]
; CHECK: vector.body:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/reduction-inloop.ll b/llvm/test/Transforms/LoopVectorize/reduction-inloop.ll
index 380ad66fcdbbd..585c1705cd1b2 100644
--- a/llvm/test/Transforms/LoopVectorize/reduction-inloop.ll
+++ b/llvm/test/Transforms/LoopVectorize/reduction-inloop.ll
@@ -1080,7 +1080,7 @@ define float @reduction_conditional(ptr %A, ptr %B, ptr %C, float %S) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: br label %[[VECTOR_PH:.*]]
; CHECK: [[VECTOR_PH]]:
-; CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x float> zeroinitializer, float [[S]], i64 0
+; CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x float> zeroinitializer, float [[S]], i32 0
; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK: [[VECTOR_BODY]]:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -1116,7 +1116,7 @@ define float @reduction_conditional(ptr %A, ptr %B, ptr %C, float %S) {
; CHECK-INTERLEAVED-NEXT: [[ENTRY:.*:]]
; CHECK-INTERLEAVED-NEXT: br label %[[VECTOR_PH:.*]]
; CHECK-INTERLEAVED: [[VECTOR_PH]]:
-; CHECK-INTERLEAVED-NEXT: [[TMP0:%.*]] = insertelement <4 x float> zeroinitializer, float [[S]], i64 0
+; CHECK-INTERLEAVED-NEXT: [[TMP0:%.*]] = insertelement <4 x float> zeroinitializer, float [[S]], i32 0
; CHECK-INTERLEAVED-NEXT: br label %[[VECTOR_BODY:.*]]
; CHECK-INTERLEAVED: [[VECTOR_BODY]]:
; CHECK-INTERLEAVED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
@@ -2278,10 +2278,10 @@ define i32 @predicated_or_dominates_reduction(ptr %b) {
; CHECK-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP6]], align 4
; CHECK-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP8]], align 4
; CHECK-NEXT: [[TMP14:%.*]] = load i32, ptr [[TMP10]], align 4
-; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> poison, i32 [[TMP11]], i64 0
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> [[TMP15]], i32 [[TMP12]], i64 1
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i32> [[TMP16]], i32 [[TMP13]], i64 2
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i32> [[TMP17]], i32 [[TMP14]], i64 3
+; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> poison, i32 [[TMP11]], i32 0
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> [[TMP15]], i32 [[TMP12]], i32 1
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i32> [[TMP16]], i32 [[TMP13]], i32 2
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i32> [[TMP17]], i32 [[TMP14]], i32 3
; CHECK-NEXT: [[TMP19:%.*]] = icmp eq <4 x i32> [[TMP18]], zeroinitializer
; CHECK-NEXT: [[TMP20:%.*]] = extractelement <4 x i1> [[TMP19]], i64 0
; CHECK-NEXT: br i1 [[TMP20]], label %[[PRED_LOAD_IF:.*]], label %[[PRED_LOAD_CONTINUE:.*]]
@@ -2363,18 +2363,18 @@ define i32 @predicated_or_dominates_reduction(ptr %b) {
; CHECK-INTERLEAVED-NEXT: [[TMP24:%.*]] = load i32, ptr [[TMP10]], align 4
; CHECK-INTERLEAVED-NEXT: [[TMP25:%.*]] = load i32, ptr [[TMP12]], align 4
; CHECK-INTERLEAVED-NEXT: [[TMP26:%.*]] = load i32, ptr [[TMP14]], align 4
-; CHECK-INTERLEAVED-NEXT: [[TMP27:%.*]] = insertelement <4 x i32> poison, i32 [[TMP23]], i64 0
-; CHECK-INTERLEAVED-NEXT: [[TMP21:%.*]] = insertelement <4 x i32> [[TMP27]], i32 [[TMP24]], i64 1
-; CHECK-INTERLEAVED-NEXT: [[TMP35:%.*]] = insertelement <4 x i32> [[TMP21]], i32 [[TMP25]], i64 2
-; CHECK-INTERLEAVED-NEXT: [[TMP30:%.*]] = insertelement <4 x i32> [[TMP35]], i32 [[TMP26]], i64 3
+; CHECK-INTERLEAVED-NEXT: [[TMP27:%.*]] = insertelement <4 x i32> poison, i32 [[TMP23]], i32 0
+; CHECK-INTERLEAVED-NEXT: [[TMP21:%.*]] = insertelement <4 x i32> [[TMP27]], i32 [[TMP24]], i32 1
+; CHECK-INTERLEAVED-NEXT: [[TMP35:%.*]] = insertelement <4 x i32> [[TMP21]], i32 [[TMP25]], i32 2
+; CHECK-INTERLEAVED-NEXT: [[TMP30:%.*]] = insertelement <4 x i32> [[TMP35]], i32 [[TMP26]], i32 3
; CHECK-INTERLEAVED-NEXT: [[TMP31:%.*]] = load i32, ptr [[TMP16]], align 4
; CHECK-INTERLEAVED-NEXT: [[TMP32:%.*]] = load i32, ptr [[TMP18]], align 4
; CHECK-INTERLEAVED-NEXT: [[TMP33:%.*]] = load i32, ptr [[TMP20]], align 4
; CHECK-INTERLEAVED-NEXT: [[TMP34:%.*]] = load i32, ptr [[TMP22]], align 4
-; CHECK-INTERLEAVED-NEXT: [[TMP28:%.*]] = insertelement <4 x i32> poison, i32 [[TMP31]], i64 0
-; CHECK-INTERLEAVED-NEXT: [[TMP29:%.*]] = insertelement <4 x i32> [[TMP28]], i32 [[TMP32]], i64 1
-; CHECK-INTERLEAVED-NEXT: [[TMP36:%.*]] = insertelement <4 x i32> [[TMP29]], i32 [[TMP33]], i64 2
-; CHECK-INTERLEAVED-NEXT: [[TMP38:%.*]] = insertelement <4 x i32> [[TMP36]], i32 [[TMP34]], i64 3
+; CHECK-INTERLEAVED-NEXT: [[TMP28:%.*]] = insertelement <4 x i32> poison, i32 [[TMP31]], i32 0
+; CHECK-INTERLEAVED-NEXT: [[TMP29:%.*]] = insertelement <4 x i32> [[TMP28]], i32 [[TMP32]], i32 1
+; CHECK-INTERLEAVED-NEXT: [[TMP36:%.*]] = insertelement <4 x i32> [[TMP29]], i32 [[TMP33]], i32 2
+; CHECK-INTERLEAVED-NEXT: [[TMP38:%.*]] = insertelement <4 x i32> [[TMP36]], i32 [[TMP34]], i32 3
; CHECK-INTERLEAVED-NEXT: [[TMP39:%.*]] = icmp eq <4 x i32> [[TMP30]], zeroinitializer
; CHECK-INTERLEAVED-NEXT: [[TMP40:%.*]] = icmp eq <4 x i32> [[TMP38]], zeroinitializer
; CHECK-INTERLEAVED-NEXT: [[TMP41:%.*]] = extractelement <4 x i1> [[TMP39]], i64 0
diff --git a/llvm/test/Transforms/LoopVectorize/reduction-small-size.ll b/llvm/test/Transforms/LoopVectorize/reduction-small-size.ll
index ed08731f92c3b..b38f372f74ed0 100644
--- a/llvm/test/Transforms/LoopVectorize/reduction-small-size.ll
+++ b/llvm/test/Transforms/LoopVectorize/reduction-small-size.ll
@@ -180,7 +180,7 @@ define i32 @PR35734(i32 %x, i32 %y) {
; CHECK-NEXT: [[N_MOD_VF:%.*]] = and i32 [[TMP8]], 3
; CHECK-NEXT: [[N_VEC:%.*]] = sub i32 [[TMP8]], [[N_MOD_VF]]
; CHECK-NEXT: [[IND_END:%.*]] = add i32 [[X]], [[N_VEC]]
-; CHECK-NEXT: [[TMP2:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[Y:%.*]], i64 0
+; CHECK-NEXT: [[TMP2:%.*]] = insertelement <4 x i32> zeroinitializer, i32 [[Y:%.*]], i32 0
; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]
; CHECK: vector.body:
; CHECK-NEXT: [[INDEX:%.*]] = phi i32 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/reduction-with-invariant-store.ll b/llvm/test/Transforms/LoopVectorize/reduction-with-invariant-store.ll
index 88bd76ec53912..68bbb553551d6 100644
--- a/llvm/test/Transforms/LoopVectorize/reduction-with-invariant-store.ll
+++ b/llvm/test/Transforms/LoopVectorize/reduction-with-invariant-store.ll
@@ -340,10 +340,10 @@ define void @reduc_store_inside_unrolled(ptr %dst, ptr readonly %src) {
; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP5]], align 4, !alias.scope [[META16]]
; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP6]], align 4, !alias.scope [[META16]]
; CHECK-NEXT: [[TMP11:%.*]] = load i32, ptr [[TMP7]], align 4, !alias.scope [[META16]]
-; CHECK-NEXT: [[TMP12:%.*]] = insertelement <4 x i32> poison, i32 [[TMP8]], i64 0
-; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x i32> [[TMP12]], i32 [[TMP9]], i64 1
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> [[TMP13]], i32 [[TMP10]], i64 2
-; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i64 3
+; CHECK-NEXT: [[TMP12:%.*]] = insertelement <4 x i32> poison, i32 [[TMP8]], i32 0
+; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x i32> [[TMP12]], i32 [[TMP9]], i32 1
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> [[TMP13]], i32 [[TMP10]], i32 2
+; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i32 3
; CHECK-NEXT: [[TMP16:%.*]] = add <4 x i32> [[TMP15]], [[VEC_PHI]]
; CHECK-NEXT: [[TMP17:%.*]] = or disjoint <4 x i64> [[VEC_IND]], splat (i64 1)
; CHECK-NEXT: [[TMP18:%.*]] = extractelement <4 x i64> [[TMP17]], i64 0
@@ -358,10 +358,10 @@ define void @reduc_store_inside_unrolled(ptr %dst, ptr readonly %src) {
; CHECK-NEXT: [[TMP27:%.*]] = load i32, ptr [[TMP23]], align 4, !alias.scope [[META16]]
; CHECK-NEXT: [[TMP28:%.*]] = load i32, ptr [[TMP38]], align 4, !alias.scope [[META16]]
; CHECK-NEXT: [[TMP29:%.*]] = load i32, ptr [[TMP25]], align 4, !alias.scope [[META16]]
-; CHECK-NEXT: [[TMP30:%.*]] = insertelement <4 x i32> poison, i32 [[TMP26]], i64 0
-; CHECK-NEXT: [[TMP31:%.*]] = insertelement <4 x i32> [[TMP30]], i32 [[TMP27]], i64 1
-; CHECK-NEXT: [[TMP32:%.*]] = insertelement <4 x i32> [[TMP31]], i32 [[TMP28]], i64 2
-; CHECK-NEXT: [[TMP33:%.*]] = insertelement <4 x i32> [[TMP32]], i32 [[TMP29]], i64 3
+; CHECK-NEXT: [[TMP30:%.*]] = insertelement <4 x i32> poison, i32 [[TMP26]], i32 0
+; CHECK-NEXT: [[TMP31:%.*]] = insertelement <4 x i32> [[TMP30]], i32 [[TMP27]], i32 1
+; CHECK-NEXT: [[TMP32:%.*]] = insertelement <4 x i32> [[TMP31]], i32 [[TMP28]], i32 2
+; CHECK-NEXT: [[TMP33:%.*]] = insertelement <4 x i32> [[TMP32]], i32 [[TMP29]], i32 3
; CHECK-NEXT: [[TMP34]] = add <4 x i32> [[TMP33]], [[TMP16]]
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
; CHECK-NEXT: [[VEC_IND_NEXT]] = add nuw nsw <4 x i64> [[VEC_IND]], splat (i64 8)
@@ -545,10 +545,10 @@ define void @reduc_store_middle_store_predicated(ptr %dst, ptr readonly %src) {
; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP5]], align 4, !alias.scope [[META23]]
; CHECK-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP6]], align 4, !alias.scope [[META23]]
; CHECK-NEXT: [[TMP11:%.*]] = load i32, ptr [[TMP7]], align 4, !alias.scope [[META23]]
-; CHECK-NEXT: [[TMP12:%.*]] = insertelement <4 x i32> poison, i32 [[TMP8]], i64 0
-; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x i32> [[TMP12]], i32 [[TMP9]], i64 1
-; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> [[TMP13]], i32 [[TMP10]], i64 2
-; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i64 3
+; CHECK-NEXT: [[TMP12:%.*]] = insertelement <4 x i32> poison, i32 [[TMP8]], i32 0
+; CHECK-NEXT: [[TMP13:%.*]] = insertelement <4 x i32> [[TMP12]], i32 [[TMP9]], i32 1
+; CHECK-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> [[TMP13]], i32 [[TMP10]], i32 2
+; CHECK-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i32 3
; CHECK-NEXT: [[TMP16:%.*]] = add <4 x i32> [[TMP15]], [[VEC_PHI]]
; CHECK-NEXT: [[TMP17:%.*]] = or disjoint <4 x i64> [[VEC_IND]], splat (i64 1)
; CHECK-NEXT: [[TMP18:%.*]] = extractelement <4 x i64> [[TMP17]], i64 0
@@ -563,10 +563,10 @@ define void @reduc_store_middle_store_predicated(ptr %dst, ptr readonly %src) {
; CHECK-NEXT: [[TMP27:%.*]] = load i32, ptr [[TMP23]], align 4, !alias.scope [[META23]]
; CHECK-NEXT: [[TMP28:%.*]] = load i32, ptr [[TMP38]], align 4, !alias.scope [[META23]]
; CHECK-NEXT: [[TMP29:%.*]] = load i32, ptr [[TMP25]], align 4, !alias.scope [[META23]]
-; CHECK-NEXT: [[TMP30:%.*]] = insertelement <4 x i32> poison, i32 [[TMP26]], i64 0
-; CHECK-NEXT: [[TMP31:%.*]] = insertelement <4 x i32> [[TMP30]], i32 [[TMP27]], i64 1
-; CHECK-NEXT: [[TMP32:%.*]] = insertelement <4 x i32> [[TMP31]], i32 [[TMP28]], i64 2
-; CHECK-NEXT: [[TMP33:%.*]] = insertelement <4 x i32> [[TMP32]], i32 [[TMP29]], i64 3
+; CHECK-NEXT: [[TMP30:%.*]] = insertelement <4 x i32> poison, i32 [[TMP26]], i32 0
+; CHECK-NEXT: [[TMP31:%.*]] = insertelement <4 x i32> [[TMP30]], i32 [[TMP27]], i32 1
+; CHECK-NEXT: [[TMP32:%.*]] = insertelement <4 x i32> [[TMP31]], i32 [[TMP28]], i32 2
+; CHECK-NEXT: [[TMP33:%.*]] = insertelement <4 x i32> [[TMP32]], i32 [[TMP29]], i32 3
; CHECK-NEXT: [[TMP34]] = add <4 x i32> [[TMP33]], [[TMP16]]
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
; CHECK-NEXT: [[VEC_IND_NEXT]] = add nuw nsw <4 x i64> [[VEC_IND]], splat (i64 8)
diff --git a/llvm/test/Transforms/LoopVectorize/reduction.ll b/llvm/test/Transforms/LoopVectorize/reduction.ll
index 3f7f79b14d956..4a186e5479f13 100644
--- a/llvm/test/Transforms/LoopVectorize/reduction.ll
+++ b/llvm/test/Transforms/LoopVectorize/reduction.ll
@@ -760,7 +760,7 @@ define float @reduction_conditional(ptr %A, ptr %B, ptr %C, float %S) {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[VECTOR_PH:%.*]]
; CHECK: vector.ph:
-; CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x float> zeroinitializer, float [[S]], i64 0
+; CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x float> zeroinitializer, float [[S]], i32 0
; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]
; CHECK: vector.body:
; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
diff --git a/llvm/test/Transforms/LoopVectorize/replicate-region-branch-weights-merged-mem-ops.ll b/llvm/test/Transforms/LoopVectorize/replicate-region-branch-weights-merged-mem-ops.ll
index 74b42cecb554e..2eccc4b142c88 100644
--- a/llvm/test/Transforms/LoopVectorize/replicate-region-branch-weights-merged-mem-ops.ll
+++ b/llvm/test/Transforms/LoopVectorize/replicate-region-branch-weights-merged-mem-ops.ll
@@ -44,10 +44,10 @@ define void @hoist_loads_no_prof_on_merged_load(ptr %dst, ptr %src, ptr %cond, i
; CHECK-NEXT: [[TMP15:%.*]] = load i32, ptr [[TMP10]], align 4, !alias.scope [[META4]]
; CHECK-NEXT: [[TMP16:%.*]] = load i32, ptr [[TMP11]], align 4, !alias.scope [[META4]]
; CHECK-NEXT: [[TMP17:%.*]] = load i32, ptr [[TMP12]], align 4, !alias.scope [[META4]]
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i32> poison, i32 [[TMP14]], i64 0
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i32> [[TMP18]], i32 [[TMP15]], i64 1
-; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x i32> [[TMP19]], i32 [[TMP16]], i64 2
-; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i32> [[TMP20]], i32 [[TMP17]], i64 3
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i32> poison, i32 [[TMP14]], i32 0
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i32> [[TMP18]], i32 [[TMP15]], i32 1
+; CHECK-NEXT: [[TMP20:%.*]] = insertelement <4 x i32> [[TMP19]], i32 [[TMP16]], i32 2
+; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i32> [[TMP20]], i32 [[TMP17]], i32 3
; CHECK-NEXT: [[TMP22:%.*]] = add <4 x i32> [[TMP21]], splat (i32 1)
; CHECK-NEXT: [[PREDPHI:%.*]] = select <4 x i1> [[TMP8]], <4 x i32> [[TMP21]], <4 x i32> [[TMP22]]
; CHECK-NEXT: store <4 x i32> [[PREDPHI]], ptr [[TMP13]], align 4, !alias.scope [[META6:![0-9]+]], !noalias [[META8:![0-9]+]]
@@ -162,10 +162,10 @@ define void @sink_stores_no_prof_on_merged_store(ptr %dst, ptr %src, ptr %cond,
; CHECK-NEXT: [[TMP18:%.*]] = load i32, ptr [[TMP10]], align 4, !alias.scope [[META22]]
; CHECK-NEXT: [[TMP19:%.*]] = load i32, ptr [[TMP11]], align 4, !alias.scope [[META22]]
; CHECK-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP12]], align 4, !alias.scope [[META22]]
-; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i32> poison, i32 [[TMP17]], i64 0
-; CHECK-NEXT: [[TMP22:%.*]] = insertelement <4 x i32> [[TMP21]], i32 [[TMP18]], i64 1
-; CHECK-NEXT: [[TMP23:%.*]] = insertelement <4 x i32> [[TMP22]], i32 [[TMP19]], i64 2
-; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> [[TMP23]], i32 [[TMP20]], i64 3
+; CHECK-NEXT: [[TMP21:%.*]] = insertelement <4 x i32> poison, i32 [[TMP17]], i32 0
+; CHECK-NEXT: [[TMP22:%.*]] = insertelement <4 x i32> [[TMP21]], i32 [[TMP18]], i32 1
+; CHECK-NEXT: [[TMP23:%.*]] = insertelement <4 x i32> [[TMP22]], i32 [[TMP19]], i32 2
+; CHECK-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> [[TMP23]], i32 [[TMP20]], i32 3
; CHECK-NEXT: [[TMP25:%.*]] = sub <4 x i32> [[TMP24]], splat (i32 5)
; CHECK-NEXT: [[TMP26:%.*]] = add <4 x i32> [[TMP24]], splat (i32 10)
; CHECK-NEXT: [[TMP27:%.*]] = select <4 x i1> [[TMP8]], <4 x i32> [[TMP25]], <4 x i32> [[TMP26]]
diff --git a/llvm/test/Transforms/LoopVectorize/runtime-check-small-bounded-ranges.ll b/llvm/test/Transforms/LoopVectorize/runtime-check-small-bounded-ranges.ll
index 33748cd8ab38e..c934276171bb1 100644
--- a/llvm/test/Transforms/LoopVectorize/runtime-check-small-bounded-ranges.ll
+++ b/llvm/test/Transforms/LoopVectorize/runtime-check-small-bounded-ranges.ll
@@ -904,10 +904,10 @@ define i32 @scale_mismatch_rejected(ptr %A, i32 %N) {
; CHECK-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP7]], align 4
; CHECK-NEXT: [[TMP14:%.*]] = load i32, ptr [[TMP9]], align 4
; CHECK-NEXT: [[TMP15:%.*]] = load i32, ptr [[TMP11]], align 4
-; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> poison, i32 [[TMP12]], i64 0
-; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i32> [[TMP16]], i32 [[TMP13]], i64 1
-; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i32> [[TMP17]], i32 [[TMP14]], i64 2
-; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i32> [[TMP18]], i32 [[TMP15]], i64 3
+; CHECK-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> poison, i32 [[TMP12]], i32 0
+; CHECK-NEXT: [[TMP17:%.*]] = insertelement <4 x i32> [[TMP16]], i32 [[TMP13]], i32 1
+; CHECK-NEXT: [[TMP18:%.*]] = insertelement <4 x i32> [[TMP17]], i32 [[TMP14]], i32 2
+; CHECK-NEXT: [[TMP19:%.*]] = insertelement <4 x i32> [[TMP18]], i32 [[TMP15]], i32 3
; CHECK-NEXT: [[TMP20]] = add <4 x i32> [[VEC_PHI]], [[TMP19]]
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i32 [[INDEX]], 4
; CHECK-NEXT: [[VEC_IND_NEXT]] = add nuw nsw <4 x i32> [[VEC_IND]], splat (i32 4)
diff --git a/llvm/test/Transforms/LoopVectorize/scalable-reduction-inloop.ll b/llvm/test/Transforms/LoopVectorize/scalable-reduction-inloop.ll
index 389218c5699bc..fc2aa55226b1d 100644
--- a/llvm/test/Transforms/LoopVectorize/scalable-reduction-inloop.ll
+++ b/llvm/test/Transforms/LoopVectorize/scalable-reduction-inloop.ll
@@ -18,7 +18,7 @@ define i8 @reduction_add_trunc(ptr noalias nocapture %A) {
; CHECK-NEXT: br label [[VECTOR_BODY:%.*]]
; CHECK: vector.body:
; CHECK-NEXT: [[INDEX:%.*]] = phi i32 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
-; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x i32> [ insertelement (<vscale x 8 x i32> zeroinitializer, i32 255, i64 0), [[VECTOR_PH]] ], [ [[TMP34:%.*]], [[VECTOR_BODY]] ]
+; CHECK-NEXT: [[VEC_PHI:%.*]] = phi <vscale x 8 x i32> [ insertelement (<vscale x 8 x i32> zeroinitializer, i32 255, i32 0), [[VECTOR_PH]] ], [ [[TMP34:%.*]], [[VECTOR_BODY]] ]
; CHECK-NEXT: [[VEC_PHI1:%.*]] = phi <vscale x 8 x i32> [ zeroinitializer, [[VECTOR_PH]] ], [ [[TMP36:%.*]], [[VECTOR_BODY]] ]
; CHECK-NEXT: [[TMP14:%.*]] = and <vscale x 8 x i32> [[VEC_PHI]], splat (i32 255)
; CHECK-NEXT: [[TMP15:%.*]] = and <vscale x 8 x i32> [[VEC_PHI1]], splat (i32 255)
diff --git a/llvm/test/Transforms/LoopVectorize/single-value-blend-phis.ll b/llvm/test/Transforms/LoopVectorize/single-value-blend-phis.ll
index 6bd259c189c0c..dd060ab5de799 100644
--- a/llvm/test/Transforms/LoopVectorize/single-value-blend-phis.ll
+++ b/llvm/test/Transforms/LoopVectorize/single-value-blend-phis.ll
@@ -147,8 +147,8 @@ define void @multiple_incoming_phi_with_blend_mask(i64 %a, ptr noalias %dst) {
; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds [32 x i16], ptr @src, i16 0, i16 [[TMP4]]
; CHECK-NEXT: [[TMP6:%.*]] = load i16, ptr [[TMP3]], align 1
; CHECK-NEXT: [[TMP7:%.*]] = load i16, ptr [[TMP5]], align 1
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i16> poison, i16 [[TMP6]], i64 0
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i16> [[TMP8]], i16 [[TMP7]], i64 1
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i16> poison, i16 [[TMP6]], i32 0
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i16> [[TMP8]], i16 [[TMP7]], i32 1
; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds i16, ptr [[DST:%.*]], i64 [[INDEX]]
; CHECK-NEXT: store <2 x i16> [[TMP9]], ptr [[TMP10]], align 2
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 2
diff --git a/llvm/test/Transforms/LoopVectorize/uniform-args-call-variants.ll b/llvm/test/Transforms/LoopVectorize/uniform-args-call-variants.ll
index 2b4f566da4ead..58eb7d1d5cf21 100644
--- a/llvm/test/Transforms/LoopVectorize/uniform-args-call-variants.ll
+++ b/llvm/test/Transforms/LoopVectorize/uniform-args-call-variants.ll
@@ -81,8 +81,8 @@ define void @test_uniform_not_invariant(ptr noalias %dst, ptr readonly %src, i64
; CHECK-NEXT: [[TMP4:%.*]] = call double @foo(double [[TMP3]], i64 [[INDEX]]) #[[ATTR0]]
; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x double> [[WIDE_LOAD]], i64 1
; CHECK-NEXT: [[TMP6:%.*]] = call double @foo(double [[TMP5]], i64 [[TMP1]]) #[[ATTR0]]
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x double> poison, double [[TMP4]], i64 0
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x double> [[TMP7]], double [[TMP6]], i64 1
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x double> poison, double [[TMP4]], i32 0
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x double> [[TMP7]], double [[TMP6]], i32 1
; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds double, ptr [[DST]], i64 [[INDEX]]
; CHECK-NEXT: store <2 x double> [[TMP8]], ptr [[TMP9]], align 8
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 2
diff --git a/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1.ll b/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1.ll
index 16ca130871455..673b2ad5b60f2 100644
--- a/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1.ll
+++ b/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1.ll
@@ -106,8 +106,8 @@ define void @ld_div3_step1_start0_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP3]]
; CHECK-NEXT: [[TMP5:%.*]] = load i64, ptr [[TMP2]], align 8
; CHECK-NEXT: [[TMP6:%.*]] = load i64, ptr [[TMP4]], align 8
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i64> poison, i64 [[TMP5]], i64 0
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i64> [[TMP7]], i64 [[TMP6]], i64 1
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i64> poison, i64 [[TMP5]], i32 0
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i64> [[TMP7]], i64 [[TMP6]], i32 1
; CHECK-NEXT: [[TMP9:%.*]] = add nsw <2 x i64> [[TMP8]], splat (i64 42)
; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[INDEX]]
; CHECK-NEXT: store <2 x i64> [[TMP9]], ptr [[TMP10]], align 8
@@ -157,8 +157,8 @@ define void @ld_div1_step2_start0_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP5]]
; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr [[TMP4]], align 8
; CHECK-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP6]], align 8
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i64 0
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i64 1
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i32 0
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i32 1
; CHECK-NEXT: [[TMP11:%.*]] = add nsw <2 x i64> [[TMP10]], splat (i64 42)
; CHECK-NEXT: [[TMP12:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -259,8 +259,8 @@ define void @ld_div3_step2_start0_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP5]]
; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr [[TMP4]], align 8
; CHECK-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP6]], align 8
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i64 0
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i64 1
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i32 0
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i32 1
; CHECK-NEXT: [[TMP11:%.*]] = add nsw <2 x i64> [[TMP10]], splat (i64 42)
; CHECK-NEXT: [[TMP12:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -314,8 +314,8 @@ define void @ld_div1_step3_start0_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP5]]
; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr [[TMP4]], align 8
; CHECK-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP6]], align 8
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i64 0
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i64 1
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i32 0
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i32 1
; CHECK-NEXT: [[TMP11:%.*]] = add nsw <2 x i64> [[TMP10]], splat (i64 42)
; CHECK-NEXT: [[TMP12:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -368,8 +368,8 @@ define void @ld_div2_step3_start0_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP5]]
; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr [[TMP4]], align 8
; CHECK-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP6]], align 8
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i64 0
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i64 1
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i32 0
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i32 1
; CHECK-NEXT: [[TMP11:%.*]] = add nsw <2 x i64> [[TMP10]], splat (i64 42)
; CHECK-NEXT: [[TMP12:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -508,8 +508,8 @@ define void @ld_div2_step1_start1_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP4]]
; CHECK-NEXT: [[TMP6:%.*]] = load i64, ptr [[TMP3]], align 8
; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr [[TMP5]], align 8
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i64> poison, i64 [[TMP6]], i64 0
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> [[TMP8]], i64 [[TMP7]], i64 1
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i64> poison, i64 [[TMP6]], i32 0
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> [[TMP8]], i64 [[TMP7]], i32 1
; CHECK-NEXT: [[TMP10:%.*]] = add nsw <2 x i64> [[TMP9]], splat (i64 42)
; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; CHECK-NEXT: store <2 x i64> [[TMP10]], ptr [[TMP11]], align 8
@@ -557,8 +557,8 @@ define void @ld_div3_step1_start1_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP4]]
; CHECK-NEXT: [[TMP6:%.*]] = load i64, ptr [[TMP3]], align 8
; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr [[TMP5]], align 8
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i64> poison, i64 [[TMP6]], i64 0
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> [[TMP8]], i64 [[TMP7]], i64 1
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i64> poison, i64 [[TMP6]], i32 0
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> [[TMP8]], i64 [[TMP7]], i32 1
; CHECK-NEXT: [[TMP10:%.*]] = add nsw <2 x i64> [[TMP9]], splat (i64 42)
; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; CHECK-NEXT: store <2 x i64> [[TMP10]], ptr [[TMP11]], align 8
@@ -608,8 +608,8 @@ define void @ld_div1_step2_start1_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP6]]
; CHECK-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP5]], align 8
; CHECK-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP7]], align 8
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i64 0
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i64 1
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i32 0
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i32 1
; CHECK-NEXT: [[TMP12:%.*]] = add nsw <2 x i64> [[TMP11]], splat (i64 42)
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -710,8 +710,8 @@ define void @ld_div3_step2_start1_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP6]]
; CHECK-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP5]], align 8
; CHECK-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP7]], align 8
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i64 0
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i64 1
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i32 0
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i32 1
; CHECK-NEXT: [[TMP12:%.*]] = add nsw <2 x i64> [[TMP11]], splat (i64 42)
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -765,8 +765,8 @@ define void @ld_div1_step3_start1_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP6]]
; CHECK-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP5]], align 8
; CHECK-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP7]], align 8
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i64 0
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i64 1
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i32 0
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i32 1
; CHECK-NEXT: [[TMP12:%.*]] = add nsw <2 x i64> [[TMP11]], splat (i64 42)
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -820,8 +820,8 @@ define void @ld_div2_step3_start1_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP6]]
; CHECK-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP5]], align 8
; CHECK-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP7]], align 8
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i64 0
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i64 1
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i32 0
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i32 1
; CHECK-NEXT: [[TMP12:%.*]] = add nsw <2 x i64> [[TMP11]], splat (i64 42)
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
diff --git a/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1_and.ll b/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1_and.ll
index a17620d595f54..f0d0ff39d6994 100644
--- a/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1_and.ll
+++ b/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1_and.ll
@@ -105,8 +105,8 @@ define void @ld_and_neg3_step1_start0_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP3]]
; CHECK-NEXT: [[TMP5:%.*]] = load i64, ptr [[TMP2]], align 8
; CHECK-NEXT: [[TMP6:%.*]] = load i64, ptr [[TMP4]], align 8
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i64> poison, i64 [[TMP5]], i64 0
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i64> [[TMP7]], i64 [[TMP6]], i64 1
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i64> poison, i64 [[TMP5]], i32 0
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i64> [[TMP7]], i64 [[TMP6]], i32 1
; CHECK-NEXT: [[TMP9:%.*]] = add nsw <2 x i64> [[TMP8]], splat (i64 42)
; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[INDEX]]
; CHECK-NEXT: store <2 x i64> [[TMP9]], ptr [[TMP10]], align 8
@@ -152,8 +152,8 @@ define void @ld_and_neg1_step2_start0_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP4:%.*]] = load i64, ptr [[TMP2]], align 8
; CHECK-NEXT: [[TMP5:%.*]] = load i64, ptr [[TMP3]], align 8
-; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i64> poison, i64 [[TMP4]], i64 0
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i64> [[TMP6]], i64 [[TMP5]], i64 1
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i64> poison, i64 [[TMP4]], i32 0
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i64> [[TMP6]], i64 [[TMP5]], i32 1
; CHECK-NEXT: [[TMP8:%.*]] = add nsw <2 x i64> [[TMP7]], splat (i64 42)
; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -247,8 +247,8 @@ define void @ld_and_neg1_step3_start0_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP4:%.*]] = load i64, ptr [[TMP2]], align 8
; CHECK-NEXT: [[TMP5:%.*]] = load i64, ptr [[TMP3]], align 8
-; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i64> poison, i64 [[TMP4]], i64 0
-; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i64> [[TMP6]], i64 [[TMP5]], i64 1
+; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i64> poison, i64 [[TMP4]], i32 0
+; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x i64> [[TMP6]], i64 [[TMP5]], i32 1
; CHECK-NEXT: [[TMP8:%.*]] = add nsw <2 x i64> [[TMP7]], splat (i64 42)
; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -300,8 +300,8 @@ define void @ld_and_neg2_step3_start0_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP5]]
; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr [[TMP4]], align 8
; CHECK-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP6]], align 8
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i64 0
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i64 1
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i32 0
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i32 1
; CHECK-NEXT: [[TMP11:%.*]] = add nsw <2 x i64> [[TMP10]], splat (i64 42)
; CHECK-NEXT: [[TMP12:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -353,8 +353,8 @@ define void @ld_and_neg2_step1_start1_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP4]]
; CHECK-NEXT: [[TMP6:%.*]] = load i64, ptr [[TMP3]], align 8
; CHECK-NEXT: [[TMP7:%.*]] = load i64, ptr [[TMP5]], align 8
-; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i64> poison, i64 [[TMP6]], i64 0
-; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> [[TMP8]], i64 [[TMP7]], i64 1
+; CHECK-NEXT: [[TMP8:%.*]] = insertelement <2 x i64> poison, i64 [[TMP6]], i32 0
+; CHECK-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> [[TMP8]], i64 [[TMP7]], i32 1
; CHECK-NEXT: [[TMP10:%.*]] = add nsw <2 x i64> [[TMP9]], splat (i64 42)
; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; CHECK-NEXT: store <2 x i64> [[TMP10]], ptr [[TMP11]], align 8
@@ -404,8 +404,8 @@ define void @ld_and_neg2_step2_start1_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP6]]
; CHECK-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP5]], align 8
; CHECK-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP7]], align 8
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i64 0
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i64 1
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i32 0
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i32 1
; CHECK-NEXT: [[TMP12:%.*]] = add nsw <2 x i64> [[TMP11]], splat (i64 42)
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -459,8 +459,8 @@ define void @ld_and_neg2_step3_start1_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP6]]
; CHECK-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP5]], align 8
; CHECK-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP7]], align 8
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i64 0
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i64 1
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i32 0
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i32 1
; CHECK-NEXT: [[TMP12:%.*]] = add nsw <2 x i64> [[TMP11]], splat (i64 42)
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -514,8 +514,8 @@ define void @ld_and_neg3_step3_start1_ind1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP6]]
; CHECK-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP5]], align 8
; CHECK-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP7]], align 8
-; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i64 0
-; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i64 1
+; CHECK-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i32 0
+; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i32 1
; CHECK-NEXT: [[TMP12:%.*]] = add nsw <2 x i64> [[TMP11]], splat (i64 42)
; CHECK-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; CHECK-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
diff --git a/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1_div_urem.ll b/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1_div_urem.ll
index 3f40db5179407..051ed7fd38ae6 100644
--- a/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1_div_urem.ll
+++ b/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1_div_urem.ll
@@ -41,14 +41,14 @@ define void @ld_div2_urem3_1(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP23:%.*]] = load i64, ptr [[TMP13]], align 8
; CHECK-NEXT: [[TMP24:%.*]] = load i64, ptr [[TMP15]], align 8
; CHECK-NEXT: [[TMP25:%.*]] = load i64, ptr [[TMP17]], align 8
-; CHECK-NEXT: [[TMP26:%.*]] = insertelement <8 x i64> poison, i64 [[TMP18]], i64 0
-; CHECK-NEXT: [[TMP27:%.*]] = insertelement <8 x i64> [[TMP26]], i64 [[TMP19]], i64 1
-; CHECK-NEXT: [[TMP28:%.*]] = insertelement <8 x i64> [[TMP27]], i64 [[TMP20]], i64 2
-; CHECK-NEXT: [[TMP29:%.*]] = insertelement <8 x i64> [[TMP28]], i64 [[TMP21]], i64 3
-; CHECK-NEXT: [[TMP30:%.*]] = insertelement <8 x i64> [[TMP29]], i64 [[TMP22]], i64 4
-; CHECK-NEXT: [[TMP31:%.*]] = insertelement <8 x i64> [[TMP30]], i64 [[TMP23]], i64 5
-; CHECK-NEXT: [[TMP32:%.*]] = insertelement <8 x i64> [[TMP31]], i64 [[TMP24]], i64 6
-; CHECK-NEXT: [[TMP33:%.*]] = insertelement <8 x i64> [[TMP32]], i64 [[TMP25]], i64 7
+; CHECK-NEXT: [[TMP26:%.*]] = insertelement <8 x i64> poison, i64 [[TMP18]], i32 0
+; CHECK-NEXT: [[TMP27:%.*]] = insertelement <8 x i64> [[TMP26]], i64 [[TMP19]], i32 1
+; CHECK-NEXT: [[TMP28:%.*]] = insertelement <8 x i64> [[TMP27]], i64 [[TMP20]], i32 2
+; CHECK-NEXT: [[TMP29:%.*]] = insertelement <8 x i64> [[TMP28]], i64 [[TMP21]], i32 3
+; CHECK-NEXT: [[TMP30:%.*]] = insertelement <8 x i64> [[TMP29]], i64 [[TMP22]], i32 4
+; CHECK-NEXT: [[TMP31:%.*]] = insertelement <8 x i64> [[TMP30]], i64 [[TMP23]], i32 5
+; CHECK-NEXT: [[TMP32:%.*]] = insertelement <8 x i64> [[TMP31]], i64 [[TMP24]], i32 6
+; CHECK-NEXT: [[TMP33:%.*]] = insertelement <8 x i64> [[TMP32]], i64 [[TMP25]], i32 7
; CHECK-NEXT: [[TMP34:%.*]] = add nsw <8 x i64> [[TMP33]], splat (i64 42)
; CHECK-NEXT: [[TMP35:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[INDEX]]
; CHECK-NEXT: store <8 x i64> [[TMP34]], ptr [[TMP35]], align 8
@@ -117,14 +117,14 @@ define void @ld_div2_urem3_2(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP24:%.*]] = load i64, ptr [[TMP14]], align 8
; CHECK-NEXT: [[TMP25:%.*]] = load i64, ptr [[TMP16]], align 8
; CHECK-NEXT: [[TMP26:%.*]] = load i64, ptr [[TMP18]], align 8
-; CHECK-NEXT: [[TMP27:%.*]] = insertelement <8 x i64> poison, i64 [[TMP19]], i64 0
-; CHECK-NEXT: [[TMP28:%.*]] = insertelement <8 x i64> [[TMP27]], i64 [[TMP20]], i64 1
-; CHECK-NEXT: [[TMP29:%.*]] = insertelement <8 x i64> [[TMP28]], i64 [[TMP21]], i64 2
-; CHECK-NEXT: [[TMP30:%.*]] = insertelement <8 x i64> [[TMP29]], i64 [[TMP22]], i64 3
-; CHECK-NEXT: [[TMP31:%.*]] = insertelement <8 x i64> [[TMP30]], i64 [[TMP23]], i64 4
-; CHECK-NEXT: [[TMP32:%.*]] = insertelement <8 x i64> [[TMP31]], i64 [[TMP24]], i64 5
-; CHECK-NEXT: [[TMP33:%.*]] = insertelement <8 x i64> [[TMP32]], i64 [[TMP25]], i64 6
-; CHECK-NEXT: [[TMP34:%.*]] = insertelement <8 x i64> [[TMP33]], i64 [[TMP26]], i64 7
+; CHECK-NEXT: [[TMP27:%.*]] = insertelement <8 x i64> poison, i64 [[TMP19]], i32 0
+; CHECK-NEXT: [[TMP28:%.*]] = insertelement <8 x i64> [[TMP27]], i64 [[TMP20]], i32 1
+; CHECK-NEXT: [[TMP29:%.*]] = insertelement <8 x i64> [[TMP28]], i64 [[TMP21]], i32 2
+; CHECK-NEXT: [[TMP30:%.*]] = insertelement <8 x i64> [[TMP29]], i64 [[TMP22]], i32 3
+; CHECK-NEXT: [[TMP31:%.*]] = insertelement <8 x i64> [[TMP30]], i64 [[TMP23]], i32 4
+; CHECK-NEXT: [[TMP32:%.*]] = insertelement <8 x i64> [[TMP31]], i64 [[TMP24]], i32 5
+; CHECK-NEXT: [[TMP33:%.*]] = insertelement <8 x i64> [[TMP32]], i64 [[TMP25]], i32 6
+; CHECK-NEXT: [[TMP34:%.*]] = insertelement <8 x i64> [[TMP33]], i64 [[TMP26]], i32 7
; CHECK-NEXT: [[TMP35:%.*]] = add nsw <8 x i64> [[TMP34]], splat (i64 42)
; CHECK-NEXT: [[TMP36:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[INDEX]]
; CHECK-NEXT: store <8 x i64> [[TMP35]], ptr [[TMP36]], align 8
@@ -191,14 +191,14 @@ define void @ld_div4(ptr noalias %A, ptr noalias %B) {
; CHECK-NEXT: [[TMP22:%.*]] = load i64, ptr [[TMP12]], align 8
; CHECK-NEXT: [[TMP23:%.*]] = load i64, ptr [[TMP14]], align 8
; CHECK-NEXT: [[TMP24:%.*]] = load i64, ptr [[TMP16]], align 8
-; CHECK-NEXT: [[TMP25:%.*]] = insertelement <8 x i64> poison, i64 [[TMP17]], i64 0
-; CHECK-NEXT: [[TMP26:%.*]] = insertelement <8 x i64> [[TMP25]], i64 [[TMP18]], i64 1
-; CHECK-NEXT: [[TMP27:%.*]] = insertelement <8 x i64> [[TMP26]], i64 [[TMP19]], i64 2
-; CHECK-NEXT: [[TMP28:%.*]] = insertelement <8 x i64> [[TMP27]], i64 [[TMP20]], i64 3
-; CHECK-NEXT: [[TMP29:%.*]] = insertelement <8 x i64> [[TMP28]], i64 [[TMP21]], i64 4
-; CHECK-NEXT: [[TMP30:%.*]] = insertelement <8 x i64> [[TMP29]], i64 [[TMP22]], i64 5
-; CHECK-NEXT: [[TMP31:%.*]] = insertelement <8 x i64> [[TMP30]], i64 [[TMP23]], i64 6
-; CHECK-NEXT: [[TMP32:%.*]] = insertelement <8 x i64> [[TMP31]], i64 [[TMP24]], i64 7
+; CHECK-NEXT: [[TMP25:%.*]] = insertelement <8 x i64> poison, i64 [[TMP17]], i32 0
+; CHECK-NEXT: [[TMP26:%.*]] = insertelement <8 x i64> [[TMP25]], i64 [[TMP18]], i32 1
+; CHECK-NEXT: [[TMP27:%.*]] = insertelement <8 x i64> [[TMP26]], i64 [[TMP19]], i32 2
+; CHECK-NEXT: [[TMP28:%.*]] = insertelement <8 x i64> [[TMP27]], i64 [[TMP20]], i32 3
+; CHECK-NEXT: [[TMP29:%.*]] = insertelement <8 x i64> [[TMP28]], i64 [[TMP21]], i32 4
+; CHECK-NEXT: [[TMP30:%.*]] = insertelement <8 x i64> [[TMP29]], i64 [[TMP22]], i32 5
+; CHECK-NEXT: [[TMP31:%.*]] = insertelement <8 x i64> [[TMP30]], i64 [[TMP23]], i32 6
+; CHECK-NEXT: [[TMP32:%.*]] = insertelement <8 x i64> [[TMP31]], i64 [[TMP24]], i32 7
; CHECK-NEXT: [[TMP33:%.*]] = add nsw <8 x i64> [[TMP32]], splat (i64 42)
; CHECK-NEXT: [[TMP34:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[INDEX]]
; CHECK-NEXT: store <8 x i64> [[TMP33]], ptr [[TMP34]], align 8
@@ -306,14 +306,14 @@ define void @ld_div2_ld_scevunknown_nonuniform(ptr %src.a, ptr noalias %src.b, p
; CHECK-NEXT: [[TMP20:%.*]] = load i64, ptr [[TMP12]], align 4
; CHECK-NEXT: [[TMP21:%.*]] = load i64, ptr [[TMP13]], align 4
; CHECK-NEXT: [[TMP22:%.*]] = load i64, ptr [[TMP14]], align 4
-; CHECK-NEXT: [[TMP23:%.*]] = insertelement <8 x i64> poison, i64 [[TMP15]], i64 0
-; CHECK-NEXT: [[TMP24:%.*]] = insertelement <8 x i64> [[TMP23]], i64 [[TMP16]], i64 1
-; CHECK-NEXT: [[TMP25:%.*]] = insertelement <8 x i64> [[TMP24]], i64 [[TMP17]], i64 2
-; CHECK-NEXT: [[TMP26:%.*]] = insertelement <8 x i64> [[TMP25]], i64 [[TMP18]], i64 3
-; CHECK-NEXT: [[TMP27:%.*]] = insertelement <8 x i64> [[TMP26]], i64 [[TMP19]], i64 4
-; CHECK-NEXT: [[TMP28:%.*]] = insertelement <8 x i64> [[TMP27]], i64 [[TMP20]], i64 5
-; CHECK-NEXT: [[TMP29:%.*]] = insertelement <8 x i64> [[TMP28]], i64 [[TMP21]], i64 6
-; CHECK-NEXT: [[TMP30:%.*]] = insertelement <8 x i64> [[TMP29]], i64 [[TMP22]], i64 7
+; CHECK-NEXT: [[TMP23:%.*]] = insertelement <8 x i64> poison, i64 [[TMP15]], i32 0
+; CHECK-NEXT: [[TMP24:%.*]] = insertelement <8 x i64> [[TMP23]], i64 [[TMP16]], i32 1
+; CHECK-NEXT: [[TMP25:%.*]] = insertelement <8 x i64> [[TMP24]], i64 [[TMP17]], i32 2
+; CHECK-NEXT: [[TMP26:%.*]] = insertelement <8 x i64> [[TMP25]], i64 [[TMP18]], i32 3
+; CHECK-NEXT: [[TMP27:%.*]] = insertelement <8 x i64> [[TMP26]], i64 [[TMP19]], i32 4
+; CHECK-NEXT: [[TMP28:%.*]] = insertelement <8 x i64> [[TMP27]], i64 [[TMP20]], i32 5
+; CHECK-NEXT: [[TMP29:%.*]] = insertelement <8 x i64> [[TMP28]], i64 [[TMP21]], i32 6
+; CHECK-NEXT: [[TMP30:%.*]] = insertelement <8 x i64> [[TMP29]], i64 [[TMP22]], i32 7
; CHECK-NEXT: [[TMP31:%.*]] = lshr <8 x i64> [[TMP30]], splat (i64 1)
; CHECK-NEXT: [[TMP32:%.*]] = extractelement <8 x i64> [[TMP31]], i64 0
; CHECK-NEXT: [[TMP33:%.*]] = getelementptr i32, ptr [[SRC_B]], i64 [[TMP32]]
@@ -339,14 +339,14 @@ define void @ld_div2_ld_scevunknown_nonuniform(ptr %src.a, ptr noalias %src.b, p
; CHECK-NEXT: [[TMP53:%.*]] = load i32, ptr [[TMP43]], align 4
; CHECK-NEXT: [[TMP54:%.*]] = load i32, ptr [[TMP45]], align 4
; CHECK-NEXT: [[TMP55:%.*]] = load i32, ptr [[TMP47]], align 4
-; CHECK-NEXT: [[TMP56:%.*]] = insertelement <8 x i32> poison, i32 [[TMP48]], i64 0
-; CHECK-NEXT: [[TMP57:%.*]] = insertelement <8 x i32> [[TMP56]], i32 [[TMP49]], i64 1
-; CHECK-NEXT: [[TMP58:%.*]] = insertelement <8 x i32> [[TMP57]], i32 [[TMP50]], i64 2
-; CHECK-NEXT: [[TMP59:%.*]] = insertelement <8 x i32> [[TMP58]], i32 [[TMP51]], i64 3
-; CHECK-NEXT: [[TMP60:%.*]] = insertelement <8 x i32> [[TMP59]], i32 [[TMP52]], i64 4
-; CHECK-NEXT: [[TMP61:%.*]] = insertelement <8 x i32> [[TMP60]], i32 [[TMP53]], i64 5
-; CHECK-NEXT: [[TMP62:%.*]] = insertelement <8 x i32> [[TMP61]], i32 [[TMP54]], i64 6
-; CHECK-NEXT: [[TMP63:%.*]] = insertelement <8 x i32> [[TMP62]], i32 [[TMP55]], i64 7
+; CHECK-NEXT: [[TMP56:%.*]] = insertelement <8 x i32> poison, i32 [[TMP48]], i32 0
+; CHECK-NEXT: [[TMP57:%.*]] = insertelement <8 x i32> [[TMP56]], i32 [[TMP49]], i32 1
+; CHECK-NEXT: [[TMP58:%.*]] = insertelement <8 x i32> [[TMP57]], i32 [[TMP50]], i32 2
+; CHECK-NEXT: [[TMP59:%.*]] = insertelement <8 x i32> [[TMP58]], i32 [[TMP51]], i32 3
+; CHECK-NEXT: [[TMP60:%.*]] = insertelement <8 x i32> [[TMP59]], i32 [[TMP52]], i32 4
+; CHECK-NEXT: [[TMP61:%.*]] = insertelement <8 x i32> [[TMP60]], i32 [[TMP53]], i32 5
+; CHECK-NEXT: [[TMP62:%.*]] = insertelement <8 x i32> [[TMP61]], i32 [[TMP54]], i32 6
+; CHECK-NEXT: [[TMP63:%.*]] = insertelement <8 x i32> [[TMP62]], i32 [[TMP55]], i32 7
; CHECK-NEXT: [[TMP64:%.*]] = getelementptr i32, ptr [[DST]], i64 [[INDEX]]
; CHECK-NEXT: store <8 x i32> [[TMP63]], ptr [[TMP64]], align 4
; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 8
diff --git a/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1_lshr.ll b/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1_lshr.ll
index 797a07aca82b1..51c188b30a933 100644
--- a/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1_lshr.ll
+++ b/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction1_lshr.ll
@@ -116,10 +116,10 @@ define void @ld_lshr1_step1_start0_ind1(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP4]], align 8
; VF4-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP6]], align 8
; VF4-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; VF4-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; VF4-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; VF4-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; VF4-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; VF4-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; VF4-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; VF4-NEXT: [[TMP17:%.*]] = add nsw <4 x i64> [[TMP16]], splat (i64 42)
; VF4-NEXT: [[TMP18:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[INDEX]]
; VF4-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
@@ -237,8 +237,8 @@ define void @ld_lshr0_step2_start0_ind1(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP6:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP5]]
; VF2-NEXT: [[TMP7:%.*]] = load i64, ptr [[TMP4]], align 8
; VF2-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP6]], align 8
-; VF2-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i64 0
-; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i64 1
+; VF2-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i32 0
+; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i32 1
; VF2-NEXT: [[TMP11:%.*]] = add nsw <2 x i64> [[TMP10]], splat (i64 42)
; VF2-NEXT: [[TMP12:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF2-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -281,10 +281,10 @@ define void @ld_lshr0_step2_start0_ind1(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP8]], align 8
; VF4-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP10]], align 8
; VF4-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP12]], align 8
-; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP13]], i64 0
-; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 1
-; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 2
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 3
+; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP13]], i32 0
+; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 1
+; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 2
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 3
; VF4-NEXT: [[TMP21:%.*]] = add nsw <4 x i64> [[TMP20]], splat (i64 42)
; VF4-NEXT: [[TMP22:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF4-NEXT: [[TMP23:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -427,8 +427,8 @@ define void @ld_lshr0_step3_start0_ind1(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP6:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP5]]
; VF2-NEXT: [[TMP7:%.*]] = load i64, ptr [[TMP4]], align 8
; VF2-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP6]], align 8
-; VF2-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i64 0
-; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i64 1
+; VF2-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i32 0
+; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i32 1
; VF2-NEXT: [[TMP11:%.*]] = add nsw <2 x i64> [[TMP10]], splat (i64 42)
; VF2-NEXT: [[TMP12:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF2-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -470,10 +470,10 @@ define void @ld_lshr0_step3_start0_ind1(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP8]], align 8
; VF4-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP10]], align 8
; VF4-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP12]], align 8
-; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP13]], i64 0
-; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 1
-; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 2
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 3
+; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP13]], i32 0
+; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 1
+; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 2
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 3
; VF4-NEXT: [[TMP21:%.*]] = add nsw <4 x i64> [[TMP20]], splat (i64 42)
; VF4-NEXT: [[TMP22:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF4-NEXT: [[TMP23:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -532,8 +532,8 @@ define void @ld_lshr1_step3_start0_ind1(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP6:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP5]]
; VF2-NEXT: [[TMP7:%.*]] = load i64, ptr [[TMP4]], align 8
; VF2-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP6]], align 8
-; VF2-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i64 0
-; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i64 1
+; VF2-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i32 0
+; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i32 1
; VF2-NEXT: [[TMP11:%.*]] = add nsw <2 x i64> [[TMP10]], splat (i64 42)
; VF2-NEXT: [[TMP12:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF2-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -575,10 +575,10 @@ define void @ld_lshr1_step3_start0_ind1(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP8]], align 8
; VF4-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP10]], align 8
; VF4-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP12]], align 8
-; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP13]], i64 0
-; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 1
-; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 2
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 3
+; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP13]], i32 0
+; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 1
+; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 2
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 3
; VF4-NEXT: [[TMP21:%.*]] = add nsw <4 x i64> [[TMP20]], splat (i64 42)
; VF4-NEXT: [[TMP22:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF4-NEXT: [[TMP23:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -637,8 +637,8 @@ define void @ld_lshr1_step1_start1_ind1(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP5:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP4]]
; VF2-NEXT: [[TMP6:%.*]] = load i64, ptr [[TMP3]], align 8
; VF2-NEXT: [[TMP7:%.*]] = load i64, ptr [[TMP5]], align 8
-; VF2-NEXT: [[TMP8:%.*]] = insertelement <2 x i64> poison, i64 [[TMP6]], i64 0
-; VF2-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> [[TMP8]], i64 [[TMP7]], i64 1
+; VF2-NEXT: [[TMP8:%.*]] = insertelement <2 x i64> poison, i64 [[TMP6]], i32 0
+; VF2-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> [[TMP8]], i64 [[TMP7]], i32 1
; VF2-NEXT: [[TMP10:%.*]] = add nsw <2 x i64> [[TMP9]], splat (i64 42)
; VF2-NEXT: [[TMP11:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF2-NEXT: store <2 x i64> [[TMP10]], ptr [[TMP11]], align 8
@@ -673,10 +673,10 @@ define void @ld_lshr1_step1_start1_ind1(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP5]], align 8
; VF4-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP7]], align 8
; VF4-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; VF4-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; VF4-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; VF4-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; VF4-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; VF4-NEXT: [[TMP18:%.*]] = add nsw <4 x i64> [[TMP17]], splat (i64 42)
; VF4-NEXT: [[TMP19:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF4-NEXT: store <4 x i64> [[TMP18]], ptr [[TMP19]], align 8
@@ -809,8 +809,8 @@ define void @ld_lshr1_step3_start1_ind1(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP7:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP6]]
; VF2-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP5]], align 8
; VF2-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP7]], align 8
-; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i64 0
-; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i64 1
+; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i32 0
+; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i32 1
; VF2-NEXT: [[TMP12:%.*]] = add nsw <2 x i64> [[TMP11]], splat (i64 42)
; VF2-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF2-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -853,10 +853,10 @@ define void @ld_lshr1_step3_start1_ind1(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP9]], align 8
; VF4-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP11]], align 8
; VF4-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP13]], align 8
-; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> poison, i64 [[TMP14]], i64 0
-; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 1
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 2
-; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 3
+; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> poison, i64 [[TMP14]], i32 0
+; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 1
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 2
+; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 3
; VF4-NEXT: [[TMP22:%.*]] = add nsw <4 x i64> [[TMP21]], splat (i64 42)
; VF4-NEXT: [[TMP23:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF4-NEXT: [[TMP24:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -916,8 +916,8 @@ define void @ld_lshr2_step3_start1_ind1(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP7:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP6]]
; VF2-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP5]], align 8
; VF2-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP7]], align 8
-; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i64 0
-; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i64 1
+; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i32 0
+; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i32 1
; VF2-NEXT: [[TMP12:%.*]] = add nsw <2 x i64> [[TMP11]], splat (i64 42)
; VF2-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF2-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -960,10 +960,10 @@ define void @ld_lshr2_step3_start1_ind1(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP9]], align 8
; VF4-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP11]], align 8
; VF4-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP13]], align 8
-; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> poison, i64 [[TMP14]], i64 0
-; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 1
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 2
-; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 3
+; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> poison, i64 [[TMP14]], i32 0
+; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 1
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 2
+; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 3
; VF4-NEXT: [[TMP22:%.*]] = add nsw <4 x i64> [[TMP21]], splat (i64 42)
; VF4-NEXT: [[TMP23:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF4-NEXT: [[TMP24:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
diff --git a/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction2.ll b/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction2.ll
index ed08bf55cf76c..af0581cc83ca1 100644
--- a/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction2.ll
+++ b/llvm/test/Transforms/LoopVectorize/uniform_across_vf_induction2.ll
@@ -23,8 +23,8 @@ define void @ld_div1_step1_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP6:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP5]]
; VF2-NEXT: [[TMP7:%.*]] = load i64, ptr [[TMP4]], align 8
; VF2-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP6]], align 8
-; VF2-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i64 0
-; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i64 1
+; VF2-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i32 0
+; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i32 1
; VF2-NEXT: [[TMP11:%.*]] = add nsw <2 x i64> [[TMP10]], splat (i64 42)
; VF2-NEXT: [[TMP12:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[INDEX]]
; VF2-NEXT: store <2 x i64> [[TMP11]], ptr [[TMP12]], align 8
@@ -63,10 +63,10 @@ define void @ld_div1_step1_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP6]], align 8
; VF4-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP8]], align 8
; VF4-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP10]], align 8
-; VF4-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP11]], i64 0
-; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 1
-; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 2
-; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 3
+; VF4-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP11]], i32 0
+; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 1
+; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 2
+; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 3
; VF4-NEXT: [[TMP19:%.*]] = add nsw <4 x i64> [[TMP18]], splat (i64 42)
; VF4-NEXT: [[TMP20:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[INDEX]]
; VF4-NEXT: store <4 x i64> [[TMP19]], ptr [[TMP20]], align 8
@@ -154,10 +154,10 @@ define void @ld_div2_step1_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP6]], align 8
; VF4-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP8]], align 8
; VF4-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP10]], align 8
-; VF4-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP11]], i64 0
-; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 1
-; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 2
-; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 3
+; VF4-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP11]], i32 0
+; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 1
+; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 2
+; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 3
; VF4-NEXT: [[TMP19:%.*]] = add nsw <4 x i64> [[TMP18]], splat (i64 42)
; VF4-NEXT: [[TMP20:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[INDEX]]
; VF4-NEXT: store <4 x i64> [[TMP19]], ptr [[TMP20]], align 8
@@ -213,8 +213,8 @@ define void @ld_div3_step1_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP6:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP5]]
; VF2-NEXT: [[TMP7:%.*]] = load i64, ptr [[TMP4]], align 8
; VF2-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP6]], align 8
-; VF2-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i64 0
-; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i64 1
+; VF2-NEXT: [[TMP9:%.*]] = insertelement <2 x i64> poison, i64 [[TMP7]], i32 0
+; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> [[TMP9]], i64 [[TMP8]], i32 1
; VF2-NEXT: [[TMP11:%.*]] = add nsw <2 x i64> [[TMP10]], splat (i64 42)
; VF2-NEXT: [[TMP12:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[INDEX]]
; VF2-NEXT: store <2 x i64> [[TMP11]], ptr [[TMP12]], align 8
@@ -253,10 +253,10 @@ define void @ld_div3_step1_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP6]], align 8
; VF4-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP8]], align 8
; VF4-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP10]], align 8
-; VF4-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP11]], i64 0
-; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 1
-; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 2
-; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 3
+; VF4-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP11]], i32 0
+; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 1
+; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 2
+; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 3
; VF4-NEXT: [[TMP19:%.*]] = add nsw <4 x i64> [[TMP18]], splat (i64 42)
; VF4-NEXT: [[TMP20:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[INDEX]]
; VF4-NEXT: store <4 x i64> [[TMP19]], ptr [[TMP20]], align 8
@@ -314,8 +314,8 @@ define void @ld_div1_step2_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP8:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP7]]
; VF2-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP6]], align 8
; VF2-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP8]], align 8
-; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> poison, i64 [[TMP9]], i64 0
-; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> [[TMP11]], i64 [[TMP10]], i64 1
+; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> poison, i64 [[TMP9]], i32 0
+; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> [[TMP11]], i64 [[TMP10]], i32 1
; VF2-NEXT: [[TMP13:%.*]] = add nsw <2 x i64> [[TMP12]], splat (i64 42)
; VF2-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF2-NEXT: [[TMP15:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -362,10 +362,10 @@ define void @ld_div1_step2_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP10]], align 8
; VF4-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP12]], align 8
; VF4-NEXT: [[TMP18:%.*]] = load i64, ptr [[TMP14]], align 8
-; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> poison, i64 [[TMP15]], i64 0
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 1
-; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 2
-; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i64 3
+; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> poison, i64 [[TMP15]], i32 0
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 1
+; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 2
+; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i32 3
; VF4-NEXT: [[TMP23:%.*]] = add nsw <4 x i64> [[TMP22]], splat (i64 42)
; VF4-NEXT: [[TMP24:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF4-NEXT: [[TMP25:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -433,8 +433,8 @@ define void @ld_div2_step2_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP8:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP7]]
; VF2-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP6]], align 8
; VF2-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP8]], align 8
-; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> poison, i64 [[TMP9]], i64 0
-; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> [[TMP11]], i64 [[TMP10]], i64 1
+; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> poison, i64 [[TMP9]], i32 0
+; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> [[TMP11]], i64 [[TMP10]], i32 1
; VF2-NEXT: [[TMP13:%.*]] = add nsw <2 x i64> [[TMP12]], splat (i64 42)
; VF2-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF2-NEXT: [[TMP15:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -481,10 +481,10 @@ define void @ld_div2_step2_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP10]], align 8
; VF4-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP12]], align 8
; VF4-NEXT: [[TMP18:%.*]] = load i64, ptr [[TMP14]], align 8
-; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> poison, i64 [[TMP15]], i64 0
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 1
-; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 2
-; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i64 3
+; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> poison, i64 [[TMP15]], i32 0
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 1
+; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 2
+; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i32 3
; VF4-NEXT: [[TMP23:%.*]] = add nsw <4 x i64> [[TMP22]], splat (i64 42)
; VF4-NEXT: [[TMP24:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF4-NEXT: [[TMP25:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -552,8 +552,8 @@ define void @ld_div3_step2_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP8:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP7]]
; VF2-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP6]], align 8
; VF2-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP8]], align 8
-; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> poison, i64 [[TMP9]], i64 0
-; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> [[TMP11]], i64 [[TMP10]], i64 1
+; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> poison, i64 [[TMP9]], i32 0
+; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> [[TMP11]], i64 [[TMP10]], i32 1
; VF2-NEXT: [[TMP13:%.*]] = add nsw <2 x i64> [[TMP12]], splat (i64 42)
; VF2-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF2-NEXT: [[TMP15:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -600,10 +600,10 @@ define void @ld_div3_step2_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP10]], align 8
; VF4-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP12]], align 8
; VF4-NEXT: [[TMP18:%.*]] = load i64, ptr [[TMP14]], align 8
-; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> poison, i64 [[TMP15]], i64 0
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 1
-; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 2
-; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i64 3
+; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> poison, i64 [[TMP15]], i32 0
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 1
+; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 2
+; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i32 3
; VF4-NEXT: [[TMP23:%.*]] = add nsw <4 x i64> [[TMP22]], splat (i64 42)
; VF4-NEXT: [[TMP24:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF4-NEXT: [[TMP25:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -671,8 +671,8 @@ define void @ld_div1_step3_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP8:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP7]]
; VF2-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP6]], align 8
; VF2-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP8]], align 8
-; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> poison, i64 [[TMP9]], i64 0
-; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> [[TMP11]], i64 [[TMP10]], i64 1
+; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> poison, i64 [[TMP9]], i32 0
+; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> [[TMP11]], i64 [[TMP10]], i32 1
; VF2-NEXT: [[TMP13:%.*]] = add nsw <2 x i64> [[TMP12]], splat (i64 42)
; VF2-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF2-NEXT: [[TMP15:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -718,10 +718,10 @@ define void @ld_div1_step3_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP10]], align 8
; VF4-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP12]], align 8
; VF4-NEXT: [[TMP18:%.*]] = load i64, ptr [[TMP14]], align 8
-; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> poison, i64 [[TMP15]], i64 0
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 1
-; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 2
-; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i64 3
+; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> poison, i64 [[TMP15]], i32 0
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 1
+; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 2
+; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i32 3
; VF4-NEXT: [[TMP23:%.*]] = add nsw <4 x i64> [[TMP22]], splat (i64 42)
; VF4-NEXT: [[TMP24:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF4-NEXT: [[TMP25:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -788,8 +788,8 @@ define void @ld_div2_step3_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP8:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP7]]
; VF2-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP6]], align 8
; VF2-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP8]], align 8
-; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> poison, i64 [[TMP9]], i64 0
-; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> [[TMP11]], i64 [[TMP10]], i64 1
+; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> poison, i64 [[TMP9]], i32 0
+; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> [[TMP11]], i64 [[TMP10]], i32 1
; VF2-NEXT: [[TMP13:%.*]] = add nsw <2 x i64> [[TMP12]], splat (i64 42)
; VF2-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF2-NEXT: [[TMP15:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -835,10 +835,10 @@ define void @ld_div2_step3_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP10]], align 8
; VF4-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP12]], align 8
; VF4-NEXT: [[TMP18:%.*]] = load i64, ptr [[TMP14]], align 8
-; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> poison, i64 [[TMP15]], i64 0
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 1
-; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 2
-; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i64 3
+; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> poison, i64 [[TMP15]], i32 0
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 1
+; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 2
+; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i32 3
; VF4-NEXT: [[TMP23:%.*]] = add nsw <4 x i64> [[TMP22]], splat (i64 42)
; VF4-NEXT: [[TMP24:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF4-NEXT: [[TMP25:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -905,8 +905,8 @@ define void @ld_div3_step3_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP8:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP7]]
; VF2-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP6]], align 8
; VF2-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP8]], align 8
-; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> poison, i64 [[TMP9]], i64 0
-; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> [[TMP11]], i64 [[TMP10]], i64 1
+; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> poison, i64 [[TMP9]], i32 0
+; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> [[TMP11]], i64 [[TMP10]], i32 1
; VF2-NEXT: [[TMP13:%.*]] = add nsw <2 x i64> [[TMP12]], splat (i64 42)
; VF2-NEXT: [[TMP14:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF2-NEXT: [[TMP15:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -952,10 +952,10 @@ define void @ld_div3_step3_start0_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP10]], align 8
; VF4-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP12]], align 8
; VF4-NEXT: [[TMP18:%.*]] = load i64, ptr [[TMP14]], align 8
-; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> poison, i64 [[TMP15]], i64 0
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 1
-; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 2
-; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i64 3
+; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> poison, i64 [[TMP15]], i32 0
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 1
+; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 2
+; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i32 3
; VF4-NEXT: [[TMP23:%.*]] = add nsw <4 x i64> [[TMP22]], splat (i64 42)
; VF4-NEXT: [[TMP24:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF4-NEXT: [[TMP25:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
@@ -1021,8 +1021,8 @@ define void @ld_div1_step1_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP7:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP6]]
; VF2-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP5]], align 8
; VF2-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP7]], align 8
-; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i64 0
-; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i64 1
+; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i32 0
+; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i32 1
; VF2-NEXT: [[TMP12:%.*]] = add nsw <2 x i64> [[TMP11]], splat (i64 42)
; VF2-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF2-NEXT: store <2 x i64> [[TMP12]], ptr [[TMP13]], align 8
@@ -1061,10 +1061,10 @@ define void @ld_div1_step1_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP7]], align 8
; VF4-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP9]], align 8
; VF4-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP11]], align 8
-; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i64 0
-; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 1
-; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 2
-; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 3
+; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i32 0
+; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 1
+; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 2
+; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 3
; VF4-NEXT: [[TMP20:%.*]] = add nsw <4 x i64> [[TMP19]], splat (i64 42)
; VF4-NEXT: [[TMP21:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF4-NEXT: store <4 x i64> [[TMP20]], ptr [[TMP21]], align 8
@@ -1120,8 +1120,8 @@ define void @ld_div2_step1_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP7:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP6]]
; VF2-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP5]], align 8
; VF2-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP7]], align 8
-; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i64 0
-; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i64 1
+; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i32 0
+; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i32 1
; VF2-NEXT: [[TMP12:%.*]] = add nsw <2 x i64> [[TMP11]], splat (i64 42)
; VF2-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF2-NEXT: store <2 x i64> [[TMP12]], ptr [[TMP13]], align 8
@@ -1160,10 +1160,10 @@ define void @ld_div2_step1_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP7]], align 8
; VF4-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP9]], align 8
; VF4-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP11]], align 8
-; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i64 0
-; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 1
-; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 2
-; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 3
+; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i32 0
+; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 1
+; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 2
+; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 3
; VF4-NEXT: [[TMP20:%.*]] = add nsw <4 x i64> [[TMP19]], splat (i64 42)
; VF4-NEXT: [[TMP21:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF4-NEXT: store <4 x i64> [[TMP20]], ptr [[TMP21]], align 8
@@ -1219,8 +1219,8 @@ define void @ld_div3_step1_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP7:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP6]]
; VF2-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP5]], align 8
; VF2-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP7]], align 8
-; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i64 0
-; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i64 1
+; VF2-NEXT: [[TMP10:%.*]] = insertelement <2 x i64> poison, i64 [[TMP8]], i32 0
+; VF2-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> [[TMP10]], i64 [[TMP9]], i32 1
; VF2-NEXT: [[TMP12:%.*]] = add nsw <2 x i64> [[TMP11]], splat (i64 42)
; VF2-NEXT: [[TMP13:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF2-NEXT: store <2 x i64> [[TMP12]], ptr [[TMP13]], align 8
@@ -1259,10 +1259,10 @@ define void @ld_div3_step1_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP7]], align 8
; VF4-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP9]], align 8
; VF4-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP11]], align 8
-; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i64 0
-; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 1
-; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 2
-; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 3
+; VF4-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i32 0
+; VF4-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 1
+; VF4-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 2
+; VF4-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 3
; VF4-NEXT: [[TMP20:%.*]] = add nsw <4 x i64> [[TMP19]], splat (i64 42)
; VF4-NEXT: [[TMP21:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP0]]
; VF4-NEXT: store <4 x i64> [[TMP20]], ptr [[TMP21]], align 8
@@ -1320,8 +1320,8 @@ define void @ld_div1_step2_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP9:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP8]]
; VF2-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP7]], align 8
; VF2-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP9]], align 8
-; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> poison, i64 [[TMP10]], i64 0
-; VF2-NEXT: [[TMP13:%.*]] = insertelement <2 x i64> [[TMP12]], i64 [[TMP11]], i64 1
+; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> poison, i64 [[TMP10]], i32 0
+; VF2-NEXT: [[TMP13:%.*]] = insertelement <2 x i64> [[TMP12]], i64 [[TMP11]], i32 1
; VF2-NEXT: [[TMP14:%.*]] = add nsw <2 x i64> [[TMP13]], splat (i64 42)
; VF2-NEXT: [[TMP15:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF2-NEXT: [[TMP16:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -1368,10 +1368,10 @@ define void @ld_div1_step2_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP11]], align 8
; VF4-NEXT: [[TMP18:%.*]] = load i64, ptr [[TMP13]], align 8
; VF4-NEXT: [[TMP19:%.*]] = load i64, ptr [[TMP15]], align 8
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> poison, i64 [[TMP16]], i64 0
-; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 1
-; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i64 2
-; VF4-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP19]], i64 3
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> poison, i64 [[TMP16]], i32 0
+; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 1
+; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i32 2
+; VF4-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP19]], i32 3
; VF4-NEXT: [[TMP24:%.*]] = add nsw <4 x i64> [[TMP23]], splat (i64 42)
; VF4-NEXT: [[TMP25:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF4-NEXT: [[TMP26:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -1439,8 +1439,8 @@ define void @ld_div2_step2_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP9:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP8]]
; VF2-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP7]], align 8
; VF2-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP9]], align 8
-; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> poison, i64 [[TMP10]], i64 0
-; VF2-NEXT: [[TMP13:%.*]] = insertelement <2 x i64> [[TMP12]], i64 [[TMP11]], i64 1
+; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> poison, i64 [[TMP10]], i32 0
+; VF2-NEXT: [[TMP13:%.*]] = insertelement <2 x i64> [[TMP12]], i64 [[TMP11]], i32 1
; VF2-NEXT: [[TMP14:%.*]] = add nsw <2 x i64> [[TMP13]], splat (i64 42)
; VF2-NEXT: [[TMP15:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF2-NEXT: [[TMP16:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -1487,10 +1487,10 @@ define void @ld_div2_step2_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP11]], align 8
; VF4-NEXT: [[TMP18:%.*]] = load i64, ptr [[TMP13]], align 8
; VF4-NEXT: [[TMP19:%.*]] = load i64, ptr [[TMP15]], align 8
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> poison, i64 [[TMP16]], i64 0
-; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 1
-; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i64 2
-; VF4-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP19]], i64 3
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> poison, i64 [[TMP16]], i32 0
+; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 1
+; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i32 2
+; VF4-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP19]], i32 3
; VF4-NEXT: [[TMP24:%.*]] = add nsw <4 x i64> [[TMP23]], splat (i64 42)
; VF4-NEXT: [[TMP25:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF4-NEXT: [[TMP26:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -1558,8 +1558,8 @@ define void @ld_div3_step2_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP9:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP8]]
; VF2-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP7]], align 8
; VF2-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP9]], align 8
-; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> poison, i64 [[TMP10]], i64 0
-; VF2-NEXT: [[TMP13:%.*]] = insertelement <2 x i64> [[TMP12]], i64 [[TMP11]], i64 1
+; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> poison, i64 [[TMP10]], i32 0
+; VF2-NEXT: [[TMP13:%.*]] = insertelement <2 x i64> [[TMP12]], i64 [[TMP11]], i32 1
; VF2-NEXT: [[TMP14:%.*]] = add nsw <2 x i64> [[TMP13]], splat (i64 42)
; VF2-NEXT: [[TMP15:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF2-NEXT: [[TMP16:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -1606,10 +1606,10 @@ define void @ld_div3_step2_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP11]], align 8
; VF4-NEXT: [[TMP18:%.*]] = load i64, ptr [[TMP13]], align 8
; VF4-NEXT: [[TMP19:%.*]] = load i64, ptr [[TMP15]], align 8
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> poison, i64 [[TMP16]], i64 0
-; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 1
-; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i64 2
-; VF4-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP19]], i64 3
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> poison, i64 [[TMP16]], i32 0
+; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 1
+; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i32 2
+; VF4-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP19]], i32 3
; VF4-NEXT: [[TMP24:%.*]] = add nsw <4 x i64> [[TMP23]], splat (i64 42)
; VF4-NEXT: [[TMP25:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF4-NEXT: [[TMP26:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -1677,8 +1677,8 @@ define void @ld_div1_step3_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP9:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP8]]
; VF2-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP7]], align 8
; VF2-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP9]], align 8
-; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> poison, i64 [[TMP10]], i64 0
-; VF2-NEXT: [[TMP13:%.*]] = insertelement <2 x i64> [[TMP12]], i64 [[TMP11]], i64 1
+; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> poison, i64 [[TMP10]], i32 0
+; VF2-NEXT: [[TMP13:%.*]] = insertelement <2 x i64> [[TMP12]], i64 [[TMP11]], i32 1
; VF2-NEXT: [[TMP14:%.*]] = add nsw <2 x i64> [[TMP13]], splat (i64 42)
; VF2-NEXT: [[TMP15:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF2-NEXT: [[TMP16:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -1725,10 +1725,10 @@ define void @ld_div1_step3_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP11]], align 8
; VF4-NEXT: [[TMP18:%.*]] = load i64, ptr [[TMP13]], align 8
; VF4-NEXT: [[TMP19:%.*]] = load i64, ptr [[TMP15]], align 8
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> poison, i64 [[TMP16]], i64 0
-; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 1
-; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i64 2
-; VF4-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP19]], i64 3
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> poison, i64 [[TMP16]], i32 0
+; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 1
+; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i32 2
+; VF4-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP19]], i32 3
; VF4-NEXT: [[TMP24:%.*]] = add nsw <4 x i64> [[TMP23]], splat (i64 42)
; VF4-NEXT: [[TMP25:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF4-NEXT: [[TMP26:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -1796,8 +1796,8 @@ define void @ld_div2_step3_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP9:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP8]]
; VF2-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP7]], align 8
; VF2-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP9]], align 8
-; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> poison, i64 [[TMP10]], i64 0
-; VF2-NEXT: [[TMP13:%.*]] = insertelement <2 x i64> [[TMP12]], i64 [[TMP11]], i64 1
+; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> poison, i64 [[TMP10]], i32 0
+; VF2-NEXT: [[TMP13:%.*]] = insertelement <2 x i64> [[TMP12]], i64 [[TMP11]], i32 1
; VF2-NEXT: [[TMP14:%.*]] = add nsw <2 x i64> [[TMP13]], splat (i64 42)
; VF2-NEXT: [[TMP15:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF2-NEXT: [[TMP16:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -1844,10 +1844,10 @@ define void @ld_div2_step3_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP11]], align 8
; VF4-NEXT: [[TMP18:%.*]] = load i64, ptr [[TMP13]], align 8
; VF4-NEXT: [[TMP19:%.*]] = load i64, ptr [[TMP15]], align 8
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> poison, i64 [[TMP16]], i64 0
-; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 1
-; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i64 2
-; VF4-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP19]], i64 3
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> poison, i64 [[TMP16]], i32 0
+; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 1
+; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i32 2
+; VF4-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP19]], i32 3
; VF4-NEXT: [[TMP24:%.*]] = add nsw <4 x i64> [[TMP23]], splat (i64 42)
; VF4-NEXT: [[TMP25:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF4-NEXT: [[TMP26:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -1915,8 +1915,8 @@ define void @ld_div3_step3_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF2-NEXT: [[TMP9:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 [[TMP8]]
; VF2-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP7]], align 8
; VF2-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP9]], align 8
-; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> poison, i64 [[TMP10]], i64 0
-; VF2-NEXT: [[TMP13:%.*]] = insertelement <2 x i64> [[TMP12]], i64 [[TMP11]], i64 1
+; VF2-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> poison, i64 [[TMP10]], i32 0
+; VF2-NEXT: [[TMP13:%.*]] = insertelement <2 x i64> [[TMP12]], i64 [[TMP11]], i32 1
; VF2-NEXT: [[TMP14:%.*]] = add nsw <2 x i64> [[TMP13]], splat (i64 42)
; VF2-NEXT: [[TMP15:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF2-NEXT: [[TMP16:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
@@ -1963,10 +1963,10 @@ define void @ld_div3_step3_start1_ind2(ptr noalias %A, ptr noalias %B) {
; VF4-NEXT: [[TMP17:%.*]] = load i64, ptr [[TMP11]], align 8
; VF4-NEXT: [[TMP18:%.*]] = load i64, ptr [[TMP13]], align 8
; VF4-NEXT: [[TMP19:%.*]] = load i64, ptr [[TMP15]], align 8
-; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> poison, i64 [[TMP16]], i64 0
-; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i64 1
-; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i64 2
-; VF4-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP19]], i64 3
+; VF4-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> poison, i64 [[TMP16]], i32 0
+; VF4-NEXT: [[TMP21:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP17]], i32 1
+; VF4-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> [[TMP21]], i64 [[TMP18]], i32 2
+; VF4-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP19]], i32 3
; VF4-NEXT: [[TMP24:%.*]] = add nsw <4 x i64> [[TMP23]], splat (i64 42)
; VF4-NEXT: [[TMP25:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP1]]
; VF4-NEXT: [[TMP26:%.*]] = getelementptr inbounds i64, ptr [[B]], i64 [[TMP2]]
diff --git a/llvm/test/Transforms/LoopVectorize/vplan-based-stride-mv-btc.ll b/llvm/test/Transforms/LoopVectorize/vplan-based-stride-mv-btc.ll
index 0e7aad6c2f864..bb30e860dd059 100644
--- a/llvm/test/Transforms/LoopVectorize/vplan-based-stride-mv-btc.ll
+++ b/llvm/test/Transforms/LoopVectorize/vplan-based-stride-mv-btc.ll
@@ -60,10 +60,10 @@ define void @non_constant_btc(ptr noalias %p.out, ptr %p, i64 %stride, i64 %n) v
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -428,10 +428,10 @@ define void @stride_as_btc(ptr noalias %p.out, ptr %p, i64 %stride) vscale_range
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -725,10 +725,10 @@ define void @stride_dependent_btc(ptr noalias %p.out, ptr %p, i64 %stride) vscal
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -1029,10 +1029,10 @@ define void @stride_btc_checks_order(ptr noalias %p.out, ptr %p, i64 %stride, i6
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -1406,10 +1406,10 @@ define void @stride_dependent_btc_non_preventive(ptr noalias %p.out, ptr %p, i64
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP20]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -1938,10 +1938,10 @@ define void @stride_btc_independent_memdep_triple_check(ptr %p, ptr noalias %p2,
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP24:%.*]] = insertelement <4 x i64> [[TMP23]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP24]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P2]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: [[WIDE_LOAD:%.*]] = load <4 x i64>, ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = add <4 x i64> [[TMP16]], [[WIDE_LOAD]]
diff --git a/llvm/test/Transforms/LoopVectorize/vplan-based-stride-mv.ll b/llvm/test/Transforms/LoopVectorize/vplan-based-stride-mv.ll
index 5028c271af40a..dc766e0ddcda1 100644
--- a/llvm/test/Transforms/LoopVectorize/vplan-based-stride-mv.ll
+++ b/llvm/test/Transforms/LoopVectorize/vplan-based-stride-mv.ll
@@ -31,10 +31,10 @@ define void @basic(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -128,10 +128,10 @@ define void @basic_optsize(ptr noalias %p.out, ptr %p, i64 %stride) #0 {
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -167,10 +167,10 @@ define void @basic_optsize(ptr noalias %p.out, ptr %p, i64 %stride) #0 {
; COMPARE-LAA-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -231,10 +231,10 @@ define void @basic_minsize(ptr noalias %p.out, ptr %p, i64 %stride) #1 {
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -270,10 +270,10 @@ define void @basic_minsize(ptr noalias %p.out, ptr %p, i64 %stride) #1 {
; COMPARE-LAA-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -340,10 +340,10 @@ define void @byte_gep_scaled_stride(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -380,10 +380,10 @@ define void @byte_gep_scaled_stride(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -446,10 +446,10 @@ define void @byte_gep_under_scaled_stride(ptr noalias %p.out, ptr %p, i64 %strid
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -486,10 +486,10 @@ define void @byte_gep_under_scaled_stride(ptr noalias %p.out, ptr %p, i64 %strid
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -553,10 +553,10 @@ define void @byte_gep_over_scaled_stride(ptr noalias %p.out, ptr %p, i64 %stride
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -593,10 +593,10 @@ define void @byte_gep_over_scaled_stride(ptr noalias %p.out, ptr %p, i64 %stride
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -659,10 +659,10 @@ define void @byte_gep_non_power_of_two_scaled_stride(ptr noalias %p.out, ptr %p,
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -699,10 +699,10 @@ define void @byte_gep_non_power_of_two_scaled_stride(ptr noalias %p.out, ptr %p,
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -763,10 +763,10 @@ define void @byte_gep_nonscaled_stride(ptr noalias %p.out, ptr %p, i64 %stride)
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -800,10 +800,10 @@ define void @byte_gep_nonscaled_stride(ptr noalias %p.out, ptr %p, i64 %stride)
; COMPARE-LAA-MV-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP5]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = insertelement <4 x i64> poison, i64 [[TMP8]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> [[TMP12]], i64 [[TMP9]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = insertelement <4 x i64> poison, i64 [[TMP8]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> [[TMP12]], i64 [[TMP9]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP15]], ptr [[TMP16]], align 8
; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -877,10 +877,10 @@ define void @byte_gep_negated_stride(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -917,10 +917,10 @@ define void @byte_gep_negated_stride(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -985,18 +985,18 @@ define void @shared_stride(ptr noalias %p.out, ptr %p0, ptr %p1, i64 %stride) {
; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP13]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP13]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP21:%.*]] = load i64, ptr [[TMP9]], align 8
; COMPARE-NO-MV-NEXT: [[TMP22:%.*]] = load i64, ptr [[TMP10]], align 8
; COMPARE-NO-MV-NEXT: [[TMP23:%.*]] = load i64, ptr [[TMP11]], align 8
; COMPARE-NO-MV-NEXT: [[TMP24:%.*]] = load i64, ptr [[TMP12]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i64> poison, i64 [[TMP21]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i64> [[TMP25]], i64 [[TMP22]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP27:%.*]] = insertelement <4 x i64> [[TMP26]], i64 [[TMP23]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP28:%.*]] = insertelement <4 x i64> [[TMP27]], i64 [[TMP24]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i64> poison, i64 [[TMP21]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i64> [[TMP25]], i64 [[TMP22]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP27:%.*]] = insertelement <4 x i64> [[TMP26]], i64 [[TMP23]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP28:%.*]] = insertelement <4 x i64> [[TMP27]], i64 [[TMP24]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP29:%.*]] = add <4 x i64> [[TMP20]], [[TMP28]]
; COMPARE-NO-MV-NEXT: [[TMP30:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP29]], ptr [[TMP30]], align 8
@@ -1112,18 +1112,18 @@ define void @independent_strides(ptr noalias %p.out, ptr %p0, ptr %p1, i64 %stri
; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = load i64, ptr [[TMP5]], align 8
; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP21:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> poison, i64 [[TMP18]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP19]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP24:%.*]] = insertelement <4 x i64> [[TMP23]], i64 [[TMP20]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i64> [[TMP24]], i64 [[TMP21]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP22:%.*]] = insertelement <4 x i64> poison, i64 [[TMP18]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> [[TMP22]], i64 [[TMP19]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP24:%.*]] = insertelement <4 x i64> [[TMP23]], i64 [[TMP20]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i64> [[TMP24]], i64 [[TMP21]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = load i64, ptr [[TMP11]], align 8
; COMPARE-NO-MV-NEXT: [[TMP27:%.*]] = load i64, ptr [[TMP13]], align 8
; COMPARE-NO-MV-NEXT: [[TMP28:%.*]] = load i64, ptr [[TMP15]], align 8
; COMPARE-NO-MV-NEXT: [[TMP29:%.*]] = load i64, ptr [[TMP17]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP30:%.*]] = insertelement <4 x i64> poison, i64 [[TMP26]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP31:%.*]] = insertelement <4 x i64> [[TMP30]], i64 [[TMP27]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP32:%.*]] = insertelement <4 x i64> [[TMP31]], i64 [[TMP28]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP33:%.*]] = insertelement <4 x i64> [[TMP32]], i64 [[TMP29]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP30:%.*]] = insertelement <4 x i64> poison, i64 [[TMP26]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP31:%.*]] = insertelement <4 x i64> [[TMP30]], i64 [[TMP27]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP32:%.*]] = insertelement <4 x i64> [[TMP31]], i64 [[TMP28]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP33:%.*]] = insertelement <4 x i64> [[TMP32]], i64 [[TMP29]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP34:%.*]] = add <4 x i64> [[TMP25]], [[TMP33]]
; COMPARE-NO-MV-NEXT: [[TMP35:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP34]], ptr [[TMP35]], align 8
@@ -1242,18 +1242,18 @@ define void @dependent_strides(ptr noalias %p.out, ptr %p0, ptr %p1, i64 %stride
; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = load i64, ptr [[TMP12]], align 8
; COMPARE-NO-MV-NEXT: [[TMP21:%.*]] = load i64, ptr [[TMP13]], align 8
; COMPARE-NO-MV-NEXT: [[TMP22:%.*]] = load i64, ptr [[TMP14]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> poison, i64 [[TMP19]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP24:%.*]] = insertelement <4 x i64> [[TMP23]], i64 [[TMP20]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i64> [[TMP24]], i64 [[TMP21]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i64> [[TMP25]], i64 [[TMP22]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> poison, i64 [[TMP19]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP24:%.*]] = insertelement <4 x i64> [[TMP23]], i64 [[TMP20]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i64> [[TMP24]], i64 [[TMP21]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i64> [[TMP25]], i64 [[TMP22]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP27:%.*]] = load i64, ptr [[TMP15]], align 8
; COMPARE-NO-MV-NEXT: [[TMP28:%.*]] = load i64, ptr [[TMP16]], align 8
; COMPARE-NO-MV-NEXT: [[TMP29:%.*]] = load i64, ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[TMP30:%.*]] = load i64, ptr [[TMP18]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP31:%.*]] = insertelement <4 x i64> poison, i64 [[TMP27]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP32:%.*]] = insertelement <4 x i64> [[TMP31]], i64 [[TMP28]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP33:%.*]] = insertelement <4 x i64> [[TMP32]], i64 [[TMP29]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP34:%.*]] = insertelement <4 x i64> [[TMP33]], i64 [[TMP30]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP31:%.*]] = insertelement <4 x i64> poison, i64 [[TMP27]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP32:%.*]] = insertelement <4 x i64> [[TMP31]], i64 [[TMP28]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP33:%.*]] = insertelement <4 x i64> [[TMP32]], i64 [[TMP29]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP34:%.*]] = insertelement <4 x i64> [[TMP33]], i64 [[TMP30]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP35:%.*]] = add <4 x i64> [[TMP26]], [[TMP34]]
; COMPARE-NO-MV-NEXT: [[TMP36:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP35]], ptr [[TMP36]], align 8
@@ -1293,10 +1293,10 @@ define void @dependent_strides(ptr noalias %p.out, ptr %p0, ptr %p1, i64 %stride
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP5]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = add <4 x i64> [[WIDE_LOAD]], [[TMP17]]
; COMPARE-LAA-MV-NEXT: [[TMP19:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP18]], ptr [[TMP19]], align 8
@@ -1391,18 +1391,18 @@ define void @dependent_strides_reverse_order(ptr noalias %p.out, ptr %p0, ptr %p
; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = load i64, ptr [[TMP12]], align 8
; COMPARE-NO-MV-NEXT: [[TMP21:%.*]] = load i64, ptr [[TMP13]], align 8
; COMPARE-NO-MV-NEXT: [[TMP22:%.*]] = load i64, ptr [[TMP14]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> poison, i64 [[TMP19]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP24:%.*]] = insertelement <4 x i64> [[TMP23]], i64 [[TMP20]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i64> [[TMP24]], i64 [[TMP21]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i64> [[TMP25]], i64 [[TMP22]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP23:%.*]] = insertelement <4 x i64> poison, i64 [[TMP19]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP24:%.*]] = insertelement <4 x i64> [[TMP23]], i64 [[TMP20]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i64> [[TMP24]], i64 [[TMP21]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i64> [[TMP25]], i64 [[TMP22]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP27:%.*]] = load i64, ptr [[TMP15]], align 8
; COMPARE-NO-MV-NEXT: [[TMP28:%.*]] = load i64, ptr [[TMP16]], align 8
; COMPARE-NO-MV-NEXT: [[TMP29:%.*]] = load i64, ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[TMP30:%.*]] = load i64, ptr [[TMP18]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP31:%.*]] = insertelement <4 x i64> poison, i64 [[TMP27]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP32:%.*]] = insertelement <4 x i64> [[TMP31]], i64 [[TMP28]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP33:%.*]] = insertelement <4 x i64> [[TMP32]], i64 [[TMP29]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP34:%.*]] = insertelement <4 x i64> [[TMP33]], i64 [[TMP30]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP31:%.*]] = insertelement <4 x i64> poison, i64 [[TMP27]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP32:%.*]] = insertelement <4 x i64> [[TMP31]], i64 [[TMP28]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP33:%.*]] = insertelement <4 x i64> [[TMP32]], i64 [[TMP29]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP34:%.*]] = insertelement <4 x i64> [[TMP33]], i64 [[TMP30]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP35:%.*]] = add <4 x i64> [[TMP26]], [[TMP34]]
; COMPARE-NO-MV-NEXT: [[TMP36:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP35]], ptr [[TMP36]], align 8
@@ -1441,10 +1441,10 @@ define void @dependent_strides_reverse_order(ptr noalias %p.out, ptr %p0, ptr %p
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP4]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-LAA-MV-NEXT: [[WIDE_LOAD:%.*]] = load <4 x i64>, ptr [[TMP9]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = add <4 x i64> [[TMP17]], [[WIDE_LOAD]]
; COMPARE-LAA-MV-NEXT: [[TMP19:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
@@ -1529,10 +1529,10 @@ define void @byte_dependent_byte_geps(ptr noalias %p.out, ptr %p0, ptr %p1, i64
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i8, ptr [[P1]], i64 [[TMP1]]
; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = getelementptr i8, ptr [[P1]], i64 [[TMP2]]
; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = getelementptr i8, ptr [[P1]], i64 [[TMP3]]
@@ -1541,10 +1541,10 @@ define void @byte_dependent_byte_geps(ptr noalias %p.out, ptr %p0, ptr %p1, i64
; COMPARE-NO-MV-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP18]], align 8
; COMPARE-NO-MV-NEXT: [[TMP23:%.*]] = load i32, ptr [[TMP19]], align 8
; COMPARE-NO-MV-NEXT: [[TMP24:%.*]] = load i32, ptr [[TMP20]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i32> poison, i32 [[TMP21]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i32> [[TMP25]], i32 [[TMP22]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP27:%.*]] = insertelement <4 x i32> [[TMP26]], i32 [[TMP23]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP28:%.*]] = insertelement <4 x i32> [[TMP27]], i32 [[TMP24]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i32> poison, i32 [[TMP21]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i32> [[TMP25]], i32 [[TMP22]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP27:%.*]] = insertelement <4 x i32> [[TMP26]], i32 [[TMP23]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP28:%.*]] = insertelement <4 x i32> [[TMP27]], i32 [[TMP24]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP29:%.*]] = sext <4 x i32> [[TMP28]] to <4 x i64>
; COMPARE-NO-MV-NEXT: [[TMP30:%.*]] = add <4 x i64> [[TMP16]], [[TMP29]]
; COMPARE-NO-MV-NEXT: [[TMP31:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
@@ -1580,10 +1580,10 @@ define void @byte_dependent_byte_geps(ptr noalias %p.out, ptr %p0, ptr %p1, i64
; COMPARE-LAA-MV-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP5]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = insertelement <4 x i64> poison, i64 [[TMP8]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> [[TMP12]], i64 [[TMP9]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = insertelement <4 x i64> poison, i64 [[TMP8]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> [[TMP12]], i64 [[TMP9]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = getelementptr i8, ptr [[P1]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = getelementptr i8, ptr [[P1]], i64 [[TMP1]]
; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = getelementptr i8, ptr [[P1]], i64 [[TMP2]]
@@ -1592,10 +1592,10 @@ define void @byte_dependent_byte_geps(ptr noalias %p.out, ptr %p0, ptr %p1, i64
; COMPARE-LAA-MV-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP17]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP18]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP23:%.*]] = load i32, ptr [[TMP19]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> poison, i32 [[TMP20]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i32> [[TMP24]], i32 [[TMP21]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i32> [[TMP25]], i32 [[TMP22]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP27:%.*]] = insertelement <4 x i32> [[TMP26]], i32 [[TMP23]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> poison, i32 [[TMP20]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i32> [[TMP24]], i32 [[TMP21]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i32> [[TMP25]], i32 [[TMP22]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP27:%.*]] = insertelement <4 x i32> [[TMP26]], i32 [[TMP23]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP28:%.*]] = sext <4 x i32> [[TMP27]] to <4 x i64>
; COMPARE-LAA-MV-NEXT: [[TMP29:%.*]] = add <4 x i64> [[TMP15]], [[TMP28]]
; COMPARE-LAA-MV-NEXT: [[TMP30:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
@@ -1678,10 +1678,10 @@ define void @byte_dependent_byte_geps_reverse_order(ptr noalias %p.out, ptr %p0,
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i32, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i32> poison, i32 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> [[TMP13]], i32 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> [[TMP15]], i32 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i32> poison, i32 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> [[TMP13]], i32 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i32> [[TMP15]], i32 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = sext <4 x i32> [[TMP16]] to <4 x i64>
; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = getelementptr i8, ptr [[P0]], i64 [[TMP1]]
; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = getelementptr i8, ptr [[P0]], i64 [[TMP2]]
@@ -1691,10 +1691,10 @@ define void @byte_dependent_byte_geps_reverse_order(ptr noalias %p.out, ptr %p0,
; COMPARE-NO-MV-NEXT: [[TMP23:%.*]] = load i64, ptr [[TMP19]], align 8
; COMPARE-NO-MV-NEXT: [[TMP24:%.*]] = load i64, ptr [[TMP20]], align 8
; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = load i64, ptr [[TMP21]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i64> poison, i64 [[TMP22]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP27:%.*]] = insertelement <4 x i64> [[TMP26]], i64 [[TMP23]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP28:%.*]] = insertelement <4 x i64> [[TMP27]], i64 [[TMP24]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP29:%.*]] = insertelement <4 x i64> [[TMP28]], i64 [[TMP25]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i64> poison, i64 [[TMP22]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP27:%.*]] = insertelement <4 x i64> [[TMP26]], i64 [[TMP23]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP28:%.*]] = insertelement <4 x i64> [[TMP27]], i64 [[TMP24]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP29:%.*]] = insertelement <4 x i64> [[TMP28]], i64 [[TMP25]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP30:%.*]] = add <4 x i64> [[TMP29]], [[TMP17]]
; COMPARE-NO-MV-NEXT: [[TMP31:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP30]], ptr [[TMP31]], align 8
@@ -1729,10 +1729,10 @@ define void @byte_dependent_byte_geps_reverse_order(ptr noalias %p.out, ptr %p0,
; COMPARE-LAA-MV-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP5]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP6]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i32, ptr [[TMP7]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = insertelement <4 x i32> poison, i32 [[TMP8]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i32> [[TMP12]], i32 [[TMP9]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> [[TMP13]], i32 [[TMP10]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = insertelement <4 x i32> poison, i32 [[TMP8]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i32> [[TMP12]], i32 [[TMP9]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i32> [[TMP13]], i32 [[TMP10]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i32> [[TMP14]], i32 [[TMP11]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = sext <4 x i32> [[TMP15]] to <4 x i64>
; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = getelementptr i8, ptr [[P0]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = getelementptr i8, ptr [[P0]], i64 [[TMP1]]
@@ -1742,10 +1742,10 @@ define void @byte_dependent_byte_geps_reverse_order(ptr noalias %p.out, ptr %p0,
; COMPARE-LAA-MV-NEXT: [[TMP22:%.*]] = load i64, ptr [[TMP18]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP23:%.*]] = load i64, ptr [[TMP19]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP24:%.*]] = load i64, ptr [[TMP20]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i64> poison, i64 [[TMP21]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i64> [[TMP25]], i64 [[TMP22]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP27:%.*]] = insertelement <4 x i64> [[TMP26]], i64 [[TMP23]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP28:%.*]] = insertelement <4 x i64> [[TMP27]], i64 [[TMP24]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i64> poison, i64 [[TMP21]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i64> [[TMP25]], i64 [[TMP22]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP27:%.*]] = insertelement <4 x i64> [[TMP26]], i64 [[TMP23]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP28:%.*]] = insertelement <4 x i64> [[TMP27]], i64 [[TMP24]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP29:%.*]] = add <4 x i64> [[TMP28]], [[TMP16]]
; COMPARE-LAA-MV-NEXT: [[TMP30:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP29]], ptr [[TMP30]], align 8
@@ -1833,18 +1833,18 @@ define void @strided_interleave(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP13]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP13]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP21:%.*]] = load i64, ptr [[TMP9]], align 8
; COMPARE-NO-MV-NEXT: [[TMP22:%.*]] = load i64, ptr [[TMP10]], align 8
; COMPARE-NO-MV-NEXT: [[TMP23:%.*]] = load i64, ptr [[TMP11]], align 8
; COMPARE-NO-MV-NEXT: [[TMP24:%.*]] = load i64, ptr [[TMP12]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i64> poison, i64 [[TMP21]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i64> [[TMP25]], i64 [[TMP22]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP27:%.*]] = insertelement <4 x i64> [[TMP26]], i64 [[TMP23]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP28:%.*]] = insertelement <4 x i64> [[TMP27]], i64 [[TMP24]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i64> poison, i64 [[TMP21]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i64> [[TMP25]], i64 [[TMP22]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP27:%.*]] = insertelement <4 x i64> [[TMP26]], i64 [[TMP23]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP28:%.*]] = insertelement <4 x i64> [[TMP27]], i64 [[TMP24]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP29:%.*]] = add <4 x i64> [[TMP20]], [[TMP28]]
; COMPARE-NO-MV-NEXT: [[TMP30:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP29]], ptr [[TMP30]], align 8
@@ -1953,10 +1953,10 @@ define void @in_loop_base(ptr noalias %p.out, ptr %p, i64 %stride, i64 %offset)
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -2060,10 +2060,10 @@ define void @base_not_in_ir(ptr noalias %p.out, ptr %p, i64 %stride, i64 %offset
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -2164,10 +2164,10 @@ define void @non_invariant_uniform_base(ptr noalias %p.out, ptr %p, i64 %stride)
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP10]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP11]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP11]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP18]], ptr [[TMP19]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -2205,10 +2205,10 @@ define void @non_invariant_uniform_base(ptr noalias %p.out, ptr %p, i64 %stride)
; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP10]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP11]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> poison, i64 [[TMP11]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP19:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP18]], ptr [[TMP19]], align 8
; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -2273,10 +2273,10 @@ define void @non_invariant_uniform_stride(ptr noalias %p.out, ptr %p, ptr %p.uni
; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP10]], align 8
; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP11]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP19]], ptr [[TMP20]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -2315,10 +2315,10 @@ define void @non_invariant_uniform_stride(ptr noalias %p.out, ptr %p, ptr %p.uni
; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP10]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP11]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> poison, i64 [[TMP12]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP20:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP19]], ptr [[TMP20]], align 8
; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -2357,806 +2357,8 @@ exit:
ret void
}
-; Not valuable by itself, but as a basis for the subsequent test to ensure that
-; non-constant trip count doesn't change anything by itself. Also show the order
-; of checks between stride speculation and trip-count check when not
-; tail-folding.
-define void @non_constant_btc(ptr noalias %p.out, ptr %p, i64 %stride, i64 %n) {
-; COMPARE-NO-MV-LABEL: define void @non_constant_btc(
-; COMPARE-NO-MV-SAME: ptr noalias [[P_OUT:%.*]], ptr [[P:%.*]], i64 [[STRIDE:%.*]], i64 [[N:%.*]]) {
-; COMPARE-NO-MV-NEXT: [[ENTRY:.*]]:
-; COMPARE-NO-MV-NEXT: [[SMAX:%.*]] = call i64 @llvm.smax.i64(i64 [[N]], i64 1)
-; COMPARE-NO-MV-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[SMAX]], 4
-; COMPARE-NO-MV-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
-; COMPARE-NO-MV: [[VECTOR_PH]]:
-; COMPARE-NO-MV-NEXT: [[N_MOD_VF:%.*]] = and i64 [[SMAX]], 3
-; COMPARE-NO-MV-NEXT: [[N_VEC:%.*]] = sub i64 [[SMAX]], [[N_MOD_VF]]
-; COMPARE-NO-MV-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i64> poison, i64 [[STRIDE]], i64 0
-; COMPARE-NO-MV-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
-; COMPARE-NO-MV-NEXT: br label %[[VECTOR_BODY:.*]]
-; COMPARE-NO-MV: [[VECTOR_BODY]]:
-; COMPARE-NO-MV-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; COMPARE-NO-MV-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; COMPARE-NO-MV-NEXT: [[TMP0:%.*]] = mul <4 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
-; COMPARE-NO-MV-NEXT: [[TMP1:%.*]] = extractelement <4 x i64> [[TMP0]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP5:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP1]]
-; COMPARE-NO-MV-NEXT: [[TMP2:%.*]] = extractelement <4 x i64> [[TMP0]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP6:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP2]]
-; COMPARE-NO-MV-NEXT: [[TMP3:%.*]] = extractelement <4 x i64> [[TMP0]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP7:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP3]]
-; COMPARE-NO-MV-NEXT: [[TMP4:%.*]] = extractelement <4 x i64> [[TMP0]], i64 3
-; COMPARE-NO-MV-NEXT: [[TMP8:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP4]]
-; COMPARE-NO-MV-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP5]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
-; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
-; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
-; COMPARE-NO-MV-NEXT: [[VEC_IND_NEXT]] = add nsw <4 x i64> [[VEC_IND]], splat (i64 4)
-; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
-; COMPARE-NO-MV-NEXT: br i1 [[TMP18]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP22:![0-9]+]]
-; COMPARE-NO-MV: [[MIDDLE_BLOCK]]:
-; COMPARE-NO-MV-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[SMAX]], [[N_VEC]]
-; COMPARE-NO-MV-NEXT: br i1 [[CMP_N]], label %[[EXIT:.*]], label %[[SCALAR_PH]]
-; COMPARE-NO-MV: [[SCALAR_PH]]:
-; COMPARE-NO-MV-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], %[[MIDDLE_BLOCK]] ], [ 0, %[[ENTRY]] ]
-; COMPARE-NO-MV-NEXT: br label %[[HEADER:.*]]
-; COMPARE-NO-MV: [[HEADER]]:
-; COMPARE-NO-MV-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], %[[HEADER]] ]
-; COMPARE-NO-MV-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 1
-; COMPARE-NO-MV-NEXT: [[IDX:%.*]] = mul i64 [[IV]], [[STRIDE]]
-; COMPARE-NO-MV-NEXT: [[GEP_LD:%.*]] = getelementptr i64, ptr [[P]], i64 [[IDX]]
-; COMPARE-NO-MV-NEXT: [[LD:%.*]] = load i64, ptr [[GEP_LD]], align 8
-; COMPARE-NO-MV-NEXT: [[GEP_ST:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[IV]]
-; COMPARE-NO-MV-NEXT: store i64 [[LD]], ptr [[GEP_ST]], align 8
-; COMPARE-NO-MV-NEXT: [[EXITCOND:%.*]] = icmp slt i64 [[IV_NEXT]], [[N]]
-; COMPARE-NO-MV-NEXT: br i1 [[EXITCOND]], label %[[HEADER]], label %[[EXIT]], !llvm.loop [[LOOP23:![0-9]+]]
-; COMPARE-NO-MV: [[EXIT]]:
-; COMPARE-NO-MV-NEXT: ret void
-;
-; COMPARE-LAA-MV-LABEL: define void @non_constant_btc(
-; COMPARE-LAA-MV-SAME: ptr noalias [[P_OUT:%.*]], ptr [[P:%.*]], i64 [[STRIDE:%.*]], i64 [[N:%.*]]) {
-; COMPARE-LAA-MV-NEXT: [[ENTRY:.*]]:
-; COMPARE-LAA-MV-NEXT: [[SMAX:%.*]] = call i64 @llvm.smax.i64(i64 [[N]], i64 1)
-; COMPARE-LAA-MV-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[SMAX]], 4
-; COMPARE-LAA-MV-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_SCEVCHECK:.*]]
-; COMPARE-LAA-MV: [[VECTOR_SCEVCHECK]]:
-; COMPARE-LAA-MV-NEXT: [[IDENT_CHECK:%.*]] = icmp ne i64 [[STRIDE]], 1
-; COMPARE-LAA-MV-NEXT: br i1 [[IDENT_CHECK]], label %[[SCALAR_PH]], label %[[VECTOR_PH:.*]]
-; COMPARE-LAA-MV: [[VECTOR_PH]]:
-; COMPARE-LAA-MV-NEXT: [[N_MOD_VF:%.*]] = and i64 [[SMAX]], 3
-; COMPARE-LAA-MV-NEXT: [[N_VEC:%.*]] = sub i64 [[SMAX]], [[N_MOD_VF]]
-; COMPARE-LAA-MV-NEXT: br label %[[VECTOR_BODY:.*]]
-; COMPARE-LAA-MV: [[VECTOR_BODY]]:
-; COMPARE-LAA-MV-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; COMPARE-LAA-MV-NEXT: [[TMP0:%.*]] = getelementptr i64, ptr [[P]], i64 [[INDEX]]
-; COMPARE-LAA-MV-NEXT: [[WIDE_LOAD:%.*]] = load <4 x i64>, ptr [[TMP0]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP1:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
-; COMPARE-LAA-MV-NEXT: store <4 x i64> [[WIDE_LOAD]], ptr [[TMP1]], align 8
-; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
-; COMPARE-LAA-MV-NEXT: [[TMP2:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
-; COMPARE-LAA-MV-NEXT: br i1 [[TMP2]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP33:![0-9]+]]
-; COMPARE-LAA-MV: [[MIDDLE_BLOCK]]:
-; COMPARE-LAA-MV-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[SMAX]], [[N_VEC]]
-; COMPARE-LAA-MV-NEXT: br i1 [[CMP_N]], label %[[EXIT:.*]], label %[[SCALAR_PH]]
-; COMPARE-LAA-MV: [[SCALAR_PH]]:
-; COMPARE-LAA-MV-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], %[[MIDDLE_BLOCK]] ], [ 0, %[[ENTRY]] ], [ 0, %[[VECTOR_SCEVCHECK]] ]
-; COMPARE-LAA-MV-NEXT: br label %[[HEADER:.*]]
-; COMPARE-LAA-MV: [[HEADER]]:
-; COMPARE-LAA-MV-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], %[[HEADER]] ]
-; COMPARE-LAA-MV-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 1
-; COMPARE-LAA-MV-NEXT: [[IDX:%.*]] = mul i64 [[IV]], [[STRIDE]]
-; COMPARE-LAA-MV-NEXT: [[GEP_LD:%.*]] = getelementptr i64, ptr [[P]], i64 [[IDX]]
-; COMPARE-LAA-MV-NEXT: [[LD:%.*]] = load i64, ptr [[GEP_LD]], align 8
-; COMPARE-LAA-MV-NEXT: [[GEP_ST:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[IV]]
-; COMPARE-LAA-MV-NEXT: store i64 [[LD]], ptr [[GEP_ST]], align 8
-; COMPARE-LAA-MV-NEXT: [[EXITCOND:%.*]] = icmp slt i64 [[IV_NEXT]], [[N]]
-; COMPARE-LAA-MV-NEXT: br i1 [[EXITCOND]], label %[[HEADER]], label %[[EXIT]], !llvm.loop [[LOOP34:![0-9]+]]
-; COMPARE-LAA-MV: [[EXIT]]:
-; COMPARE-LAA-MV-NEXT: ret void
-;
-entry:
- br label %header
-
-header:
- %iv = phi i64 [ 0, %entry ], [ %iv.next, %header ]
- %iv.next = add nsw i64 %iv, 1
-
- %idx = mul i64 %iv, %stride
-
- %gep.ld = getelementptr i64, ptr %p, i64 %idx
- %ld = load i64, ptr %gep.ld, align 8
-
- %gep.st = getelementptr i64, ptr %p.out, i64 %iv
- store i64 %ld, ptr %gep.st, align 8
-
- %exitcond = icmp slt i64 %iv.next, %n
- br i1 %exitcond, label %header, label %exit
-
-exit:
- ret void
-}
-
-; BTC == stride, so stride speculation would result in zero vector loop
-; iterations.
-define void @stride_as_btc(ptr noalias %p.out, ptr %p, i64 %stride) {
-; COMPARE-NO-MV-LABEL: define void @stride_as_btc(
-; COMPARE-NO-MV-SAME: ptr noalias [[P_OUT:%.*]], ptr [[P:%.*]], i64 [[STRIDE:%.*]]) {
-; COMPARE-NO-MV-NEXT: [[ENTRY:.*]]:
-; COMPARE-NO-MV-NEXT: [[SMAX:%.*]] = call i64 @llvm.smax.i64(i64 [[STRIDE]], i64 1)
-; COMPARE-NO-MV-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[SMAX]], 4
-; COMPARE-NO-MV-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
-; COMPARE-NO-MV: [[VECTOR_PH]]:
-; COMPARE-NO-MV-NEXT: [[N_MOD_VF:%.*]] = and i64 [[SMAX]], 3
-; COMPARE-NO-MV-NEXT: [[N_VEC:%.*]] = sub i64 [[SMAX]], [[N_MOD_VF]]
-; COMPARE-NO-MV-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i64> poison, i64 [[STRIDE]], i64 0
-; COMPARE-NO-MV-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
-; COMPARE-NO-MV-NEXT: br label %[[VECTOR_BODY:.*]]
-; COMPARE-NO-MV: [[VECTOR_BODY]]:
-; COMPARE-NO-MV-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; COMPARE-NO-MV-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; COMPARE-NO-MV-NEXT: [[TMP0:%.*]] = mul <4 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
-; COMPARE-NO-MV-NEXT: [[TMP1:%.*]] = extractelement <4 x i64> [[TMP0]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP5:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP1]]
-; COMPARE-NO-MV-NEXT: [[TMP2:%.*]] = extractelement <4 x i64> [[TMP0]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP6:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP2]]
-; COMPARE-NO-MV-NEXT: [[TMP3:%.*]] = extractelement <4 x i64> [[TMP0]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP7:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP3]]
-; COMPARE-NO-MV-NEXT: [[TMP4:%.*]] = extractelement <4 x i64> [[TMP0]], i64 3
-; COMPARE-NO-MV-NEXT: [[TMP8:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP4]]
-; COMPARE-NO-MV-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP5]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
-; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
-; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
-; COMPARE-NO-MV-NEXT: [[VEC_IND_NEXT]] = add nsw <4 x i64> [[VEC_IND]], splat (i64 4)
-; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
-; COMPARE-NO-MV-NEXT: br i1 [[TMP18]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP24:![0-9]+]]
-; COMPARE-NO-MV: [[MIDDLE_BLOCK]]:
-; COMPARE-NO-MV-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[SMAX]], [[N_VEC]]
-; COMPARE-NO-MV-NEXT: br i1 [[CMP_N]], label %[[EXIT:.*]], label %[[SCALAR_PH]]
-; COMPARE-NO-MV: [[SCALAR_PH]]:
-; COMPARE-NO-MV-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], %[[MIDDLE_BLOCK]] ], [ 0, %[[ENTRY]] ]
-; COMPARE-NO-MV-NEXT: br label %[[HEADER:.*]]
-; COMPARE-NO-MV: [[HEADER]]:
-; COMPARE-NO-MV-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], %[[HEADER]] ]
-; COMPARE-NO-MV-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 1
-; COMPARE-NO-MV-NEXT: [[IDX:%.*]] = mul i64 [[IV]], [[STRIDE]]
-; COMPARE-NO-MV-NEXT: [[GEP_LD:%.*]] = getelementptr i64, ptr [[P]], i64 [[IDX]]
-; COMPARE-NO-MV-NEXT: [[LD:%.*]] = load i64, ptr [[GEP_LD]], align 8
-; COMPARE-NO-MV-NEXT: [[GEP_ST:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[IV]]
-; COMPARE-NO-MV-NEXT: store i64 [[LD]], ptr [[GEP_ST]], align 8
-; COMPARE-NO-MV-NEXT: [[EXITCOND:%.*]] = icmp slt i64 [[IV_NEXT]], [[STRIDE]]
-; COMPARE-NO-MV-NEXT: br i1 [[EXITCOND]], label %[[HEADER]], label %[[EXIT]], !llvm.loop [[LOOP25:![0-9]+]]
-; COMPARE-NO-MV: [[EXIT]]:
-; COMPARE-NO-MV-NEXT: ret void
-;
-; COMPARE-LAA-MV-LABEL: define void @stride_as_btc(
-; COMPARE-LAA-MV-SAME: ptr noalias [[P_OUT:%.*]], ptr [[P:%.*]], i64 [[STRIDE:%.*]]) {
-; COMPARE-LAA-MV-NEXT: [[ENTRY:.*]]:
-; COMPARE-LAA-MV-NEXT: br label %[[HEADER:.*]]
-; COMPARE-LAA-MV: [[HEADER]]:
-; COMPARE-LAA-MV-NEXT: [[IV:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[HEADER]] ]
-; COMPARE-LAA-MV-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 1
-; COMPARE-LAA-MV-NEXT: [[IDX:%.*]] = mul i64 [[IV]], [[STRIDE]]
-; COMPARE-LAA-MV-NEXT: [[GEP_LD:%.*]] = getelementptr i64, ptr [[P]], i64 [[IDX]]
-; COMPARE-LAA-MV-NEXT: [[LD:%.*]] = load i64, ptr [[GEP_LD]], align 8
-; COMPARE-LAA-MV-NEXT: [[GEP_ST:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[IV]]
-; COMPARE-LAA-MV-NEXT: store i64 [[LD]], ptr [[GEP_ST]], align 8
-; COMPARE-LAA-MV-NEXT: [[EXITCOND:%.*]] = icmp slt i64 [[IV_NEXT]], [[STRIDE]]
-; COMPARE-LAA-MV-NEXT: br i1 [[EXITCOND]], label %[[HEADER]], label %[[EXIT:.*]]
-; COMPARE-LAA-MV: [[EXIT]]:
-; COMPARE-LAA-MV-NEXT: ret void
-;
-entry:
- br label %header
-
-header:
- %iv = phi i64 [ 0, %entry ], [ %iv.next, %header ]
- %iv.next = add nsw i64 %iv, 1
-
- %idx = mul i64 %iv, %stride
-
- %gep.ld = getelementptr i64, ptr %p, i64 %idx
- %ld = load i64, ptr %gep.ld, align 8
-
- %gep.st = getelementptr i64, ptr %p.out, i64 %iv
- store i64 %ld, ptr %gep.st, align 8
-
- %exitcond = icmp slt i64 %iv.next, %stride
- br i1 %exitcond, label %header, label %exit
-
-exit:
- ret void
-}
-
-; Similar to above but a slightly more complex dependency between stride and
-; BTC.
-define void @stride_dependent_btc(ptr noalias %p.out, ptr %p, i64 %stride) {
-; COMPARE-NO-MV-LABEL: define void @stride_dependent_btc(
-; COMPARE-NO-MV-SAME: ptr noalias [[P_OUT:%.*]], ptr [[P:%.*]], i64 [[STRIDE:%.*]]) {
-; COMPARE-NO-MV-NEXT: [[ENTRY:.*]]:
-; COMPARE-NO-MV-NEXT: [[N:%.*]] = add i64 [[STRIDE]], 1
-; COMPARE-NO-MV-NEXT: [[SMAX:%.*]] = call i64 @llvm.smax.i64(i64 [[N]], i64 1)
-; COMPARE-NO-MV-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[SMAX]], 4
-; COMPARE-NO-MV-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
-; COMPARE-NO-MV: [[VECTOR_PH]]:
-; COMPARE-NO-MV-NEXT: [[N_MOD_VF:%.*]] = and i64 [[SMAX]], 3
-; COMPARE-NO-MV-NEXT: [[N_VEC:%.*]] = sub i64 [[SMAX]], [[N_MOD_VF]]
-; COMPARE-NO-MV-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i64> poison, i64 [[STRIDE]], i64 0
-; COMPARE-NO-MV-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
-; COMPARE-NO-MV-NEXT: br label %[[VECTOR_BODY:.*]]
-; COMPARE-NO-MV: [[VECTOR_BODY]]:
-; COMPARE-NO-MV-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; COMPARE-NO-MV-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; COMPARE-NO-MV-NEXT: [[TMP0:%.*]] = mul <4 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
-; COMPARE-NO-MV-NEXT: [[TMP1:%.*]] = extractelement <4 x i64> [[TMP0]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP5:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP1]]
-; COMPARE-NO-MV-NEXT: [[TMP2:%.*]] = extractelement <4 x i64> [[TMP0]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP6:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP2]]
-; COMPARE-NO-MV-NEXT: [[TMP3:%.*]] = extractelement <4 x i64> [[TMP0]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP7:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP3]]
-; COMPARE-NO-MV-NEXT: [[TMP4:%.*]] = extractelement <4 x i64> [[TMP0]], i64 3
-; COMPARE-NO-MV-NEXT: [[TMP8:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP4]]
-; COMPARE-NO-MV-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP5]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
-; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
-; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
-; COMPARE-NO-MV-NEXT: [[VEC_IND_NEXT]] = add nsw <4 x i64> [[VEC_IND]], splat (i64 4)
-; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
-; COMPARE-NO-MV-NEXT: br i1 [[TMP18]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP26:![0-9]+]]
-; COMPARE-NO-MV: [[MIDDLE_BLOCK]]:
-; COMPARE-NO-MV-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[SMAX]], [[N_VEC]]
-; COMPARE-NO-MV-NEXT: br i1 [[CMP_N]], label %[[EXIT:.*]], label %[[SCALAR_PH]]
-; COMPARE-NO-MV: [[SCALAR_PH]]:
-; COMPARE-NO-MV-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], %[[MIDDLE_BLOCK]] ], [ 0, %[[ENTRY]] ]
-; COMPARE-NO-MV-NEXT: br label %[[HEADER:.*]]
-; COMPARE-NO-MV: [[HEADER]]:
-; COMPARE-NO-MV-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], %[[HEADER]] ]
-; COMPARE-NO-MV-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 1
-; COMPARE-NO-MV-NEXT: [[IDX:%.*]] = mul i64 [[IV]], [[STRIDE]]
-; COMPARE-NO-MV-NEXT: [[GEP_LD:%.*]] = getelementptr i64, ptr [[P]], i64 [[IDX]]
-; COMPARE-NO-MV-NEXT: [[LD:%.*]] = load i64, ptr [[GEP_LD]], align 8
-; COMPARE-NO-MV-NEXT: [[GEP_ST:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[IV]]
-; COMPARE-NO-MV-NEXT: store i64 [[LD]], ptr [[GEP_ST]], align 8
-; COMPARE-NO-MV-NEXT: [[EXITCOND:%.*]] = icmp slt i64 [[IV_NEXT]], [[N]]
-; COMPARE-NO-MV-NEXT: br i1 [[EXITCOND]], label %[[HEADER]], label %[[EXIT]], !llvm.loop [[LOOP27:![0-9]+]]
-; COMPARE-NO-MV: [[EXIT]]:
-; COMPARE-NO-MV-NEXT: ret void
-;
-; COMPARE-LAA-MV-LABEL: define void @stride_dependent_btc(
-; COMPARE-LAA-MV-SAME: ptr noalias [[P_OUT:%.*]], ptr [[P:%.*]], i64 [[STRIDE:%.*]]) {
-; COMPARE-LAA-MV-NEXT: [[ENTRY:.*]]:
-; COMPARE-LAA-MV-NEXT: [[N:%.*]] = add i64 [[STRIDE]], 1
-; COMPARE-LAA-MV-NEXT: br label %[[HEADER:.*]]
-; COMPARE-LAA-MV: [[HEADER]]:
-; COMPARE-LAA-MV-NEXT: [[IV:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[HEADER]] ]
-; COMPARE-LAA-MV-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 1
-; COMPARE-LAA-MV-NEXT: [[IDX:%.*]] = mul i64 [[IV]], [[STRIDE]]
-; COMPARE-LAA-MV-NEXT: [[GEP_LD:%.*]] = getelementptr i64, ptr [[P]], i64 [[IDX]]
-; COMPARE-LAA-MV-NEXT: [[LD:%.*]] = load i64, ptr [[GEP_LD]], align 8
-; COMPARE-LAA-MV-NEXT: [[GEP_ST:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[IV]]
-; COMPARE-LAA-MV-NEXT: store i64 [[LD]], ptr [[GEP_ST]], align 8
-; COMPARE-LAA-MV-NEXT: [[EXITCOND:%.*]] = icmp slt i64 [[IV_NEXT]], [[N]]
-; COMPARE-LAA-MV-NEXT: br i1 [[EXITCOND]], label %[[HEADER]], label %[[EXIT:.*]]
-; COMPARE-LAA-MV: [[EXIT]]:
-; COMPARE-LAA-MV-NEXT: ret void
-;
-entry:
- %n = add i64 %stride, 1
- br label %header
-
-header:
- %iv = phi i64 [ 0, %entry ], [ %iv.next, %header ]
- %iv.next = add nsw i64 %iv, 1
-
- %idx = mul i64 %iv, %stride
-
- %gep.ld = getelementptr i64, ptr %p, i64 %idx
- %ld = load i64, ptr %gep.ld, align 8
-
- %gep.st = getelementptr i64, ptr %p.out, i64 %iv
- store i64 %ld, ptr %gep.st, align 8
-
- %exitcond = icmp slt i64 %iv.next, %n
- br i1 %exitcond, label %header, label %exit
-
-exit:
- ret void
-}
-
-; BTC dependent on %stride, but stride speculation doesn't necessarily mean no
-; vector loop iterations. The test shows in which order we emit the run time
-; checks for both.
-define void @stride_btc_checks_order(ptr noalias %p.out, ptr %p, i64 %stride, i64 %m) {
-; COMPARE-NO-MV-LABEL: define void @stride_btc_checks_order(
-; COMPARE-NO-MV-SAME: ptr noalias [[P_OUT:%.*]], ptr [[P:%.*]], i64 [[STRIDE:%.*]], i64 [[M:%.*]]) {
-; COMPARE-NO-MV-NEXT: [[ENTRY:.*]]:
-; COMPARE-NO-MV-NEXT: [[N:%.*]] = mul i64 [[M]], [[STRIDE]]
-; COMPARE-NO-MV-NEXT: [[SMAX:%.*]] = call i64 @llvm.smax.i64(i64 [[N]], i64 1)
-; COMPARE-NO-MV-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[SMAX]], 4
-; COMPARE-NO-MV-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
-; COMPARE-NO-MV: [[VECTOR_PH]]:
-; COMPARE-NO-MV-NEXT: [[N_MOD_VF:%.*]] = and i64 [[SMAX]], 3
-; COMPARE-NO-MV-NEXT: [[N_VEC:%.*]] = sub i64 [[SMAX]], [[N_MOD_VF]]
-; COMPARE-NO-MV-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i64> poison, i64 [[STRIDE]], i64 0
-; COMPARE-NO-MV-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
-; COMPARE-NO-MV-NEXT: br label %[[VECTOR_BODY:.*]]
-; COMPARE-NO-MV: [[VECTOR_BODY]]:
-; COMPARE-NO-MV-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; COMPARE-NO-MV-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; COMPARE-NO-MV-NEXT: [[TMP0:%.*]] = mul <4 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
-; COMPARE-NO-MV-NEXT: [[TMP1:%.*]] = extractelement <4 x i64> [[TMP0]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP5:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP1]]
-; COMPARE-NO-MV-NEXT: [[TMP2:%.*]] = extractelement <4 x i64> [[TMP0]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP6:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP2]]
-; COMPARE-NO-MV-NEXT: [[TMP3:%.*]] = extractelement <4 x i64> [[TMP0]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP7:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP3]]
-; COMPARE-NO-MV-NEXT: [[TMP4:%.*]] = extractelement <4 x i64> [[TMP0]], i64 3
-; COMPARE-NO-MV-NEXT: [[TMP8:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP4]]
-; COMPARE-NO-MV-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP5]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
-; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
-; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
-; COMPARE-NO-MV-NEXT: [[VEC_IND_NEXT]] = add nsw <4 x i64> [[VEC_IND]], splat (i64 4)
-; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
-; COMPARE-NO-MV-NEXT: br i1 [[TMP18]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP28:![0-9]+]]
-; COMPARE-NO-MV: [[MIDDLE_BLOCK]]:
-; COMPARE-NO-MV-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[SMAX]], [[N_VEC]]
-; COMPARE-NO-MV-NEXT: br i1 [[CMP_N]], label %[[EXIT:.*]], label %[[SCALAR_PH]]
-; COMPARE-NO-MV: [[SCALAR_PH]]:
-; COMPARE-NO-MV-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], %[[MIDDLE_BLOCK]] ], [ 0, %[[ENTRY]] ]
-; COMPARE-NO-MV-NEXT: br label %[[HEADER:.*]]
-; COMPARE-NO-MV: [[HEADER]]:
-; COMPARE-NO-MV-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], %[[HEADER]] ]
-; COMPARE-NO-MV-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 1
-; COMPARE-NO-MV-NEXT: [[IDX:%.*]] = mul i64 [[IV]], [[STRIDE]]
-; COMPARE-NO-MV-NEXT: [[GEP_LD:%.*]] = getelementptr i64, ptr [[P]], i64 [[IDX]]
-; COMPARE-NO-MV-NEXT: [[LD:%.*]] = load i64, ptr [[GEP_LD]], align 8
-; COMPARE-NO-MV-NEXT: [[GEP_ST:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[IV]]
-; COMPARE-NO-MV-NEXT: store i64 [[LD]], ptr [[GEP_ST]], align 8
-; COMPARE-NO-MV-NEXT: [[EXITCOND:%.*]] = icmp slt i64 [[IV_NEXT]], [[N]]
-; COMPARE-NO-MV-NEXT: br i1 [[EXITCOND]], label %[[HEADER]], label %[[EXIT]], !llvm.loop [[LOOP29:![0-9]+]]
-; COMPARE-NO-MV: [[EXIT]]:
-; COMPARE-NO-MV-NEXT: ret void
-;
-; COMPARE-LAA-MV-LABEL: define void @stride_btc_checks_order(
-; COMPARE-LAA-MV-SAME: ptr noalias [[P_OUT:%.*]], ptr [[P:%.*]], i64 [[STRIDE:%.*]], i64 [[M:%.*]]) {
-; COMPARE-LAA-MV-NEXT: [[ENTRY:.*]]:
-; COMPARE-LAA-MV-NEXT: [[N:%.*]] = mul i64 [[M]], [[STRIDE]]
-; COMPARE-LAA-MV-NEXT: [[SMAX2:%.*]] = call i64 @llvm.smax.i64(i64 [[N]], i64 1)
-; COMPARE-LAA-MV-NEXT: [[SMAX1:%.*]] = call i64 @llvm.smax.i64(i64 [[M]], i64 1)
-; COMPARE-LAA-MV-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[SMAX1]], 4
-; COMPARE-LAA-MV-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_SCEVCHECK:.*]]
-; COMPARE-LAA-MV: [[VECTOR_SCEVCHECK]]:
-; COMPARE-LAA-MV-NEXT: [[IDENT_CHECK:%.*]] = icmp ne i64 [[STRIDE]], 1
-; COMPARE-LAA-MV-NEXT: br i1 [[IDENT_CHECK]], label %[[SCALAR_PH]], label %[[VECTOR_PH:.*]]
-; COMPARE-LAA-MV: [[VECTOR_PH]]:
-; COMPARE-LAA-MV-NEXT: [[N_MOD_VF:%.*]] = and i64 [[SMAX1]], 3
-; COMPARE-LAA-MV-NEXT: [[N_VEC:%.*]] = sub i64 [[SMAX1]], [[N_MOD_VF]]
-; COMPARE-LAA-MV-NEXT: br label %[[VECTOR_BODY:.*]]
-; COMPARE-LAA-MV: [[VECTOR_BODY]]:
-; COMPARE-LAA-MV-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; COMPARE-LAA-MV-NEXT: [[TMP0:%.*]] = getelementptr i64, ptr [[P]], i64 [[INDEX]]
-; COMPARE-LAA-MV-NEXT: [[WIDE_LOAD:%.*]] = load <4 x i64>, ptr [[TMP0]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP1:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
-; COMPARE-LAA-MV-NEXT: store <4 x i64> [[WIDE_LOAD]], ptr [[TMP1]], align 8
-; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
-; COMPARE-LAA-MV-NEXT: [[TMP2:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
-; COMPARE-LAA-MV-NEXT: br i1 [[TMP2]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP35:![0-9]+]]
-; COMPARE-LAA-MV: [[MIDDLE_BLOCK]]:
-; COMPARE-LAA-MV-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[SMAX1]], [[N_VEC]]
-; COMPARE-LAA-MV-NEXT: br i1 [[CMP_N]], label %[[EXIT:.*]], label %[[SCALAR_PH]]
-; COMPARE-LAA-MV: [[SCALAR_PH]]:
-; COMPARE-LAA-MV-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], %[[MIDDLE_BLOCK]] ], [ 0, %[[ENTRY]] ], [ 0, %[[VECTOR_SCEVCHECK]] ]
-; COMPARE-LAA-MV-NEXT: br label %[[HEADER:.*]]
-; COMPARE-LAA-MV: [[HEADER]]:
-; COMPARE-LAA-MV-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], %[[HEADER]] ]
-; COMPARE-LAA-MV-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 1
-; COMPARE-LAA-MV-NEXT: [[IDX:%.*]] = mul i64 [[IV]], [[STRIDE]]
-; COMPARE-LAA-MV-NEXT: [[GEP_LD:%.*]] = getelementptr i64, ptr [[P]], i64 [[IDX]]
-; COMPARE-LAA-MV-NEXT: [[LD:%.*]] = load i64, ptr [[GEP_LD]], align 8
-; COMPARE-LAA-MV-NEXT: [[GEP_ST:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[IV]]
-; COMPARE-LAA-MV-NEXT: store i64 [[LD]], ptr [[GEP_ST]], align 8
-; COMPARE-LAA-MV-NEXT: [[EXITCOND:%.*]] = icmp slt i64 [[IV_NEXT]], [[N]]
-; COMPARE-LAA-MV-NEXT: br i1 [[EXITCOND]], label %[[HEADER]], label %[[EXIT]], !llvm.loop [[LOOP36:![0-9]+]]
-; COMPARE-LAA-MV: [[EXIT]]:
-; COMPARE-LAA-MV-NEXT: ret void
-;
-entry:
- %n = mul i64 %m, %stride
- br label %header
-
-header:
- %iv = phi i64 [ 0, %entry ], [ %iv.next, %header ]
- %iv.next = add nsw i64 %iv, 1
-
- %idx = mul i64 %iv, %stride
-
- %gep.ld = getelementptr i64, ptr %p, i64 %idx
- %ld = load i64, ptr %gep.ld, align 8
-
- %gep.st = getelementptr i64, ptr %p.out, i64 %iv
- store i64 %ld, ptr %gep.st, align 8
-
- %exitcond = icmp slt i64 %iv.next, %n
- br i1 %exitcond, label %header, label %exit
-
-exit:
- ret void
-}
-
-; BTC fully defined by stride speculation but still allows vector loop execution.
-define void @stride_dependent_btc_non_preventive(ptr noalias %p.out, ptr %p, i64 %stride) {
-; COMPARE-NO-MV-LABEL: define void @stride_dependent_btc_non_preventive(
-; COMPARE-NO-MV-SAME: ptr noalias [[P_OUT:%.*]], ptr [[P:%.*]], i64 [[STRIDE:%.*]]) {
-; COMPARE-NO-MV-NEXT: [[ENTRY:.*]]:
-; COMPARE-NO-MV-NEXT: [[N:%.*]] = add i64 [[STRIDE]], 3
-; COMPARE-NO-MV-NEXT: [[SMAX:%.*]] = call i64 @llvm.smax.i64(i64 [[N]], i64 1)
-; COMPARE-NO-MV-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[SMAX]], 4
-; COMPARE-NO-MV-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
-; COMPARE-NO-MV: [[VECTOR_PH]]:
-; COMPARE-NO-MV-NEXT: [[N_MOD_VF:%.*]] = and i64 [[SMAX]], 3
-; COMPARE-NO-MV-NEXT: [[N_VEC:%.*]] = sub i64 [[SMAX]], [[N_MOD_VF]]
-; COMPARE-NO-MV-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i64> poison, i64 [[STRIDE]], i64 0
-; COMPARE-NO-MV-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
-; COMPARE-NO-MV-NEXT: br label %[[VECTOR_BODY:.*]]
-; COMPARE-NO-MV: [[VECTOR_BODY]]:
-; COMPARE-NO-MV-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; COMPARE-NO-MV-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; COMPARE-NO-MV-NEXT: [[TMP0:%.*]] = mul <4 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
-; COMPARE-NO-MV-NEXT: [[TMP1:%.*]] = extractelement <4 x i64> [[TMP0]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP5:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP1]]
-; COMPARE-NO-MV-NEXT: [[TMP2:%.*]] = extractelement <4 x i64> [[TMP0]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP6:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP2]]
-; COMPARE-NO-MV-NEXT: [[TMP3:%.*]] = extractelement <4 x i64> [[TMP0]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP7:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP3]]
-; COMPARE-NO-MV-NEXT: [[TMP4:%.*]] = extractelement <4 x i64> [[TMP0]], i64 3
-; COMPARE-NO-MV-NEXT: [[TMP8:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP4]]
-; COMPARE-NO-MV-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP5]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
-; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
-; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
-; COMPARE-NO-MV-NEXT: [[VEC_IND_NEXT]] = add nsw <4 x i64> [[VEC_IND]], splat (i64 4)
-; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
-; COMPARE-NO-MV-NEXT: br i1 [[TMP18]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP30:![0-9]+]]
-; COMPARE-NO-MV: [[MIDDLE_BLOCK]]:
-; COMPARE-NO-MV-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[SMAX]], [[N_VEC]]
-; COMPARE-NO-MV-NEXT: br i1 [[CMP_N]], label %[[EXIT:.*]], label %[[SCALAR_PH]]
-; COMPARE-NO-MV: [[SCALAR_PH]]:
-; COMPARE-NO-MV-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], %[[MIDDLE_BLOCK]] ], [ 0, %[[ENTRY]] ]
-; COMPARE-NO-MV-NEXT: br label %[[HEADER:.*]]
-; COMPARE-NO-MV: [[HEADER]]:
-; COMPARE-NO-MV-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], %[[HEADER]] ]
-; COMPARE-NO-MV-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 1
-; COMPARE-NO-MV-NEXT: [[IDX:%.*]] = mul i64 [[IV]], [[STRIDE]]
-; COMPARE-NO-MV-NEXT: [[GEP_LD:%.*]] = getelementptr i64, ptr [[P]], i64 [[IDX]]
-; COMPARE-NO-MV-NEXT: [[LD:%.*]] = load i64, ptr [[GEP_LD]], align 8
-; COMPARE-NO-MV-NEXT: [[GEP_ST:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[IV]]
-; COMPARE-NO-MV-NEXT: store i64 [[LD]], ptr [[GEP_ST]], align 8
-; COMPARE-NO-MV-NEXT: [[EXITCOND:%.*]] = icmp slt i64 [[IV_NEXT]], [[N]]
-; COMPARE-NO-MV-NEXT: br i1 [[EXITCOND]], label %[[HEADER]], label %[[EXIT]], !llvm.loop [[LOOP31:![0-9]+]]
-; COMPARE-NO-MV: [[EXIT]]:
-; COMPARE-NO-MV-NEXT: ret void
-;
-; COMPARE-LAA-MV-LABEL: define void @stride_dependent_btc_non_preventive(
-; COMPARE-LAA-MV-SAME: ptr noalias [[P_OUT:%.*]], ptr [[P:%.*]], i64 [[STRIDE:%.*]]) {
-; COMPARE-LAA-MV-NEXT: [[ENTRY:.*:]]
-; COMPARE-LAA-MV-NEXT: [[N:%.*]] = add i64 [[STRIDE]], 3
-; COMPARE-LAA-MV-NEXT: [[SMAX:%.*]] = call i64 @llvm.smax.i64(i64 [[N]], i64 1)
-; COMPARE-LAA-MV-NEXT: br label %[[VECTOR_SCEVCHECK:.*]]
-; COMPARE-LAA-MV: [[VECTOR_SCEVCHECK]]:
-; COMPARE-LAA-MV-NEXT: [[IDENT_CHECK:%.*]] = icmp ne i64 [[STRIDE]], 1
-; COMPARE-LAA-MV-NEXT: br i1 [[IDENT_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_PH:.*]]
-; COMPARE-LAA-MV: [[VECTOR_PH]]:
-; COMPARE-LAA-MV-NEXT: br label %[[VECTOR_BODY:.*]]
-; COMPARE-LAA-MV: [[VECTOR_BODY]]:
-; COMPARE-LAA-MV-NEXT: [[WIDE_LOAD:%.*]] = load <4 x i64>, ptr [[P]], align 8
-; COMPARE-LAA-MV-NEXT: store <4 x i64> [[WIDE_LOAD]], ptr [[P_OUT]], align 8
-; COMPARE-LAA-MV-NEXT: br label %[[MIDDLE_BLOCK:.*]]
-; COMPARE-LAA-MV: [[MIDDLE_BLOCK]]:
-; COMPARE-LAA-MV-NEXT: br label %[[EXIT:.*]]
-; COMPARE-LAA-MV: [[SCALAR_PH]]:
-; COMPARE-LAA-MV-NEXT: br label %[[HEADER:.*]]
-; COMPARE-LAA-MV: [[HEADER]]:
-; COMPARE-LAA-MV-NEXT: [[IV:%.*]] = phi i64 [ 0, %[[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], %[[HEADER]] ]
-; COMPARE-LAA-MV-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 1
-; COMPARE-LAA-MV-NEXT: [[IDX:%.*]] = mul i64 [[IV]], [[STRIDE]]
-; COMPARE-LAA-MV-NEXT: [[GEP_LD:%.*]] = getelementptr i64, ptr [[P]], i64 [[IDX]]
-; COMPARE-LAA-MV-NEXT: [[LD:%.*]] = load i64, ptr [[GEP_LD]], align 8
-; COMPARE-LAA-MV-NEXT: [[GEP_ST:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[IV]]
-; COMPARE-LAA-MV-NEXT: store i64 [[LD]], ptr [[GEP_ST]], align 8
-; COMPARE-LAA-MV-NEXT: [[EXITCOND:%.*]] = icmp slt i64 [[IV_NEXT]], [[N]]
-; COMPARE-LAA-MV-NEXT: br i1 [[EXITCOND]], label %[[HEADER]], label %[[EXIT]], !llvm.loop [[LOOP37:![0-9]+]]
-; COMPARE-LAA-MV: [[EXIT]]:
-; COMPARE-LAA-MV-NEXT: ret void
-;
-entry:
- %n = add i64 %stride, 3
- br label %header
-
-header:
- %iv = phi i64 [ 0, %entry ], [ %iv.next, %header ]
- %iv.next = add nsw i64 %iv, 1
-
- %idx = mul i64 %iv, %stride
-
- %gep.ld = getelementptr i64, ptr %p, i64 %idx
- %ld = load i64, ptr %gep.ld, align 8
-
- %gep.st = getelementptr i64, ptr %p.out, i64 %iv
- store i64 %ld, ptr %gep.st, align 8
-
- %exitcond = icmp slt i64 %iv.next, %n
- br i1 %exitcond, label %header, label %exit
-
-exit:
- ret void
-}
-
-; Doesn't pass legality as run-time memory dependencies check doesn't support
-; strided accesses. If it did, the purpose of this test would be to show how all
-; three run-time checks (mem deps/stride speculation/trip-count) would be
-; ordered in respect to each other. Note that pointer aliasing check could
-; potentially be simplified if done after stride speculation. However, that
-; isn't necessarily the best idea because we could also multi-version for stride
-; and keep aliasing part generic and shared by both vector loops..
-define void @stride_btc_memdep_triple_check(ptr %p, i64 %stride, i64 %out.offset) {
-; COMPARE-NO-MV-LABEL: define void @stride_btc_memdep_triple_check(
-; COMPARE-NO-MV-SAME: ptr [[P:%.*]], i64 [[STRIDE:%.*]], i64 [[OUT_OFFSET:%.*]]) {
-; COMPARE-NO-MV-NEXT: [[ENTRY:.*]]:
-; COMPARE-NO-MV-NEXT: [[P_OUT:%.*]] = getelementptr i8, ptr [[P]], i64 [[OUT_OFFSET]]
-; COMPARE-NO-MV-NEXT: [[N:%.*]] = add i64 [[STRIDE]], 3
-; COMPARE-NO-MV-NEXT: br label %[[HEADER:.*]]
-; COMPARE-NO-MV: [[HEADER]]:
-; COMPARE-NO-MV-NEXT: [[IV:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[HEADER]] ]
-; COMPARE-NO-MV-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 1
-; COMPARE-NO-MV-NEXT: [[IDX:%.*]] = mul i64 [[IV]], [[STRIDE]]
-; COMPARE-NO-MV-NEXT: [[GEP_LD:%.*]] = getelementptr i64, ptr [[P]], i64 [[IDX]]
-; COMPARE-NO-MV-NEXT: [[LD:%.*]] = load i64, ptr [[GEP_LD]], align 8
-; COMPARE-NO-MV-NEXT: [[GEP_ST:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[IV]]
-; COMPARE-NO-MV-NEXT: store i64 [[LD]], ptr [[GEP_ST]], align 8
-; COMPARE-NO-MV-NEXT: [[EXITCOND:%.*]] = icmp slt i64 [[IV_NEXT]], [[N]]
-; COMPARE-NO-MV-NEXT: br i1 [[EXITCOND]], label %[[HEADER]], label %[[EXIT:.*]]
-; COMPARE-NO-MV: [[EXIT]]:
-; COMPARE-NO-MV-NEXT: ret void
-;
-; COMPARE-LAA-MV-LABEL: define void @stride_btc_memdep_triple_check(
-; COMPARE-LAA-MV-SAME: ptr [[P:%.*]], i64 [[STRIDE:%.*]], i64 [[OUT_OFFSET:%.*]]) {
-; COMPARE-LAA-MV-NEXT: [[ENTRY:.*:]]
-; COMPARE-LAA-MV-NEXT: [[P_OUT:%.*]] = getelementptr i8, ptr [[P]], i64 [[OUT_OFFSET]]
-; COMPARE-LAA-MV-NEXT: [[N:%.*]] = add i64 [[STRIDE]], 3
-; COMPARE-LAA-MV-NEXT: [[SMAX:%.*]] = call i64 @llvm.smax.i64(i64 [[N]], i64 1)
-; COMPARE-LAA-MV-NEXT: br label %[[VECTOR_SCEVCHECK:.*]]
-; COMPARE-LAA-MV: [[VECTOR_SCEVCHECK]]:
-; COMPARE-LAA-MV-NEXT: [[IDENT_CHECK:%.*]] = icmp ne i64 [[STRIDE]], 1
-; COMPARE-LAA-MV-NEXT: br i1 [[IDENT_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_MEMCHECK:.*]]
-; COMPARE-LAA-MV: [[VECTOR_MEMCHECK]]:
-; COMPARE-LAA-MV-NEXT: [[TMP0:%.*]] = sub i64 [[OUT_OFFSET]], 1
-; COMPARE-LAA-MV-NEXT: [[DIFF_CHECK:%.*]] = icmp ult i64 [[TMP0]], 31
-; COMPARE-LAA-MV-NEXT: br i1 [[DIFF_CHECK]], label %[[SCALAR_PH]], label %[[VECTOR_PH:.*]]
-; COMPARE-LAA-MV: [[VECTOR_PH]]:
-; COMPARE-LAA-MV-NEXT: br label %[[VECTOR_BODY:.*]]
-; COMPARE-LAA-MV: [[VECTOR_BODY]]:
-; COMPARE-LAA-MV-NEXT: [[WIDE_LOAD:%.*]] = load <4 x i64>, ptr [[P]], align 8
-; COMPARE-LAA-MV-NEXT: store <4 x i64> [[WIDE_LOAD]], ptr [[P_OUT]], align 8
-; COMPARE-LAA-MV-NEXT: br label %[[MIDDLE_BLOCK:.*]]
-; COMPARE-LAA-MV: [[MIDDLE_BLOCK]]:
-; COMPARE-LAA-MV-NEXT: br label %[[EXIT:.*]]
-; COMPARE-LAA-MV: [[SCALAR_PH]]:
-; COMPARE-LAA-MV-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ 0, %[[VECTOR_SCEVCHECK]] ], [ 0, %[[VECTOR_MEMCHECK]] ]
-; COMPARE-LAA-MV-NEXT: br label %[[HEADER:.*]]
-; COMPARE-LAA-MV: [[HEADER]]:
-; COMPARE-LAA-MV-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], %[[HEADER]] ]
-; COMPARE-LAA-MV-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 1
-; COMPARE-LAA-MV-NEXT: [[IDX:%.*]] = mul i64 [[IV]], [[STRIDE]]
-; COMPARE-LAA-MV-NEXT: [[GEP_LD:%.*]] = getelementptr i64, ptr [[P]], i64 [[IDX]]
-; COMPARE-LAA-MV-NEXT: [[LD:%.*]] = load i64, ptr [[GEP_LD]], align 8
-; COMPARE-LAA-MV-NEXT: [[GEP_ST:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[IV]]
-; COMPARE-LAA-MV-NEXT: store i64 [[LD]], ptr [[GEP_ST]], align 8
-; COMPARE-LAA-MV-NEXT: [[EXITCOND:%.*]] = icmp slt i64 [[IV_NEXT]], [[N]]
-; COMPARE-LAA-MV-NEXT: br i1 [[EXITCOND]], label %[[HEADER]], label %[[EXIT]], !llvm.loop [[LOOP38:![0-9]+]]
-; COMPARE-LAA-MV: [[EXIT]]:
-; COMPARE-LAA-MV-NEXT: ret void
-;
-entry:
- %p.out = getelementptr i8, ptr %p, i64 %out.offset
- %n = add i64 %stride, 3
- br label %header
-
-header:
- %iv = phi i64 [ 0, %entry ], [ %iv.next, %header ]
- %iv.next = add nsw i64 %iv, 1
-
- %idx = mul i64 %iv, %stride
-
- %gep.ld = getelementptr i64, ptr %p, i64 %idx
- %ld = load i64, ptr %gep.ld, align 8
-
- %gep.st = getelementptr i64, ptr %p.out, i64 %iv
- store i64 %ld, ptr %gep.st, align 8
-
- %exitcond = icmp slt i64 %iv.next, %n
- br i1 %exitcond, label %header, label %exit
-
-exit:
- ret void
-}
-
-; Same as above but memdep check doesn't depend on stride
-define void @stride_btc_independent_memdep_triple_check(ptr %p, ptr noalias %p2, i64 %stride, i64 %out.offset) {
-; COMPARE-NO-MV-LABEL: define void @stride_btc_independent_memdep_triple_check(
-; COMPARE-NO-MV-SAME: ptr [[P:%.*]], ptr noalias [[P2:%.*]], i64 [[STRIDE:%.*]], i64 [[OUT_OFFSET:%.*]]) {
-; COMPARE-NO-MV-NEXT: [[ENTRY:.*]]:
-; COMPARE-NO-MV-NEXT: [[P_OUT:%.*]] = getelementptr i8, ptr [[P2]], i64 [[OUT_OFFSET]]
-; COMPARE-NO-MV-NEXT: [[N:%.*]] = add i64 [[STRIDE]], 3
-; COMPARE-NO-MV-NEXT: [[SMAX:%.*]] = call i64 @llvm.smax.i64(i64 [[N]], i64 1)
-; COMPARE-NO-MV-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[SMAX]], 4
-; COMPARE-NO-MV-NEXT: br i1 [[MIN_ITERS_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_MEMCHECK:.*]]
-; COMPARE-NO-MV: [[VECTOR_MEMCHECK]]:
-; COMPARE-NO-MV-NEXT: [[TMP21:%.*]] = sub i64 [[OUT_OFFSET]], 1
-; COMPARE-NO-MV-NEXT: [[DIFF_CHECK:%.*]] = icmp ult i64 [[TMP21]], 31
-; COMPARE-NO-MV-NEXT: br i1 [[DIFF_CHECK]], label %[[SCALAR_PH]], label %[[VECTOR_PH:.*]]
-; COMPARE-NO-MV: [[VECTOR_PH]]:
-; COMPARE-NO-MV-NEXT: [[N_MOD_VF:%.*]] = and i64 [[SMAX]], 3
-; COMPARE-NO-MV-NEXT: [[N_VEC:%.*]] = sub i64 [[SMAX]], [[N_MOD_VF]]
-; COMPARE-NO-MV-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i64> poison, i64 [[STRIDE]], i64 0
-; COMPARE-NO-MV-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i64> [[BROADCAST_SPLATINSERT]], <4 x i64> poison, <4 x i32> zeroinitializer
-; COMPARE-NO-MV-NEXT: br label %[[VECTOR_BODY:.*]]
-; COMPARE-NO-MV: [[VECTOR_BODY]]:
-; COMPARE-NO-MV-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; COMPARE-NO-MV-NEXT: [[VEC_IND:%.*]] = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %[[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], %[[VECTOR_BODY]] ]
-; COMPARE-NO-MV-NEXT: [[TMP0:%.*]] = mul <4 x i64> [[VEC_IND]], [[BROADCAST_SPLAT]]
-; COMPARE-NO-MV-NEXT: [[TMP1:%.*]] = extractelement <4 x i64> [[TMP0]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP5:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP1]]
-; COMPARE-NO-MV-NEXT: [[TMP2:%.*]] = extractelement <4 x i64> [[TMP0]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP6:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP2]]
-; COMPARE-NO-MV-NEXT: [[TMP3:%.*]] = extractelement <4 x i64> [[TMP0]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP7:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP3]]
-; COMPARE-NO-MV-NEXT: [[TMP4:%.*]] = extractelement <4 x i64> [[TMP0]], i64 3
-; COMPARE-NO-MV-NEXT: [[TMP8:%.*]] = getelementptr i64, ptr [[P]], i64 [[TMP4]]
-; COMPARE-NO-MV-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP5]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P2]], i64 [[INDEX]]
-; COMPARE-NO-MV-NEXT: [[WIDE_LOAD:%.*]] = load <4 x i64>, ptr [[TMP17]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = add <4 x i64> [[TMP16]], [[WIDE_LOAD]]
-; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
-; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP18]], ptr [[TMP19]], align 8
-; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
-; COMPARE-NO-MV-NEXT: [[VEC_IND_NEXT]] = add nsw <4 x i64> [[VEC_IND]], splat (i64 4)
-; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
-; COMPARE-NO-MV-NEXT: br i1 [[TMP20]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP32:![0-9]+]]
-; COMPARE-NO-MV: [[MIDDLE_BLOCK]]:
-; COMPARE-NO-MV-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[SMAX]], [[N_VEC]]
-; COMPARE-NO-MV-NEXT: br i1 [[CMP_N]], label %[[EXIT:.*]], label %[[SCALAR_PH]]
-; COMPARE-NO-MV: [[SCALAR_PH]]:
-; COMPARE-NO-MV-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], %[[MIDDLE_BLOCK]] ], [ 0, %[[ENTRY]] ], [ 0, %[[VECTOR_MEMCHECK]] ]
-; COMPARE-NO-MV-NEXT: br label %[[HEADER:.*]]
-; COMPARE-NO-MV: [[HEADER]]:
-; COMPARE-NO-MV-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], %[[HEADER]] ]
-; COMPARE-NO-MV-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 1
-; COMPARE-NO-MV-NEXT: [[IDX:%.*]] = mul i64 [[IV]], [[STRIDE]]
-; COMPARE-NO-MV-NEXT: [[GEP_LD:%.*]] = getelementptr i64, ptr [[P]], i64 [[IDX]]
-; COMPARE-NO-MV-NEXT: [[LD:%.*]] = load i64, ptr [[GEP_LD]], align 8
-; COMPARE-NO-MV-NEXT: [[GEP_LD2:%.*]] = getelementptr i64, ptr [[P2]], i64 [[IV]]
-; COMPARE-NO-MV-NEXT: [[LD2:%.*]] = load i64, ptr [[GEP_LD2]], align 8
-; COMPARE-NO-MV-NEXT: [[VAL:%.*]] = add i64 [[LD]], [[LD2]]
-; COMPARE-NO-MV-NEXT: [[GEP_ST:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[IV]]
-; COMPARE-NO-MV-NEXT: store i64 [[VAL]], ptr [[GEP_ST]], align 8
-; COMPARE-NO-MV-NEXT: [[EXITCOND:%.*]] = icmp slt i64 [[IV_NEXT]], [[N]]
-; COMPARE-NO-MV-NEXT: br i1 [[EXITCOND]], label %[[HEADER]], label %[[EXIT]], !llvm.loop [[LOOP33:![0-9]+]]
-; COMPARE-NO-MV: [[EXIT]]:
-; COMPARE-NO-MV-NEXT: ret void
-;
-; COMPARE-LAA-MV-LABEL: define void @stride_btc_independent_memdep_triple_check(
-; COMPARE-LAA-MV-SAME: ptr [[P:%.*]], ptr noalias [[P2:%.*]], i64 [[STRIDE:%.*]], i64 [[OUT_OFFSET:%.*]]) {
-; COMPARE-LAA-MV-NEXT: [[ENTRY:.*:]]
-; COMPARE-LAA-MV-NEXT: [[P_OUT:%.*]] = getelementptr i8, ptr [[P2]], i64 [[OUT_OFFSET]]
-; COMPARE-LAA-MV-NEXT: [[N:%.*]] = add i64 [[STRIDE]], 3
-; COMPARE-LAA-MV-NEXT: [[SMAX:%.*]] = call i64 @llvm.smax.i64(i64 [[N]], i64 1)
-; COMPARE-LAA-MV-NEXT: br label %[[VECTOR_SCEVCHECK:.*]]
-; COMPARE-LAA-MV: [[VECTOR_SCEVCHECK]]:
-; COMPARE-LAA-MV-NEXT: [[IDENT_CHECK:%.*]] = icmp ne i64 [[STRIDE]], 1
-; COMPARE-LAA-MV-NEXT: br i1 [[IDENT_CHECK]], label %[[SCALAR_PH:.*]], label %[[VECTOR_MEMCHECK:.*]]
-; COMPARE-LAA-MV: [[VECTOR_MEMCHECK]]:
-; COMPARE-LAA-MV-NEXT: [[TMP1:%.*]] = sub i64 [[OUT_OFFSET]], 1
-; COMPARE-LAA-MV-NEXT: [[DIFF_CHECK:%.*]] = icmp ult i64 [[TMP1]], 31
-; COMPARE-LAA-MV-NEXT: br i1 [[DIFF_CHECK]], label %[[SCALAR_PH]], label %[[VECTOR_PH:.*]]
-; COMPARE-LAA-MV: [[VECTOR_PH]]:
-; COMPARE-LAA-MV-NEXT: br label %[[VECTOR_BODY:.*]]
-; COMPARE-LAA-MV: [[VECTOR_BODY]]:
-; COMPARE-LAA-MV-NEXT: [[WIDE_LOAD:%.*]] = load <4 x i64>, ptr [[P]], align 8
-; COMPARE-LAA-MV-NEXT: [[WIDE_LOAD1:%.*]] = load <4 x i64>, ptr [[P2]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP0:%.*]] = add <4 x i64> [[WIDE_LOAD]], [[WIDE_LOAD1]]
-; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP0]], ptr [[P_OUT]], align 8
-; COMPARE-LAA-MV-NEXT: br label %[[MIDDLE_BLOCK:.*]]
-; COMPARE-LAA-MV: [[MIDDLE_BLOCK]]:
-; COMPARE-LAA-MV-NEXT: br label %[[EXIT:.*]]
-; COMPARE-LAA-MV: [[SCALAR_PH]]:
-; COMPARE-LAA-MV-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ 0, %[[VECTOR_SCEVCHECK]] ], [ 0, %[[VECTOR_MEMCHECK]] ]
-; COMPARE-LAA-MV-NEXT: br label %[[HEADER:.*]]
-; COMPARE-LAA-MV: [[HEADER]]:
-; COMPARE-LAA-MV-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], %[[HEADER]] ]
-; COMPARE-LAA-MV-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 1
-; COMPARE-LAA-MV-NEXT: [[IDX:%.*]] = mul i64 [[IV]], [[STRIDE]]
-; COMPARE-LAA-MV-NEXT: [[GEP_LD:%.*]] = getelementptr i64, ptr [[P]], i64 [[IDX]]
-; COMPARE-LAA-MV-NEXT: [[LD:%.*]] = load i64, ptr [[GEP_LD]], align 8
-; COMPARE-LAA-MV-NEXT: [[GEP_LD2:%.*]] = getelementptr i64, ptr [[P2]], i64 [[IV]]
-; COMPARE-LAA-MV-NEXT: [[LD2:%.*]] = load i64, ptr [[GEP_LD2]], align 8
-; COMPARE-LAA-MV-NEXT: [[VAL:%.*]] = add i64 [[LD]], [[LD2]]
-; COMPARE-LAA-MV-NEXT: [[GEP_ST:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[IV]]
-; COMPARE-LAA-MV-NEXT: store i64 [[VAL]], ptr [[GEP_ST]], align 8
-; COMPARE-LAA-MV-NEXT: [[EXITCOND:%.*]] = icmp slt i64 [[IV_NEXT]], [[N]]
-; COMPARE-LAA-MV-NEXT: br i1 [[EXITCOND]], label %[[HEADER]], label %[[EXIT]], !llvm.loop [[LOOP39:![0-9]+]]
-; COMPARE-LAA-MV: [[EXIT]]:
-; COMPARE-LAA-MV-NEXT: ret void
-;
-entry:
- %p.out = getelementptr i8, ptr %p2, i64 %out.offset
- %n = add i64 %stride, 3
- br label %header
-
-header:
- %iv = phi i64 [ 0, %entry ], [ %iv.next, %header ]
- %iv.next = add nsw i64 %iv, 1
-
- %idx = mul i64 %iv, %stride
-
- %gep.ld = getelementptr i64, ptr %p, i64 %idx
- %ld = load i64, ptr %gep.ld, align 8
-
- %gep.ld2 = getelementptr i64, ptr %p2, i64 %iv
- %ld2 = load i64, ptr %gep.ld2, align 8
-
- %val = add i64 %ld, %ld2
-
- %gep.st = getelementptr i64, ptr %p.out, i64 %iv
- store i64 %val, ptr %gep.st, align 8
-
- %exitcond = icmp slt i64 %iv.next, %n
- br i1 %exitcond, label %header, label %exit
-
-exit:
- ret void
-}
+;; BTC-related functions from VPlan/vplan-based-stride-mv.ll are in
+;; vplan-based-stride-mv-btc with extra RUN lines for scalable vectors.
define void @actual_stride_not_in_ir(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-NO-MV-LABEL: define void @actual_stride_not_in_ir(
@@ -3187,10 +2389,10 @@ define void @actual_stride_not_in_ir(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP10]], align 8
; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP11]], align 8
; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP12]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP13]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP13]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP21:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP20]], ptr [[TMP21]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -3230,10 +2432,10 @@ define void @actual_stride_not_in_ir(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = load i64, ptr [[TMP10]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = load i64, ptr [[TMP11]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = load i64, ptr [[TMP12]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP13]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> poison, i64 [[TMP13]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP18:%.*]] = insertelement <4 x i64> [[TMP17]], i64 [[TMP14]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP19:%.*]] = insertelement <4 x i64> [[TMP18]], i64 [[TMP15]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP20:%.*]] = insertelement <4 x i64> [[TMP19]], i64 [[TMP16]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP21:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP20]], ptr [[TMP21]], align 8
; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -3296,10 +2498,10 @@ define void @nd_array_last_idx(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -3396,10 +2598,10 @@ define void @nd_array_non_last_idx(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -3433,10 +2635,10 @@ define void @nd_array_non_last_idx(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-LAA-MV-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP5]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = insertelement <4 x i64> poison, i64 [[TMP8]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> [[TMP12]], i64 [[TMP9]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = insertelement <4 x i64> poison, i64 [[TMP8]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> [[TMP12]], i64 [[TMP9]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP15]], ptr [[TMP16]], align 8
; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -3507,10 +2709,10 @@ define void @nd_array_multiple_idxs(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -3546,10 +2748,10 @@ define void @nd_array_multiple_idxs(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-LAA-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -3610,10 +2812,10 @@ define void @sext_stride(ptr noalias %p.out, ptr %p, i32 %stride.i32) {
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -3725,10 +2927,10 @@ define void @trunc_stride(ptr noalias %p.out, ptr %p, i64 %stride.i64) {
; COMPARE-NO-MV-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP16]], align 8
; COMPARE-NO-MV-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP18]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP23:%.*]] = insertelement <4 x i32> poison, i32 [[TMP19]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> [[TMP23]], i32 [[TMP20]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i32> [[TMP24]], i32 [[TMP21]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i32> [[TMP25]], i32 [[TMP22]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP23:%.*]] = insertelement <4 x i32> poison, i32 [[TMP19]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP24:%.*]] = insertelement <4 x i32> [[TMP23]], i32 [[TMP20]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP25:%.*]] = insertelement <4 x i32> [[TMP24]], i32 [[TMP21]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP26:%.*]] = insertelement <4 x i32> [[TMP25]], i32 [[TMP22]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP27:%.*]] = getelementptr i32, ptr [[P_OUT]], i32 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i32> [[TMP26]], ptr [[TMP27]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i32 [[INDEX]], 4
@@ -3866,18 +3068,18 @@ define void @trunc_ext_stride(ptr noalias %p.out, ptr %p0, ptr %p1, i32 %stride)
; COMPARE-NO-MV-NEXT: [[TMP28:%.*]] = load i32, ptr [[TMP20]], align 4
; COMPARE-NO-MV-NEXT: [[TMP29:%.*]] = load i32, ptr [[TMP21]], align 4
; COMPARE-NO-MV-NEXT: [[TMP30:%.*]] = load i32, ptr [[TMP22]], align 4
-; COMPARE-NO-MV-NEXT: [[TMP31:%.*]] = insertelement <4 x i32> poison, i32 [[TMP27]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP32:%.*]] = insertelement <4 x i32> [[TMP31]], i32 [[TMP28]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP33:%.*]] = insertelement <4 x i32> [[TMP32]], i32 [[TMP29]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP34:%.*]] = insertelement <4 x i32> [[TMP33]], i32 [[TMP30]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP31:%.*]] = insertelement <4 x i32> poison, i32 [[TMP27]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP32:%.*]] = insertelement <4 x i32> [[TMP31]], i32 [[TMP28]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP33:%.*]] = insertelement <4 x i32> [[TMP32]], i32 [[TMP29]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP34:%.*]] = insertelement <4 x i32> [[TMP33]], i32 [[TMP30]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP35:%.*]] = load i32, ptr [[TMP23]], align 4
; COMPARE-NO-MV-NEXT: [[TMP36:%.*]] = load i32, ptr [[TMP24]], align 4
; COMPARE-NO-MV-NEXT: [[TMP37:%.*]] = load i32, ptr [[TMP25]], align 4
; COMPARE-NO-MV-NEXT: [[TMP38:%.*]] = load i32, ptr [[TMP26]], align 4
-; COMPARE-NO-MV-NEXT: [[TMP39:%.*]] = insertelement <4 x i32> poison, i32 [[TMP35]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP40:%.*]] = insertelement <4 x i32> [[TMP39]], i32 [[TMP36]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP41:%.*]] = insertelement <4 x i32> [[TMP40]], i32 [[TMP37]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP42:%.*]] = insertelement <4 x i32> [[TMP41]], i32 [[TMP38]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP39:%.*]] = insertelement <4 x i32> poison, i32 [[TMP35]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP40:%.*]] = insertelement <4 x i32> [[TMP39]], i32 [[TMP36]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP41:%.*]] = insertelement <4 x i32> [[TMP40]], i32 [[TMP37]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP42:%.*]] = insertelement <4 x i32> [[TMP41]], i32 [[TMP38]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP43:%.*]] = add <4 x i32> [[TMP34]], [[TMP42]]
; COMPARE-NO-MV-NEXT: [[TMP44:%.*]] = getelementptr i32, ptr [[P_OUT]], i32 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i32> [[TMP43]], ptr [[TMP44]], align 8
@@ -4192,10 +3394,10 @@ define void @stride_poison(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-NO-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -4229,10 +3431,10 @@ define void @stride_poison(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-LAA-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-LAA-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; COMPARE-LAA-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-LAA-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-LAA-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-LAA-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-LAA-MV-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-LAA-MV-NEXT: store <4 x i64> [[TMP16]], ptr [[TMP17]], align 8
; COMPARE-LAA-MV-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
@@ -4388,10 +3590,10 @@ define void @ptr_vec_use(ptr noalias %p.out, ptr noalias %p.ptr.out, ptr %p, i64
; COMPARE-NO-MV-NEXT: [[TMP8:%.*]] = load i64, ptr [[TMP4]], align 8
; COMPARE-NO-MV-NEXT: [[TMP5:%.*]] = extractelement <4 x ptr> [[TMP1]], i64 3
; COMPARE-NO-MV-NEXT: [[TMP9:%.*]] = load i64, ptr [[TMP5]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = insertelement <4 x i64> poison, i64 [[TMP6]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = insertelement <4 x i64> [[TMP10]], i64 [[TMP7]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = insertelement <4 x i64> [[TMP11]], i64 [[TMP8]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> [[TMP12]], i64 [[TMP9]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = insertelement <4 x i64> poison, i64 [[TMP6]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = insertelement <4 x i64> [[TMP10]], i64 [[TMP7]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = insertelement <4 x i64> [[TMP11]], i64 [[TMP8]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> [[TMP12]], i64 [[TMP9]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP13]], ptr [[TMP14]], align 8
; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = getelementptr ptr, ptr [[P_PTR_OUT]], i64 [[INDEX]]
@@ -4499,10 +3701,10 @@ define void @stride_idx_vec_use(ptr noalias %p.out, ptr %p, i64 %stride) {
; COMPARE-NO-MV-NEXT: [[TMP10:%.*]] = load i64, ptr [[TMP6]], align 8
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = insertelement <4 x i64> poison, i64 [[TMP9]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> [[TMP13]], i64 [[TMP10]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = mul <4 x i64> [[TMP16]], [[TMP0]]
; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP17]], ptr [[TMP18]], align 8
@@ -4605,10 +3807,10 @@ define void @offset_stride_idx_vec_use(ptr noalias %p.out, ptr %p, i64 %stride)
; COMPARE-NO-MV-NEXT: [[TMP11:%.*]] = load i64, ptr [[TMP7]], align 8
; COMPARE-NO-MV-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP8]], align 8
; COMPARE-NO-MV-NEXT: [[TMP13:%.*]] = load i64, ptr [[TMP9]], align 8
-; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i64 0
-; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i64 1
-; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i64 2
-; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i64 3
+; COMPARE-NO-MV-NEXT: [[TMP14:%.*]] = insertelement <4 x i64> poison, i64 [[TMP10]], i32 0
+; COMPARE-NO-MV-NEXT: [[TMP15:%.*]] = insertelement <4 x i64> [[TMP14]], i64 [[TMP11]], i32 1
+; COMPARE-NO-MV-NEXT: [[TMP16:%.*]] = insertelement <4 x i64> [[TMP15]], i64 [[TMP12]], i32 2
+; COMPARE-NO-MV-NEXT: [[TMP17:%.*]] = insertelement <4 x i64> [[TMP16]], i64 [[TMP13]], i32 3
; COMPARE-NO-MV-NEXT: [[TMP18:%.*]] = mul <4 x i64> [[TMP17]], [[TMP1]]
; COMPARE-NO-MV-NEXT: [[TMP19:%.*]] = getelementptr i64, ptr [[P_OUT]], i64 [[INDEX]]
; COMPARE-NO-MV-NEXT: store <4 x i64> [[TMP18]], ptr [[TMP19]], align 8
diff --git a/llvm/test/Transforms/SLPVectorizer/RISCV/spillcost-loop-invariant-gather.ll b/llvm/test/Transforms/SLPVectorizer/RISCV/spillcost-loop-invariant-gather.ll
deleted file mode 100644
index eef5e69113f6e..0000000000000
--- a/llvm/test/Transforms/SLPVectorizer/RISCV/spillcost-loop-invariant-gather.ll
+++ /dev/null
@@ -1,83 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt -S < %s -passes=slp-vectorizer -mtriple=riscv64 -mattr=+v | FileCheck %s
-
-declare void @g()
-
-; A loop-invariant buildvector (%b,%c) feeding the vectorized fmul is hoisted
-; to the preheader by optimizeGatherSequence, so its vector value is live
-; across the call in the loop body and must be spilled/reloaded around it.
-; Charging that keep-live cost makes this marginal tree unprofitable, so it
-; must stay scalar.
-define void @invariant_gather_over_call(ptr %out, ptr %in, double %a, double %b, double %c, double %d, i64 %n) {
-; CHECK-LABEL: define void @invariant_gather_over_call(
-; CHECK-SAME: ptr [[OUT:%.*]], ptr [[IN:%.*]], double [[A:%.*]], double [[B:%.*]], double [[C:%.*]], double [[D:%.*]], i64 [[N:%.*]]) #[[ATTR0:[0-9]+]] {
-; CHECK-NEXT: [[ENTRY:.*]]:
-; CHECK-NEXT: br label %[[LOOP:.*]]
-; CHECK: [[LOOP]]:
-; CHECK-NEXT: [[I:%.*]] = phi i64 [ 0, %[[ENTRY]] ], [ [[INC:%.*]], %[[LOOP]] ]
-; CHECK-NEXT: [[P0:%.*]] = getelementptr inbounds double, ptr [[IN]], i64 [[I]]
-; CHECK-NEXT: [[V0:%.*]] = load double, ptr [[P0]], align 8
-; CHECK-NEXT: [[I1:%.*]] = add nuw nsw i64 [[I]], 3
-; CHECK-NEXT: [[P1:%.*]] = getelementptr inbounds double, ptr [[IN]], i64 [[I1]]
-; CHECK-NEXT: [[V1:%.*]] = load double, ptr [[P1]], align 8
-; CHECK-NEXT: [[I2:%.*]] = add nuw nsw i64 [[I]], 7
-; CHECK-NEXT: [[P2:%.*]] = getelementptr inbounds double, ptr [[IN]], i64 [[I2]]
-; CHECK-NEXT: [[V2:%.*]] = load double, ptr [[P2]], align 8
-; CHECK-NEXT: [[I3:%.*]] = add nuw nsw i64 [[I]], 100
-; CHECK-NEXT: [[P3:%.*]] = getelementptr inbounds double, ptr [[IN]], i64 [[I3]]
-; CHECK-NEXT: [[V3:%.*]] = load double, ptr [[P3]], align 8
-; CHECK-NEXT: [[R0:%.*]] = fmul double [[V0]], [[A]]
-; CHECK-NEXT: [[R1:%.*]] = fmul double [[V1]], [[B]]
-; CHECK-NEXT: [[R2:%.*]] = fmul double [[V2]], [[C]]
-; CHECK-NEXT: [[R3:%.*]] = fmul double [[V3]], [[D]]
-; CHECK-NEXT: [[O0:%.*]] = getelementptr inbounds double, ptr [[OUT]], i64 [[I]]
-; CHECK-NEXT: [[O1:%.*]] = getelementptr inbounds double, ptr [[O0]], i64 1
-; CHECK-NEXT: [[O2:%.*]] = getelementptr inbounds double, ptr [[O0]], i64 2
-; CHECK-NEXT: [[O3:%.*]] = getelementptr inbounds double, ptr [[O0]], i64 3
-; CHECK-NEXT: store double [[R0]], ptr [[O0]], align 8
-; CHECK-NEXT: store double [[R1]], ptr [[O1]], align 8
-; CHECK-NEXT: store double [[R2]], ptr [[O2]], align 8
-; CHECK-NEXT: store double [[R3]], ptr [[O3]], align 8
-; CHECK-NEXT: call void @g()
-; CHECK-NEXT: [[INC]] = add nuw nsw i64 [[I]], 4
-; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC]], [[N]]
-; CHECK-NEXT: br i1 [[CMP]], label %[[LOOP]], label %[[EXIT:.*]]
-; CHECK: [[EXIT]]:
-; CHECK-NEXT: ret void
-;
-entry:
- br label %loop
-
-loop:
- %i = phi i64 [ 0, %entry ], [ %inc, %loop ]
- %p0 = getelementptr inbounds double, ptr %in, i64 %i
- %v0 = load double, ptr %p0, align 8
- %i1 = add nuw nsw i64 %i, 3
- %p1 = getelementptr inbounds double, ptr %in, i64 %i1
- %v1 = load double, ptr %p1, align 8
- %i2 = add nuw nsw i64 %i, 7
- %p2 = getelementptr inbounds double, ptr %in, i64 %i2
- %v2 = load double, ptr %p2, align 8
- %i3 = add nuw nsw i64 %i, 100
- %p3 = getelementptr inbounds double, ptr %in, i64 %i3
- %v3 = load double, ptr %p3, align 8
- %r0 = fmul double %v0, %a
- %r1 = fmul double %v1, %b
- %r2 = fmul double %v2, %c
- %r3 = fmul double %v3, %d
- %o0 = getelementptr inbounds double, ptr %out, i64 %i
- %o1 = getelementptr inbounds double, ptr %o0, i64 1
- %o2 = getelementptr inbounds double, ptr %o0, i64 2
- %o3 = getelementptr inbounds double, ptr %o0, i64 3
- store double %r0, ptr %o0, align 8
- store double %r1, ptr %o1, align 8
- store double %r2, ptr %o2, align 8
- store double %r3, ptr %o3, align 8
- call void @g()
- %inc = add nuw nsw i64 %i, 4
- %cmp = icmp ult i64 %inc, %n
- br i1 %cmp, label %loop, label %exit
-
-exit:
- ret void
-}
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/reassoc-flattened-copyable-operand.ll b/llvm/test/Transforms/SLPVectorizer/X86/reassoc-flattened-copyable-operand.ll
deleted file mode 100644
index 91368f5b80ead..0000000000000
--- a/llvm/test/Transforms/SLPVectorizer/X86/reassoc-flattened-copyable-operand.ll
+++ /dev/null
@@ -1,99 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
-; RUN: opt -S --passes=slp-vectorizer < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=znver4 | FileCheck %s
-
- at hexsh_ = external global [4496 x i8]
-
-define void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr %5, ptr %6, ptr %7, ptr %_QMshared_common_dataEp2th, double %8, double %9, double %10, double %11, double %12, ptr %_QMshared_common_dataEpone, double %13, double %14, double %15, ptr %16, double %17, double %18, double %19, double %20, double %21, double %22, double %23, double %24, double %25, ptr %_QMshared_common_dataEptwo, ptr %_QMshared_common_dataEpthr, ptr %_QMshared_common_dataEp72th, ptr %26, double %27, double %28, double %29, double %30, double %31, double %32, double %33, double %34, double %35, double %36, double %37, double %38, double %39, double %40, double %41, double %42, double %43, double %44, double %45, double %46, double %47, double %48) {
-; CHECK-LABEL: define void @test(
-; CHECK-SAME: ptr [[TMP0:%.*]], ptr [[TMP1:%.*]], ptr [[TMP2:%.*]], ptr [[TMP3:%.*]], ptr [[TMP4:%.*]], ptr [[TMP5:%.*]], ptr [[TMP6:%.*]], ptr [[TMP7:%.*]], ptr [[_QMSHARED_COMMON_DATAEP2TH:%.*]], double [[TMP8:%.*]], double [[TMP9:%.*]], double [[TMP10:%.*]], double [[TMP11:%.*]], double [[TMP12:%.*]], ptr [[_QMSHARED_COMMON_DATAEPONE:%.*]], double [[TMP13:%.*]], double [[TMP14:%.*]], double [[TMP15:%.*]], ptr [[TMP16:%.*]], double [[TMP17:%.*]], double [[TMP18:%.*]], double [[TMP19:%.*]], double [[TMP20:%.*]], double [[TMP21:%.*]], double [[TMP22:%.*]], double [[TMP23:%.*]], double [[TMP24:%.*]], double [[TMP25:%.*]], ptr [[_QMSHARED_COMMON_DATAEPTWO:%.*]], ptr [[_QMSHARED_COMMON_DATAEPTHR:%.*]], ptr [[_QMSHARED_COMMON_DATAEP72TH:%.*]], ptr [[TMP26:%.*]], double [[TMP27:%.*]], double [[TMP28:%.*]], double [[TMP29:%.*]], double [[TMP30:%.*]], double [[TMP31:%.*]], double [[TMP32:%.*]], double [[TMP33:%.*]], double [[TMP34:%.*]], double [[TMP35:%.*]], double [[TMP36:%.*]], double [[TMP37:%.*]], double [[TMP38:%.*]], double [[TMP39:%.*]], double [[TMP40:%.*]], double [[TMP41:%.*]], double [[TMP42:%.*]], double [[TMP43:%.*]], double [[TMP44:%.*]], double [[TMP45:%.*]], double [[TMP46:%.*]], double [[TMP47:%.*]], double [[TMP48:%.*]]) #[[ATTR0:[0-9]+]] {
-; CHECK-NEXT: [[_PREHEADER4179_PREHEADER:.*:]]
-; CHECK-NEXT: store double 1.000000e+00, ptr [[TMP26]], align 8
-; CHECK-NEXT: [[TMP49:%.*]] = fadd fast double [[TMP38]], 1.000000e+00
-; CHECK-NEXT: [[TMP50:%.*]] = fadd fast double [[TMP42]], 1.000000e+00
-; CHECK-NEXT: store double [[TMP44]], ptr getelementptr inbounds nuw (i8, ptr @hexsh_, i64 224), align 8
-; CHECK-NEXT: [[TMP51:%.*]] = fmul fast double [[TMP8]], [[TMP10]]
-; CHECK-NEXT: [[TMP52:%.*]] = fmul fast double [[TMP8]], [[TMP9]]
-; CHECK-NEXT: [[TMP53:%.*]] = fneg fast double [[TMP25]]
-; CHECK-NEXT: [[TMP54:%.*]] = fadd fast double [[TMP51]], 1.000000e+00
-; CHECK-NEXT: [[TMP55:%.*]] = fmul fast double [[TMP48]], [[TMP40]]
-; CHECK-NEXT: [[TMP56:%.*]] = fmul fast double [[TMP36]], [[TMP46]]
-; CHECK-NEXT: [[TMP57:%.*]] = fmul fast double [[TMP32]], [[TMP40]]
-; CHECK-NEXT: [[TMP58:%.*]] = fmul fast double [[TMP39]], [[TMP40]]
-; CHECK-NEXT: [[TMP59:%.*]] = fadd fast double [[TMP56]], 1.000000e+00
-; CHECK-NEXT: [[TMP60:%.*]] = fmul fast double [[TMP24]], [[TMP53]]
-; CHECK-NEXT: [[TMP61:%.*]] = fmul fast double [[TMP13]], [[TMP51]]
-; CHECK-NEXT: [[TMP62:%.*]] = fmul fast double [[TMP13]], [[TMP52]]
-; CHECK-NEXT: [[TMP63:%.*]] = fmul fast double [[TMP36]], [[TMP62]]
-; CHECK-NEXT: [[TMP64:%.*]] = fmul fast double [[TMP36]], [[TMP61]]
-; CHECK-NEXT: [[TMP65:%.*]] = fmul fast double [[TMP45]], [[TMP62]]
-; CHECK-NEXT: [[TMP66:%.*]] = insertelement <2 x double> poison, double [[TMP65]], i64 0
-; CHECK-NEXT: [[TMP67:%.*]] = insertelement <2 x double> [[TMP66]], double [[TMP64]], i64 1
-; CHECK-NEXT: [[TMP68:%.*]] = fadd fast <2 x double> [[TMP67]], <double -0.000000e+00, double 2.000000e+00>
-; CHECK-NEXT: [[TMP69:%.*]] = fsub fast double [[TMP63]], [[TMP59]]
-; CHECK-NEXT: [[TMP70:%.*]] = insertelement <4 x double> poison, double [[TMP69]], i64 0
-; CHECK-NEXT: [[TMP71:%.*]] = shufflevector <2 x double> [[TMP68]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
-; CHECK-NEXT: [[TMP72:%.*]] = shufflevector <4 x double> [[TMP70]], <4 x double> [[TMP71]], <4 x i32> <i32 0, i32 4, i32 5, i32 poison>
-; CHECK-NEXT: [[TMP73:%.*]] = insertelement <4 x double> [[TMP72]], double [[TMP60]], i64 3
-; CHECK-NEXT: [[TMP74:%.*]] = insertelement <4 x double> poison, double [[TMP47]], i64 0
-; CHECK-NEXT: [[TMP75:%.*]] = insertelement <4 x double> [[TMP74]], double [[TMP55]], i64 1
-; CHECK-NEXT: [[TMP76:%.*]] = insertelement <4 x double> [[TMP75]], double [[TMP62]], i64 2
-; CHECK-NEXT: [[TMP77:%.*]] = insertelement <4 x double> [[TMP76]], double [[TMP54]], i64 3
-; CHECK-NEXT: [[TMP78:%.*]] = fadd fast <4 x double> [[TMP73]], [[TMP77]]
-; CHECK-NEXT: [[TMP79:%.*]] = fsub fast <4 x double> [[TMP73]], [[TMP77]]
-; CHECK-NEXT: [[TMP80:%.*]] = shufflevector <4 x double> [[TMP78]], <4 x double> [[TMP79]], <4 x i32> <i32 0, i32 5, i32 6, i32 7>
-; CHECK-NEXT: [[TMP81:%.*]] = fsub fast double [[TMP50]], [[TMP57]]
-; CHECK-NEXT: [[TMP82:%.*]] = fsub fast double [[TMP49]], [[TMP58]]
-; CHECK-NEXT: [[TMP83:%.*]] = insertelement <8 x double> poison, double [[TMP35]], i64 0
-; CHECK-NEXT: [[TMP84:%.*]] = insertelement <8 x double> [[TMP83]], double [[TMP82]], i64 1
-; CHECK-NEXT: [[TMP85:%.*]] = insertelement <8 x double> [[TMP84]], double [[TMP81]], i64 2
-; CHECK-NEXT: [[TMP86:%.*]] = insertelement <8 x double> [[TMP85]], double [[TMP61]], i64 3
-; CHECK-NEXT: [[TMP87:%.*]] = shufflevector <4 x double> [[TMP80]], <4 x double> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>
-; CHECK-NEXT: [[TMP88:%.*]] = shufflevector <8 x double> [[TMP86]], <8 x double> [[TMP87]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>
-; CHECK-NEXT: [[TMP89:%.*]] = insertelement <8 x double> <double 1.000000e+00, double poison, double 1.000000e+00, double poison, double 1.000000e+00, double 1.000000e+00, double poison, double poison>, double [[TMP27]], i64 1
-; CHECK-NEXT: [[TMP90:%.*]] = shufflevector <8 x double> [[TMP89]], <8 x double> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 1, i32 4, i32 5, i32 1, i32 1>
-; CHECK-NEXT: [[TMP91:%.*]] = fmul reassoc nsz arcp contract afn <8 x double> [[TMP88]], [[TMP90]]
-; CHECK-NEXT: store <8 x double> [[TMP91]], ptr getelementptr inbounds nuw (i8, ptr @hexsh_, i64 136), align 8
-; CHECK-NEXT: ret void
-;
-.preheader4179.preheader:
- %49 = fmul fast double %8, %9
- %50 = fmul fast double %8, %10
- %51 = fmul fast double %13, %49
- %52 = fmul fast double %13, %50
- %53 = fneg fast double %25
- %54 = fmul fast double %24, %53
- store double 1.000000e+00, ptr %26, align 8
- %55 = fadd fast double %50, 1.000000e+00
- %56 = fsub fast double %54, %55
- %57 = fmul fast double %56, %27
- store double %57, ptr getelementptr inbounds nuw (i8, ptr @hexsh_, i64 192), align 8
- store double %35, ptr getelementptr inbounds nuw (i8, ptr @hexsh_, i64 136), align 8
- %58 = fadd fast double %38, 1.000000e+00
- %59 = fmul fast double %39, %40
- %60 = fsub fast double %58, %59
- %61 = fmul fast double %60, %27
- store double %61, ptr getelementptr inbounds nuw (i8, ptr @hexsh_, i64 144), align 8
- %62 = fadd fast double %42, 1.000000e+00
- %63 = fmul fast double %32, %40
- %64 = fsub fast double %62, %63
- store double %64, ptr getelementptr inbounds nuw (i8, ptr @hexsh_, i64 152), align 8
- store double %44, ptr getelementptr inbounds nuw (i8, ptr @hexsh_, i64 224), align 8
- %65 = fmul fast double %45, %51
- %66 = fmul fast double %52, %27
- store double %66, ptr getelementptr inbounds nuw (i8, ptr @hexsh_, i64 160), align 8
- %67 = fmul fast double %36, %46
- %68 = fmul fast double %36, %51
- %69 = fadd fast double %67, 1.000000e+00
- %70 = fsub fast double %68, %69
- %71 = fadd fast double %70, %47
- store double %71, ptr getelementptr inbounds nuw (i8, ptr @hexsh_, i64 168), align 8
- %72 = fmul fast double %48, %40
- %73 = fsub fast double %65, %72
- store double %73, ptr getelementptr inbounds nuw (i8, ptr @hexsh_, i64 176), align 8
- %74 = fmul fast double %36, %52
- %75 = fadd fast double %74, 2.000000e+00
- %76 = fsub fast double %75, %51
- %77 = fmul fast double %76, %27
- store double %77, ptr getelementptr inbounds nuw (i8, ptr @hexsh_, i64 184), align 8
- ret void
-}
diff --git a/llvm/test/Transforms/SimplifyCFG/unreachable-multi-basic-block-funclet.ll b/llvm/test/Transforms/SimplifyCFG/unreachable-multi-basic-block-funclet.ll
index ae33e9b24275d..0f0fc78ec7add 100644
--- a/llvm/test/Transforms/SimplifyCFG/unreachable-multi-basic-block-funclet.ll
+++ b/llvm/test/Transforms/SimplifyCFG/unreachable-multi-basic-block-funclet.ll
@@ -198,16 +198,9 @@ define x86_thiscallcc ptr @baz(ptr %arg, ptr %arg1, ptr %arg2, i1 %arg3, ptr %ar
; CHECK-LABEL: define x86_thiscallcc ptr @baz(
; CHECK-SAME: ptr [[ARG:%.*]], ptr [[ARG1:%.*]], ptr [[ARG2:%.*]], i1 [[ARG3:%.*]], ptr [[ARG4:%.*]]) personality ptr null {
; CHECK-NEXT: [[BB:.*:]]
-; CHECK-NEXT: [[ALLOCA:%.*]] = alloca [2 x [[STRUCT_FOO:%.*]]], align 4
-; CHECK-NEXT: [[INVOKE:%.*]] = invoke x86_thiscallcc ptr @quux(ptr null, ptr null, i32 0)
-; CHECK-NEXT: to label %[[BB5:.*]] unwind label %[[BB10:.*]]
-; CHECK: [[BB5]]:
+; CHECK-NEXT: [[ALLOCA:%.*]] = alloca [2 x %struct.foo], align 4
+; CHECK-NEXT: [[INVOKE:%.*]] = call x86_thiscallcc ptr @quux(ptr null, ptr null, i32 0) #[[ATTR1:[0-9]+]]
; CHECK-NEXT: unreachable
-; CHECK: [[BB10]]:
-; CHECK-NEXT: [[CLEANUPPAD12:%.*]] = cleanuppad within none []
-; CHECK-NEXT: [[GETELEMENTPTR13:%.*]] = getelementptr i8, ptr null, i32 -20
-; CHECK-NEXT: store i32 0, ptr null, align 4
-; CHECK-NEXT: ret ptr null
;
bb:
%alloca = alloca [2 x %struct.foo], align 4
diff --git a/llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp b/llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp
index 543b769b1a666..6687308bda8cc 100644
--- a/llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp
+++ b/llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp
@@ -221,10 +221,6 @@ TEST_F(SelectionDAGPatternMatchTest, matchBinaryOp) {
SDValue Or = DAG->getNode(ISD::OR, DL, Int32VT, Op0, Op1);
SDValue DisOr =
DAG->getNode(ISD::OR, DL, Int32VT, Op0, Op3, SDNodeFlags::Disjoint);
- SDValue NUWAdd =
- DAG->getNode(ISD::ADD, DL, Int32VT, Or, Xor, SDNodeFlags::NoUnsignedWrap);
- SDValue NSWAdd =
- DAG->getNode(ISD::ADD, DL, Int32VT, And, Xor, SDNodeFlags::NoSignedWrap);
SDValue SMax = DAG->getNode(ISD::SMAX, DL, Int32VT, Op0, Op1);
SDValue SMin = DAG->getNode(ISD::SMIN, DL, Int32VT, Op1, Op0);
SDValue UMax = DAG->getNode(ISD::UMAX, DL, Int32VT, Op0, Op1);
@@ -324,20 +320,6 @@ TEST_F(SelectionDAGPatternMatchTest, matchBinaryOp) {
EXPECT_TRUE(sd_match(Add, m_c_BinOp(ISD::ADD, m_Value(), m_Value())));
EXPECT_TRUE(sd_match(Add, m_Add(m_Value(), m_Value())));
EXPECT_TRUE(sd_match(Add, m_AddLike(m_Value(), m_Value())));
- EXPECT_TRUE(sd_match(NUWAdd, m_NUWAdd(m_Value(), m_Value())));
- EXPECT_TRUE(sd_match(NSWAdd, m_NSWAdd(m_Value(), m_Value())));
- EXPECT_FALSE(sd_match(NUWAdd, m_NSWAdd(m_Value(), m_Value())));
- EXPECT_FALSE(sd_match(NSWAdd, m_NUWAdd(m_Value(), m_Value())));
- EXPECT_TRUE(sd_match(NUWAdd, m_Add(m_Value(), m_Value())));
- EXPECT_TRUE(sd_match(NSWAdd, m_Add(m_Value(), m_Value())));
- EXPECT_TRUE(sd_match(NUWAdd, m_AddLike(m_Value(), m_Value())));
- EXPECT_TRUE(sd_match(NSWAdd, m_AddLike(m_Value(), m_Value())));
- EXPECT_TRUE(sd_match(NUWAdd, m_NUWAddLike(m_Value(), m_Value())));
- EXPECT_FALSE(sd_match(NSWAdd, m_NUWAddLike(m_Value(), m_Value())));
- EXPECT_FALSE(sd_match(Add, m_NUWAddLike(m_Value(), m_Value())));
- EXPECT_TRUE(sd_match(NSWAdd, m_NSWAddLike(m_Value(), m_Value())));
- EXPECT_FALSE(sd_match(NUWAdd, m_NSWAddLike(m_Value(), m_Value())));
- EXPECT_FALSE(sd_match(Add, m_NSWAddLike(m_Value(), m_Value())));
EXPECT_TRUE(sd_match(Mul, m_Mul(m_OneUse(m_SpecificOpc(ISD::SUB)),
m_NUses<2>(m_Specific(Add)))));
EXPECT_TRUE(
@@ -365,8 +347,6 @@ TEST_F(SelectionDAGPatternMatchTest, matchBinaryOp) {
EXPECT_TRUE(sd_match(DisOr, m_DisjointOr(m_Value(), m_Value())));
EXPECT_FALSE(sd_match(DisOr, m_Add(m_Value(), m_Value())));
EXPECT_TRUE(sd_match(DisOr, m_AddLike(m_Value(), m_Value())));
- EXPECT_TRUE(sd_match(DisOr, m_NUWAddLike(m_Value(), m_Value())));
- EXPECT_TRUE(sd_match(DisOr, m_NSWAddLike(m_Value(), m_Value())));
EXPECT_TRUE(sd_match(
DisOr, m_BinOp(ISD::OR, m_Value(), m_Value(), SDNodeFlags::Disjoint)));
EXPECT_TRUE(sd_match(
diff --git a/llvm/unittests/ExecutionEngine/JITLink/CMakeLists.txt b/llvm/unittests/ExecutionEngine/JITLink/CMakeLists.txt
index 04fdf1f4e57c3..b7b67bed8a63f 100644
--- a/llvm/unittests/ExecutionEngine/JITLink/CMakeLists.txt
+++ b/llvm/unittests/ExecutionEngine/JITLink/CMakeLists.txt
@@ -13,7 +13,6 @@ add_llvm_unittest(JITLinkTests
AArch64Tests.cpp
COFFLinkGraphTests.cpp
EHFrameSupportTests.cpp
- JITLinkDylibTest.cpp
JITLinkTestUtils.cpp
LinkGraphTests.cpp
MachOLinkGraphTests.cpp
diff --git a/llvm/unittests/ExecutionEngine/JITLink/JITLinkDylibTest.cpp b/llvm/unittests/ExecutionEngine/JITLink/JITLinkDylibTest.cpp
deleted file mode 100644
index 52102ffe5a9b9..0000000000000
--- a/llvm/unittests/ExecutionEngine/JITLink/JITLinkDylibTest.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-//===--- JITLinkDylibTest.cpp - Test JITLinkDylib and notifications ------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ExecutionEngine/JITLink/JITLinkDylib.h"
-#include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"
-#include "gtest/gtest.h"
-
-using namespace llvm;
-using namespace llvm::jitlink;
-
-namespace {
-
-class RecordingMemoryManager : public JITLinkMemoryManager {
-public:
- void allocate(const JITLinkDylib *JD, LinkGraph &G,
- OnAllocatedFunction OnAllocated) override {
- llvm_unreachable("Not used by this test");
- }
-
- void deallocate(std::vector<FinalizedAlloc> Allocs,
- OnDeallocatedFunction OnDeallocated) override {
- llvm_unreachable("Not used by this test");
- }
-
- using JITLinkMemoryManager::deallocate;
-
- void notifyDestroying(JITLinkDylib &JD) override {
- NotifiedName = JD.getName();
- ++NotifyCount;
- }
-
- unsigned NotifyCount = 0;
- std::string NotifiedName;
-};
-
-} // namespace
-
-TEST(JITLinkDylibTest, GetName) {
- JITLinkDylib JD("foo");
- EXPECT_EQ(JD.getName(), "foo");
-}
-
-TEST(JITLinkDylibTest, MemoryManagerNotifiedOnDestruction) {
- RecordingMemoryManager MemMgr;
- {
- JITLinkDylib JD("foo");
- JD.notifyOnDestruction(MemMgr);
- EXPECT_EQ(MemMgr.NotifyCount, 0U);
- }
- EXPECT_EQ(MemMgr.NotifyCount, 1U);
- EXPECT_EQ(MemMgr.NotifiedName, "foo");
-}
-
-TEST(JITLinkDylibTest, MultipleMemoryManagersAllNotified) {
- RecordingMemoryManager MemMgr1, MemMgr2;
- {
- JITLinkDylib JD("foo");
- JD.notifyOnDestruction(MemMgr1);
- JD.notifyOnDestruction(MemMgr2);
- }
- EXPECT_EQ(MemMgr1.NotifyCount, 1U);
- EXPECT_EQ(MemMgr2.NotifyCount, 1U);
-}
diff --git a/llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt b/llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
index 5dc798c64eea9..5b990f02f648b 100644
--- a/llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
+++ b/llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
@@ -19,6 +19,8 @@ set(LLVM_LINK_COMPONENTS
add_llvm_unittest(OrcJITTests
COFFAutoImportGeneratorTest.cpp
+ CallableTraitsHelperTest.cpp
+ CallSPSViaEPCTest.cpp
CoreAPIsTest.cpp
ExecutorAddressTest.cpp
ExecutionSessionWrapperFunctionCallsTest.cpp
@@ -42,13 +44,12 @@ add_llvm_unittest(OrcJITTests
ObjectLinkingLayerTest.cpp
OrcCAPITest.cpp
OrcTestCommon.cpp
- ProxyTest.cpp
ResourceTrackerTest.cpp
RTDyldObjectLinkingLayerTest.cpp
SharedMemoryMapperTest.cpp
SimpleExecutorMemoryManagerTest.cpp
SimplePackedSerializationTest.cpp
- SPSProxiesTest.cpp
+ SPSCallersTest.cpp
SymbolStringPoolTest.cpp
TaskDispatchTest.cpp
ThreadSafeModuleTest.cpp
diff --git a/llvm/unittests/ExecutionEngine/Orc/CallSPSViaEPCTest.cpp b/llvm/unittests/ExecutionEngine/Orc/CallSPSViaEPCTest.cpp
new file mode 100644
index 0000000000000..aa3b96fda45c3
--- /dev/null
+++ b/llvm/unittests/ExecutionEngine/Orc/CallSPSViaEPCTest.cpp
@@ -0,0 +1,173 @@
+//===----------- CallSPSViaEPC.cpp - Test CallSPSViaEPC.h APIs ------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ExecutionEngine/Orc/CallSPSViaEPC.h"
+#include "llvm/ExecutionEngine/Orc/SelfExecutorProcessControl.h"
+
+#include "llvm/Testing/Support/Error.h"
+
+#include <future>
+
+#include "gtest/gtest.h"
+
+using namespace llvm;
+using namespace llvm::orc;
+using namespace llvm::orc::shared;
+
+static CWrapperFunctionBuffer voidWrapper(const char *ArgData, size_t ArgSize) {
+ return WrapperFunction<void()>::handle(ArgData, ArgSize, []() {}).release();
+}
+
+static CWrapperFunctionBuffer mainWrapper(const char *ArgData, size_t ArgSize) {
+ return WrapperFunction<int32_t(SPSSequence<SPSString>)>::handle(
+ ArgData, ArgSize,
+ [](std::vector<std::string> Args) -> int32_t {
+ return Args.size();
+ })
+ .release();
+}
+
+TEST(CallSPSViaEPCTest, CallVoidViaCallerAsync) {
+ auto EPC = cantFail(SelfExecutorProcessControl::Create());
+ SPSEPCCaller<void()> C(*EPC);
+
+ Error Err = Error::success();
+ {
+ ErrorAsOutParameter _(Err);
+ C([&](Error E) { Err = std::move(E); },
+ ExecutorSymbolDef::fromPtr(voidWrapper));
+ }
+ EXPECT_THAT_ERROR(std::move(Err), Succeeded());
+}
+
+TEST(CallSPSViaEPCTest, CallVoidViaCallerSync) {
+ auto EPC = cantFail(SelfExecutorProcessControl::Create());
+ SPSEPCCaller<void()> C(*EPC);
+
+ Error Err =
+ C(std::promise<MSVCPError>(), ExecutorSymbolDef::fromPtr(voidWrapper));
+ EXPECT_THAT_ERROR(std::move(Err), Succeeded());
+}
+
+TEST(CallSPSViaEPCTest, CallMainViaCallerAsync) {
+ auto EPC = cantFail(SelfExecutorProcessControl::Create());
+ SPSEPCCaller<int32_t(SPSSequence<SPSString>)> C(*EPC);
+ std::vector<std::string> Args;
+
+ std::optional<Expected<int32_t>> R1;
+ C([&](Expected<int32_t> R) { R1 = std::move(R); },
+ ExecutorSymbolDef::fromPtr(mainWrapper), Args);
+ ASSERT_THAT_EXPECTED(*R1, Succeeded());
+ EXPECT_EQ(**R1, 0);
+
+ Args.push_back("foo");
+ std::optional<Expected<int32_t>> R2;
+ C([&](Expected<int32_t> R) { R2 = std::move(R); },
+ ExecutorSymbolDef::fromPtr(mainWrapper), Args);
+ ASSERT_THAT_EXPECTED(*R2, Succeeded());
+ EXPECT_EQ(**R2, 1);
+
+ Args.push_back("foo");
+ std::optional<Expected<int32_t>> R3;
+ C([&](Expected<int32_t> R) { R3 = std::move(R); },
+ ExecutorSymbolDef::fromPtr(mainWrapper), Args);
+ ASSERT_THAT_EXPECTED(*R3, Succeeded());
+ EXPECT_EQ(**R3, 2);
+
+ Args.clear();
+ std::optional<Expected<int32_t>> R4;
+ C([&](Expected<int32_t> R) { R4 = std::move(R); },
+ ExecutorSymbolDef::fromPtr(mainWrapper), Args);
+ ASSERT_THAT_EXPECTED(*R4, Succeeded());
+ EXPECT_EQ(**R4, 0);
+}
+
+TEST(CallSPSViaEPCTest, CallMainViaGenericCallAsync) {
+ auto EPC = cantFail(SelfExecutorProcessControl::Create());
+ SPSEPCCall<int32_t(SPSSequence<SPSString>)> C(
+ *EPC, ExecutorSymbolDef::fromPtr(mainWrapper));
+ std::vector<std::string> Args;
+
+ std::optional<Expected<int32_t>> R1;
+ C([&](Expected<int32_t> R) { R1 = std::move(R); }, Args);
+ ASSERT_THAT_EXPECTED(*R1, Succeeded());
+ EXPECT_EQ(**R1, 0);
+
+ Args.push_back("foo");
+ std::optional<Expected<int32_t>> R2;
+ C([&](Expected<int32_t> R) { R2 = std::move(R); }, Args);
+ ASSERT_THAT_EXPECTED(*R2, Succeeded());
+ EXPECT_EQ(**R2, 1);
+
+ Args.push_back("foo");
+ std::optional<Expected<int32_t>> R3;
+ C([&](Expected<int32_t> R) { R3 = std::move(R); }, Args);
+ ASSERT_THAT_EXPECTED(*R3, Succeeded());
+ EXPECT_EQ(**R3, 2);
+
+ Args.clear();
+ std::optional<Expected<int32_t>> R4;
+ C([&](Expected<int32_t> R) { R4 = std::move(R); }, Args);
+ ASSERT_THAT_EXPECTED(*R4, Succeeded());
+ EXPECT_EQ(**R4, 0);
+}
+
+TEST(CallSPSViaEPCTest, CallMainViaCallerSync) {
+ auto EPC = cantFail(SelfExecutorProcessControl::Create());
+ SPSEPCCaller<int32_t(SPSSequence<SPSString>)> C(*EPC);
+ std::vector<std::string> Args;
+
+ Expected<int32_t> R1 = C(std::promise<MSVCPExpected<int32_t>>(),
+ ExecutorSymbolDef::fromPtr(mainWrapper), Args);
+ ASSERT_THAT_EXPECTED(R1, Succeeded());
+ EXPECT_EQ(*R1, 0);
+
+ Args.push_back("foo");
+ Expected<int32_t> R2 = C(std::promise<MSVCPExpected<int32_t>>(),
+ ExecutorSymbolDef::fromPtr(mainWrapper), Args);
+ ASSERT_THAT_EXPECTED(R2, Succeeded());
+ EXPECT_EQ(*R2, 1);
+
+ Args.push_back("foo");
+ Expected<int32_t> R3 = C(std::promise<MSVCPExpected<int32_t>>(),
+ ExecutorSymbolDef::fromPtr(mainWrapper), Args);
+ ASSERT_THAT_EXPECTED(R3, Succeeded());
+ EXPECT_EQ(*R3, 2);
+
+ Args.clear();
+ Expected<int32_t> R4 = C(std::promise<MSVCPExpected<int32_t>>(),
+ ExecutorSymbolDef::fromPtr(mainWrapper), Args);
+ ASSERT_THAT_EXPECTED(R4, Succeeded());
+ EXPECT_EQ(*R4, 0);
+}
+
+TEST(CallSPSViaEPCTest, CallMainViaGenericCallSync) {
+ auto EPC = cantFail(SelfExecutorProcessControl::Create());
+ SPSEPCCall<int32_t(SPSSequence<SPSString>)> C(
+ *EPC, ExecutorSymbolDef::fromPtr(mainWrapper));
+ std::vector<std::string> Args;
+
+ Expected<int32_t> R1 = C(std::promise<MSVCPExpected<int32_t>>(), Args);
+ ASSERT_THAT_EXPECTED(R1, Succeeded());
+ EXPECT_EQ(*R1, 0);
+
+ Args.push_back("foo");
+ Expected<int32_t> R2 = C(std::promise<MSVCPExpected<int32_t>>(), Args);
+ ASSERT_THAT_EXPECTED(R2, Succeeded());
+ EXPECT_EQ(*R2, 1);
+
+ Args.push_back("foo");
+ Expected<int32_t> R3 = C(std::promise<MSVCPExpected<int32_t>>(), Args);
+ ASSERT_THAT_EXPECTED(R3, Succeeded());
+ EXPECT_EQ(*R3, 2);
+
+ Args.clear();
+ Expected<int32_t> R4 = C(std::promise<MSVCPExpected<int32_t>>(), Args);
+ ASSERT_THAT_EXPECTED(R4, Succeeded());
+ EXPECT_EQ(*R4, 0);
+}
diff --git a/llvm/unittests/ExecutionEngine/Orc/CallableTraitsHelperTest.cpp b/llvm/unittests/ExecutionEngine/Orc/CallableTraitsHelperTest.cpp
new file mode 100644
index 0000000000000..2b99522e1a655
--- /dev/null
+++ b/llvm/unittests/ExecutionEngine/Orc/CallableTraitsHelperTest.cpp
@@ -0,0 +1,70 @@
+//===- CallableTraitsHelperTest.cpp ---------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Tests for llvm::orc::CallableTraitsHelper APIs.
+//
+// NOTE: All tests in this file are testing compile-time functionality, so the
+// tests at runtime all end up being noops. That's fine -- those are
+// cheap.
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ExecutionEngine/Orc/CallableTraitsHelper.h"
+#include "gtest/gtest.h"
+
+using namespace llvm;
+using namespace llvm::orc;
+
+static void freeVoidVoid() {}
+
+TEST(CallableTraitsHelperTest, FreeVoidVoid) {
+ freeVoidVoid();
+ typedef CallableArgInfo<decltype(freeVoidVoid)> CAI;
+ static_assert(std::is_void_v<CAI::ReturnType>);
+ static_assert(std::is_same_v<CAI::ArgsTupleType, std::tuple<>>);
+}
+
+static int freeBinaryOp(int, float) { return 0; }
+
+TEST(CallableTraitsHelperTest, FreeBinaryOp) {
+ freeBinaryOp(1, 2.0f);
+ typedef CallableArgInfo<decltype(freeBinaryOp)> CAI;
+ static_assert(std::is_same_v<CAI::ReturnType, int>);
+ static_assert(std::is_same_v<CAI::ArgsTupleType, std::tuple<int, float>>);
+}
+
+TEST(CallableTraitsHelperTest, VoidVoidObj) {
+ auto VoidVoid = []() {};
+ typedef CallableArgInfo<decltype(VoidVoid)> CAI;
+ static_assert(std::is_void_v<CAI::ReturnType>);
+ static_assert(std::is_same_v<CAI::ArgsTupleType, std::tuple<>>);
+}
+
+TEST(CallableTraitsHelperTest, BinaryOpObj) {
+ auto BinaryOp = [](int X, float Y) -> int { return X + Y; };
+ typedef CallableArgInfo<decltype(BinaryOp)> CAI;
+ static_assert(std::is_same_v<CAI::ReturnType, int>);
+ static_assert(std::is_same_v<CAI::ArgsTupleType, std::tuple<int, float>>);
+}
+
+TEST(CallableTraitsHelperTest, PreservesLValueRef) {
+ auto RefOp = [](int &) {};
+ typedef CallableArgInfo<decltype(RefOp)> CAI;
+ static_assert(std::is_same_v<CAI::ArgsTupleType, std::tuple<int &>>);
+}
+
+TEST(CallableTraitsHelperTest, PreservesLValueRefConstness) {
+ auto RefOp = [](const int &) {};
+ typedef CallableArgInfo<decltype(RefOp)> CAI;
+ static_assert(std::is_same_v<CAI::ArgsTupleType, std::tuple<const int &>>);
+}
+
+TEST(CallableTraitsHelperTest, PreservesRValueRef) {
+ auto RefOp = [](int &&) {};
+ typedef CallableArgInfo<decltype(RefOp)> CAI;
+ static_assert(std::is_same_v<CAI::ArgsTupleType, std::tuple<int &&>>);
+}
diff --git a/llvm/unittests/ExecutionEngine/Orc/ProxyTest.cpp b/llvm/unittests/ExecutionEngine/Orc/ProxyTest.cpp
deleted file mode 100644
index 8e3b7b344ea6b..0000000000000
--- a/llvm/unittests/ExecutionEngine/Orc/ProxyTest.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-//===- ProxyTest.cpp - Test rt::Proxy -------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// Tests for rt::Proxy that are independent of any serialization protocol.
-// A trivial in-process dispatch (interpreting the callee address as a local
-// function pointer, no serialization) is used throughout -- this exercises the
-// Proxy plumbing directly and demonstrates that Proxy is protocol-agnostic.
-// The SPS protocol itself is tested in SPSProxiesTest.cpp.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ExecutionEngine/Orc/RTBridge/Proxy.h"
-#include "llvm/ExecutionEngine/Orc/AbsoluteSymbols.h"
-#include "llvm/ExecutionEngine/Orc/SelfExecutorProcessControl.h"
-#include "llvm/Support/MSVCErrorWorkarounds.h"
-#include "llvm/Testing/Support/Error.h"
-
-#include <future>
-
-#include "gtest/gtest.h"
-
-using namespace llvm;
-using namespace llvm::orc;
-
-namespace {
-
-// Target invoked in-process by the test dispatch below.
-int32_t addOne(int32_t X) { return X + 1; }
-
-// A protocol-free dispatch: interpret the callee address as a local function
-// pointer and call it directly. This drives rt::Proxy without any
-// serialization, so the tests exercise Proxy's own logic (result plumbing,
-// operator bool, lookup) rather than a particular protocol.
-template <typename RetT, typename... ArgTs>
-void inProcessDispatch(
- unique_function<void(typename rt::Proxy<RetT(ArgTs...)>::ErrorRetT)>
- OnComplete,
- ExecutionSession &ES, ExecutorAddr Callee, const ArgTs &...Args) {
- auto *Fn = Callee.toPtr<RetT(ArgTs...)>();
- if constexpr (std::is_void_v<RetT>) {
- Fn(Args...);
- OnComplete(Error::success());
- } else
- OnComplete(Fn(Args...));
-}
-
-using AddOneProxy = rt::Proxy<int32_t(int32_t)>;
-constexpr AddOneProxy::DispatchFn AddOneDispatch =
- &inProcessDispatch<int32_t, int32_t>;
-
-// A minimal ProxySpec-shaped type (static dispatch + Name) for exercising the
-// proxyInit / buildProxies client path without depending on a protocol.
-struct AddOneSpec {
- static constexpr const char *Name = "add_one";
- static void dispatch(unique_function<void(Expected<int32_t>)> OnComplete,
- ExecutionSession &ES, ExecutorAddr Callee,
- const int32_t &Arg) {
- inProcessDispatch<int32_t, int32_t>(std::move(OnComplete), ES, Callee, Arg);
- }
-};
-
-} // namespace
-
-// The synchronous and asynchronous call operators forward the arguments to the
-// dispatch function and deliver its result.
-TEST(ProxyTest, SyncAndAsync) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- AddOneProxy Call(AddOneDispatch, ExecutorAddr::fromPtr(addOne));
-
- Expected<int32_t> RSync = Call(ES, 41);
- ASSERT_THAT_EXPECTED(RSync, Succeeded());
- EXPECT_EQ(*RSync, 42);
-
- std::promise<MSVCPExpected<int32_t>> P;
- auto F = P.get_future();
- Call([&](Expected<int32_t> R) { P.set_value(std::move(R)); }, ES, 41);
- Expected<int32_t> RAsync = F.get();
- ASSERT_THAT_EXPECTED(RAsync, Succeeded());
- EXPECT_EQ(*RAsync, 42);
-
- cantFail(ES.endSession());
-}
-
-// operator bool reflects whether the proxy has a non-null callee address, and
-// calleeAddr() returns the address the proxy was constructed with.
-TEST(ProxyTest, OperatorBoolAndAccessors) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- ExecutorAddr CalleeAddr = ExecutorAddr::fromPtr(addOne);
- AddOneProxy Call(AddOneDispatch, CalleeAddr);
- EXPECT_TRUE(static_cast<bool>(Call));
- EXPECT_EQ(Call.calleeAddr(), CalleeAddr);
-
- // A default-constructed proxy has a null callee address and is falsey.
- AddOneProxy Null;
- EXPECT_FALSE(static_cast<bool>(Null));
-
- cantFail(ES.endSession());
-}
-
-// Create looks the callee up by name in the bootstrap JITDylib and binds a
-// usable proxy to it (required-symbol, present).
-TEST(ProxyTest, CreateRequiredPresent) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- auto &JD = ES.getBootstrapJITDylib();
- cantFail(JD.define(absoluteSymbols(
- {{ES.intern(AddOneSpec::Name),
- {ExecutorAddr::fromPtr(addOne), JITSymbolFlags::Exported}}})));
-
- Expected<AddOneProxy> Call = AddOneProxy::Create(
- AddOneDispatch, ES, AddOneSpec::Name, SymbolLookupFlags::RequiredSymbol);
- ASSERT_THAT_EXPECTED(Call, Succeeded());
- EXPECT_TRUE(static_cast<bool>(*Call));
-
- Expected<int32_t> R = (*Call)(ES, 41);
- ASSERT_THAT_EXPECTED(R, Succeeded());
- EXPECT_EQ(*R, 42);
-
- cantFail(ES.endSession());
-}
-
-// A required (default) Create against a missing symbol fails, rather than
-// yielding a null proxy as the weakly-referenced form does.
-TEST(ProxyTest, CreateRequiredAbsentFails) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- Expected<AddOneProxy> Call = AddOneProxy::Create(
- AddOneDispatch, ES, AddOneSpec::Name, SymbolLookupFlags::RequiredSymbol);
- EXPECT_THAT_EXPECTED(Call, Failed());
-
- cantFail(ES.endSession());
-}
-
-// A weakly-referenced Create against a missing symbol succeeds, yielding a
-// proxy with a null callee (falsey) rather than an error.
-TEST(ProxyTest, CreateWeaklyReferencedAbsent) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- Expected<AddOneProxy> Call =
- AddOneProxy::Create(AddOneDispatch, ES, AddOneSpec::Name,
- SymbolLookupFlags::WeaklyReferencedSymbol);
- ASSERT_THAT_EXPECTED(Call, Succeeded());
- EXPECT_FALSE(static_cast<bool>(*Call));
- EXPECT_EQ(Call->calleeAddr(), ExecutorAddr());
-
- cantFail(ES.endSession());
-}
-
-// A weakly-referenced Create against a present symbol resolves it, yielding a
-// usable proxy (truthy) bound to the registered address.
-TEST(ProxyTest, CreateWeaklyReferencedPresent) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- auto &JD = ES.getBootstrapJITDylib();
- ExecutorAddr CalleeAddr = ExecutorAddr::fromPtr(addOne);
- cantFail(
- JD.define(absoluteSymbols({{ES.intern(AddOneSpec::Name),
- {CalleeAddr, JITSymbolFlags::Exported}}})));
-
- Expected<AddOneProxy> Call =
- AddOneProxy::Create(AddOneDispatch, ES, AddOneSpec::Name,
- SymbolLookupFlags::WeaklyReferencedSymbol);
- ASSERT_THAT_EXPECTED(Call, Succeeded());
- EXPECT_TRUE(static_cast<bool>(*Call));
- EXPECT_EQ(Call->calleeAddr(), CalleeAddr);
-
- cantFail(ES.endSession());
-}
-
-// buildProxies resolves a set of proxies from the bootstrap JITDylib via their
-// specs, exercising the proxyInit / buildProxies client entry point.
-TEST(ProxyTest, BuildProxies) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- auto &JD = ES.getBootstrapJITDylib();
- cantFail(JD.define(absoluteSymbols(
- {{ES.intern(AddOneSpec::Name),
- {ExecutorAddr::fromPtr(addOne), JITSymbolFlags::Exported}}})));
-
- AddOneProxy Call;
- cantFail(rt::buildProxies(ES, rt::proxyInit<AddOneSpec>(&Call)));
- ASSERT_TRUE(static_cast<bool>(Call));
-
- Expected<int32_t> R = Call(ES, 41);
- ASSERT_THAT_EXPECTED(R, Succeeded());
- EXPECT_EQ(*R, 42);
-
- cantFail(ES.endSession());
-}
-
-// buildProxies with an explicitly-supplied dispatch function and name -- the
-// proxyInit overload that takes no spec type.
-TEST(ProxyTest, BuildProxiesExplicitDispatch) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- auto &JD = ES.getBootstrapJITDylib();
- cantFail(JD.define(absoluteSymbols(
- {{ES.intern(AddOneSpec::Name),
- {ExecutorAddr::fromPtr(addOne), JITSymbolFlags::Exported}}})));
-
- AddOneProxy Call;
- cantFail(rt::buildProxies(
- ES, rt::proxyInit(&Call, AddOneDispatch, AddOneSpec::Name)));
- ASSERT_TRUE(static_cast<bool>(Call));
-
- Expected<int32_t> R = Call(ES, 41);
- ASSERT_THAT_EXPECTED(R, Succeeded());
- EXPECT_EQ(*R, 42);
-
- cantFail(ES.endSession());
-}
-
-// buildProxies with a spec but an overridden lookup name -- the proxyInit
-// overload that takes a spec type plus an explicit name. The symbol is defined
-// only under the override name, so resolving against the spec's default Name
-// would fail; success proves the override is used.
-TEST(ProxyTest, BuildProxiesSpecNameOverride) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- auto &JD = ES.getBootstrapJITDylib();
- cantFail(JD.define(absoluteSymbols(
- {{ES.intern("add_one_alias"),
- {ExecutorAddr::fromPtr(addOne), JITSymbolFlags::Exported}}})));
-
- AddOneProxy Call;
- cantFail(
- rt::buildProxies(ES, rt::proxyInit<AddOneSpec>(&Call, "add_one_alias")));
- ASSERT_TRUE(static_cast<bool>(Call));
-
- Expected<int32_t> R = Call(ES, 41);
- ASSERT_THAT_EXPECTED(R, Succeeded());
- EXPECT_EQ(*R, 42);
-
- cantFail(ES.endSession());
-}
-
-// buildProxies propagates the lookup flags: a weakly-referenced proxyInit for a
-// missing symbol yields a null proxy rather than failing the whole build.
-TEST(ProxyTest, BuildProxiesWeaklyReferencedAbsent) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- AddOneProxy Call;
- cantFail(rt::buildProxies(
- ES, rt::proxyInit<AddOneSpec>(
- &Call, SymbolLookupFlags::WeaklyReferencedSymbol)));
- EXPECT_FALSE(static_cast<bool>(Call));
-
- cantFail(ES.endSession());
-}
diff --git a/llvm/unittests/ExecutionEngine/Orc/SPSCallersTest.cpp b/llvm/unittests/ExecutionEngine/Orc/SPSCallersTest.cpp
new file mode 100644
index 0000000000000..d9dd59b9ec194
--- /dev/null
+++ b/llvm/unittests/ExecutionEngine/Orc/SPSCallersTest.cpp
@@ -0,0 +1,330 @@
+//===- SPSCallersTest.cpp - Test SPS call wrappers ------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ExecutionEngine/Orc/AbsoluteSymbols.h"
+#include "llvm/ExecutionEngine/Orc/RTBridge/SPS/Calls.h"
+#include "llvm/ExecutionEngine/Orc/SelfExecutorProcessControl.h"
+#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
+#include "llvm/Support/MSVCErrorWorkarounds.h"
+#include "llvm/Testing/Support/Error.h"
+
+#include <cstring>
+#include <future>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+using namespace llvm;
+using namespace llvm::orc;
+using namespace llvm::orc::shared;
+using llvm::orc::rt::sps::Int32Int32Caller;
+using llvm::orc::rt::sps::Int32VoidCaller;
+using llvm::orc::rt::sps::MainCaller;
+using llvm::orc::rt::sps::VoidVoidCaller;
+
+// Test "main" function. Returns argc plus the length of the first element of
+// argv (if argv is non-empty). Does not inspect argv entries beyond the first.
+static int testMain(int argc, char *argv[]) {
+ int Result = argc;
+ if (argc > 0)
+ Result += static_cast<int>(std::strlen(argv[0]));
+ return Result;
+}
+
+// Executor-side "call-main" wrapper. Decodes the main-function address and the
+// argument vector, then invokes the main function with a C-style (argc, argv).
+static CWrapperFunctionBuffer callMainWrapper(const char *ArgData,
+ size_t ArgSize) {
+ return WrapperFunction<int64_t(SPSExecutorAddr, SPSSequence<SPSString>)>::
+ handle(ArgData, ArgSize,
+ [](ExecutorAddr MainFnAddr,
+ std::vector<std::string> Args) -> int64_t {
+ std::vector<char *> ArgV;
+ ArgV.reserve(Args.size() + 1);
+ for (auto &Arg : Args)
+ ArgV.push_back(Arg.data());
+ ArgV.push_back(nullptr);
+ auto *Main = MainFnAddr.toPtr<int(int, char **)>();
+ return Main(static_cast<int>(Args.size()), ArgV.data());
+ })
+ .release();
+}
+
+TEST(SPSCallersTest, CallMainSyncViaDirectConstruction) {
+ ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
+
+ MainCaller CallMain(ES, ExecutorAddr::fromPtr(callMainWrapper));
+ ExecutorAddr MainAddr = ExecutorAddr::fromPtr(testMain);
+
+ std::vector<std::string> Args;
+ Expected<int64_t> R0 = CallMain(MainAddr, Args);
+ ASSERT_THAT_EXPECTED(R0, Succeeded());
+ EXPECT_EQ(*R0, 0); // argc == 0, no argv[0].
+
+ Args = {"hello"};
+ Expected<int64_t> R1 = CallMain(MainAddr, Args);
+ ASSERT_THAT_EXPECTED(R1, Succeeded());
+ EXPECT_EQ(*R1, 1 + 5); // argc == 1, strlen("hello") == 5.
+
+ Args = {"a", "bb"};
+ Expected<int64_t> R2 = CallMain(MainAddr, Args);
+ ASSERT_THAT_EXPECTED(R2, Succeeded());
+ EXPECT_EQ(*R2, 2 + 1); // argc == 2, strlen("a") == 1.
+
+ cantFail(ES.endSession());
+}
+
+TEST(SPSCallersTest, CallMainAsyncViaCallOperator) {
+ ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
+
+ MainCaller CallMain(ES, ExecutorAddr::fromPtr(callMainWrapper));
+
+ std::vector<std::string> Args = {"foo", "bar"};
+ std::promise<MSVCPExpected<int64_t>> P;
+ auto F = P.get_future();
+ CallMain([&](Expected<int64_t> R) { P.set_value(std::move(R)); },
+ ExecutorAddr::fromPtr(testMain), Args);
+
+ Expected<int64_t> R = F.get();
+ ASSERT_THAT_EXPECTED(R, Succeeded());
+ EXPECT_EQ(*R, 2 + 3); // argc == 2, strlen("foo") == 3.
+
+ cantFail(ES.endSession());
+}
+
+TEST(SPSCallersTest, CallMainThroughRTInterface) {
+ ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
+
+ MainCaller CallMain(ES, ExecutorAddr::fromPtr(callMainWrapper));
+
+ // Drive the caller through the runtime-agnostic rt::MainCaller interface to
+ // exercise the virtual dispatch path (and to guard the interface's public
+ // accessibility).
+ rt::MainCaller &Base = CallMain;
+ ExecutorAddr MainAddr = ExecutorAddr::fromPtr(testMain);
+
+ // Synchronous call operator (inherited from rt::MainCaller).
+ std::vector<std::string> Args = {"hello"};
+ Expected<int64_t> RSync = Base(MainAddr, Args);
+ ASSERT_THAT_EXPECTED(RSync, Succeeded());
+ EXPECT_EQ(*RSync, 1 + 5); // argc == 1, strlen("hello") == 5.
+
+ // Asynchronous call operator (virtual).
+ std::promise<MSVCPExpected<int64_t>> P;
+ auto F = P.get_future();
+ Base([&](Expected<int64_t> R) { P.set_value(std::move(R)); }, MainAddr, Args);
+ Expected<int64_t> RAsync = F.get();
+ ASSERT_THAT_EXPECTED(RAsync, Succeeded());
+ EXPECT_EQ(*RAsync, 1 + 5);
+
+ cantFail(ES.endSession());
+}
+
+TEST(SPSCallersTest, CreateLooksUpCallMainInBootstrapJD) {
+ ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
+
+ // Register the call-main wrapper in the bootstrap JITDylib under the name
+ // MainCaller::Create looks for.
+ auto &BootstrapJD = ES.getBootstrapJITDylib();
+ cantFail(BootstrapJD.define(absoluteSymbols(
+ {{ES.intern(MainCaller::CIName),
+ {ExecutorAddr::fromPtr(callMainWrapper), JITSymbolFlags::Exported}}})));
+
+ Expected<MainCaller> CallMain = MainCaller::Create(ES);
+ ASSERT_THAT_EXPECTED(CallMain, Succeeded());
+
+ std::vector<std::string> Args = {"x", "y", "z"};
+ Expected<int64_t> R = (*CallMain)(ExecutorAddr::fromPtr(testMain), Args);
+ ASSERT_THAT_EXPECTED(R, Succeeded());
+ EXPECT_EQ(*R, 3 + 1); // argc == 3, strlen("x") == 1.
+
+ cantFail(ES.endSession());
+}
+
+// Target for VoidVoidCaller: records that it ran via a counter (there is no
+// return value to observe).
+static int VoidVoidCallCount = 0;
+static void voidVoidTarget() { ++VoidVoidCallCount; }
+
+// Executor-side wrapper for VoidVoidCaller. Decodes the target address and
+// invokes it as a void() function.
+static CWrapperFunctionBuffer callVoidVoidWrapper(const char *ArgData,
+ size_t ArgSize) {
+ return WrapperFunction<void(SPSExecutorAddr)>::handle(
+ ArgData, ArgSize,
+ [](ExecutorAddr FnAddr) { FnAddr.toPtr<void()>()(); })
+ .release();
+}
+
+// Target for Int32Int32Caller: doubles its argument, so the forwarded value is
+// observable in the result.
+static int32_t int32Int32Target(int32_t X) { return X * 2; }
+
+// Executor-side wrapper for Int32Int32Caller. Decodes the target address and
+// the int32_t argument, invokes the target, and returns the result.
+static CWrapperFunctionBuffer callInt32Int32Wrapper(const char *ArgData,
+ size_t ArgSize) {
+ return WrapperFunction<int32_t(SPSExecutorAddr, int32_t)>::handle(
+ ArgData, ArgSize,
+ [](ExecutorAddr FnAddr, int32_t X) -> int32_t {
+ return FnAddr.toPtr<int32_t(int32_t)>()(X);
+ })
+ .release();
+}
+
+// Exercises the void-return path (ErrorRetT == Error) and the empty argument
+// pack, through both the synchronous and asynchronous call operators.
+TEST(SPSCallersTest, VoidVoidSyncAndAsync) {
+ ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
+
+ VoidVoidCaller Call(ES, ExecutorAddr::fromPtr(callVoidVoidWrapper));
+ ExecutorAddr TargetAddr = ExecutorAddr::fromPtr(voidVoidTarget);
+
+ // Synchronous: the call operator returns Error, not Expected<T>.
+ VoidVoidCallCount = 0;
+ EXPECT_THAT_ERROR(Call(TargetAddr), Succeeded());
+ EXPECT_EQ(VoidVoidCallCount, 1);
+
+ // Asynchronous: the result is delivered as an Error.
+ VoidVoidCallCount = 0;
+ std::promise<MSVCPError> P;
+ auto F = P.get_future();
+ Call([&](Error Err) { P.set_value(std::move(Err)); }, TargetAddr);
+ EXPECT_THAT_ERROR(Error(F.get()), Succeeded());
+ EXPECT_EQ(VoidVoidCallCount, 1);
+
+ cantFail(ES.endSession());
+}
+
+// Exercises a non-void caller with an argument (so argument forwarding through
+// the pack is covered), and the Create / bootstrap lookup path for a caller
+// other than MainCaller.
+TEST(SPSCallersTest, Int32Int32SyncAndCreate) {
+ ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
+
+ Int32Int32Caller Call(ES, ExecutorAddr::fromPtr(callInt32Int32Wrapper));
+ Expected<int32_t> RDirect = Call(ExecutorAddr::fromPtr(int32Int32Target), 21);
+ ASSERT_THAT_EXPECTED(RDirect, Succeeded());
+ EXPECT_EQ(*RDirect, 42); // 21 * 2.
+
+ auto &BootstrapJD = ES.getBootstrapJITDylib();
+ cantFail(BootstrapJD.define(
+ absoluteSymbols({{ES.intern(Int32Int32Caller::CIName),
+ {ExecutorAddr::fromPtr(callInt32Int32Wrapper),
+ JITSymbolFlags::Exported}}})));
+
+ Expected<Int32Int32Caller> CreatedCall = Int32Int32Caller::Create(ES);
+ ASSERT_THAT_EXPECTED(CreatedCall, Succeeded());
+ Expected<int32_t> RCreated =
+ (*CreatedCall)(ExecutorAddr::fromPtr(int32Int32Target), 21);
+ ASSERT_THAT_EXPECTED(RCreated, Succeeded());
+ EXPECT_EQ(*RCreated, 42); // 21 * 2.
+
+ cantFail(ES.endSession());
+}
+
+// Target for Int32VoidCaller.
+static int32_t int32VoidTarget() { return 42; }
+
+// Executor-side wrapper for Int32VoidCaller. Decodes the target address,
+// invokes it as an int32_t() function, and returns the result.
+static CWrapperFunctionBuffer callInt32VoidWrapper(const char *ArgData,
+ size_t ArgSize) {
+ return WrapperFunction<int32_t(SPSExecutorAddr)>::handle(
+ ArgData, ArgSize,
+ [](ExecutorAddr FnAddr) -> int32_t {
+ return FnAddr.toPtr<int32_t()>()();
+ })
+ .release();
+}
+
+// Exercises a non-void, zero-argument caller. (Void return and argument
+// forwarding are covered by VoidVoidCaller and Int32Int32Caller respectively.)
+TEST(SPSCallersTest, Int32VoidSync) {
+ ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
+
+ Int32VoidCaller Call(ES, ExecutorAddr::fromPtr(callInt32VoidWrapper));
+ Expected<int32_t> R = Call(ExecutorAddr::fromPtr(int32VoidTarget));
+ ASSERT_THAT_EXPECTED(R, Succeeded());
+ EXPECT_EQ(*R, 42);
+
+ cantFail(ES.endSession());
+}
+
+// operator bool reflects whether the caller has a non-null callee address, and
+// the accessors return the values the caller was constructed with.
+TEST(SPSCallersTest, OperatorBoolAndAccessors) {
+ ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
+
+ ExecutorAddr CalleeAddr = ExecutorAddr::fromPtr(callMainWrapper);
+ MainCaller CallMain(ES, CalleeAddr);
+ EXPECT_TRUE(static_cast<bool>(CallMain));
+ EXPECT_EQ(CallMain.calleeAddr(), CalleeAddr);
+ EXPECT_EQ(&CallMain.executionSession(), &ES);
+
+ // A caller with a null callee address is falsey.
+ MainCaller NullCall(ES, ExecutorAddr());
+ EXPECT_FALSE(static_cast<bool>(NullCall));
+
+ cantFail(ES.endSession());
+}
+
+// A weakly-referenced Create against a missing symbol succeeds, yielding a
+// caller with a null callee (falsey) rather than an error.
+TEST(SPSCallersTest, CreateWeaklyReferencedAbsent) {
+ ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
+
+ // Nothing is defined for MainCaller::CIName in the bootstrap JITDylib.
+ Expected<MainCaller> CallMain =
+ MainCaller::Create(ES, SymbolLookupFlags::WeaklyReferencedSymbol);
+ ASSERT_THAT_EXPECTED(CallMain, Succeeded());
+ EXPECT_FALSE(static_cast<bool>(*CallMain));
+ EXPECT_EQ(CallMain->calleeAddr(), ExecutorAddr());
+
+ cantFail(ES.endSession());
+}
+
+// A weakly-referenced Create against a present symbol resolves it, yielding a
+// usable caller (truthy) bound to the registered address.
+TEST(SPSCallersTest, CreateWeaklyReferencedPresent) {
+ ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
+
+ auto &BootstrapJD = ES.getBootstrapJITDylib();
+ ExecutorAddr CalleeAddr = ExecutorAddr::fromPtr(callMainWrapper);
+ cantFail(BootstrapJD.define(
+ absoluteSymbols({{ES.intern(MainCaller::CIName),
+ {CalleeAddr, JITSymbolFlags::Exported}}})));
+
+ Expected<MainCaller> CallMain =
+ MainCaller::Create(ES, SymbolLookupFlags::WeaklyReferencedSymbol);
+ ASSERT_THAT_EXPECTED(CallMain, Succeeded());
+ EXPECT_TRUE(static_cast<bool>(*CallMain));
+ EXPECT_EQ(CallMain->calleeAddr(), CalleeAddr);
+
+ // The resolved caller is usable.
+ std::vector<std::string> Args = {"a", "bb"};
+ Expected<int64_t> R = (*CallMain)(ExecutorAddr::fromPtr(testMain), Args);
+ ASSERT_THAT_EXPECTED(R, Succeeded());
+ EXPECT_EQ(*R, 2 + 1); // argc == 2, strlen("a") == 1.
+
+ cantFail(ES.endSession());
+}
+
+// A required (default) Create against a missing symbol fails, rather than
+// yielding a null caller as the weakly-referenced form does.
+TEST(SPSCallersTest, CreateRequiredAbsentFails) {
+ ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
+
+ // Nothing is defined for MainCaller::CIName in the bootstrap JITDylib, and
+ // the default lookup requires the symbol.
+ Expected<MainCaller> CallMain = MainCaller::Create(ES);
+ EXPECT_THAT_EXPECTED(CallMain, Failed());
+
+ cantFail(ES.endSession());
+}
diff --git a/llvm/unittests/ExecutionEngine/Orc/SPSProxiesTest.cpp b/llvm/unittests/ExecutionEngine/Orc/SPSProxiesTest.cpp
deleted file mode 100644
index 3346c4d445c70..0000000000000
--- a/llvm/unittests/ExecutionEngine/Orc/SPSProxiesTest.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-//===- SPSProxiesTest.cpp - Test SPS proxy round-trips --------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// End-to-end tests for the SPS proxies: that each Call*ProxySpec's dispatch
-// serializes its arguments, invokes the executor-side wrapper, and
-// deserializes the result. Generic rt::Proxy behavior (independent of the
-// serialization protocol) is covered by ProxyTest.cpp.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ExecutionEngine/Orc/RTBridge/SPS/ProxySpecs.h"
-#include "llvm/ExecutionEngine/Orc/SelfExecutorProcessControl.h"
-#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
-#include "llvm/Support/MSVCErrorWorkarounds.h"
-#include "llvm/Testing/Support/Error.h"
-
-#include <cstring>
-#include <future>
-#include <string>
-#include <vector>
-
-#include "gtest/gtest.h"
-
-using namespace llvm;
-using namespace llvm::orc;
-using namespace llvm::orc::shared;
-
-namespace sps = llvm::orc::rt::sps;
-using llvm::orc::rt::CallInt32Int32Proxy;
-using llvm::orc::rt::CallInt32VoidProxy;
-using llvm::orc::rt::CallMainProxy;
-using llvm::orc::rt::CallVoidVoidProxy;
-
-// Test "main" function. Returns argc plus the length of the first element of
-// argv (if argv is non-empty). Does not inspect argv entries beyond the first.
-static int testMain(int argc, char *argv[]) {
- int Result = argc;
- if (argc > 0)
- Result += static_cast<int>(std::strlen(argv[0]));
- return Result;
-}
-
-// Executor-side "call-main" wrapper. Decodes the main-function address and the
-// argument vector, then invokes the main function with a C-style (argc, argv).
-static CWrapperFunctionBuffer callMainWrapper(const char *ArgData,
- size_t ArgSize) {
- return WrapperFunction<int64_t(SPSExecutorAddr, SPSSequence<SPSString>)>::
- handle(ArgData, ArgSize,
- [](ExecutorAddr MainFnAddr,
- std::vector<std::string> Args) -> int64_t {
- std::vector<char *> ArgV;
- ArgV.reserve(Args.size() + 1);
- for (auto &Arg : Args)
- ArgV.push_back(Arg.data());
- ArgV.push_back(nullptr);
- auto *Main = MainFnAddr.toPtr<int(int, char **)>();
- return Main(static_cast<int>(Args.size()), ArgV.data());
- })
- .release();
-}
-
-// Exercises argv marshaling: an argument vector is serialized, decoded by the
-// wrapper, and the int64_t result is deserialized.
-TEST(SPSProxiesTest, CallMainSyncViaDirectConstruction) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- CallMainProxy CallMain(sps::CallMainProxySpec::dispatch,
- ExecutorAddr::fromPtr(callMainWrapper));
- ExecutorAddr MainAddr = ExecutorAddr::fromPtr(testMain);
-
- std::vector<std::string> Args;
- Expected<int64_t> R0 = CallMain(ES, MainAddr, Args);
- ASSERT_THAT_EXPECTED(R0, Succeeded());
- EXPECT_EQ(*R0, 0); // argc == 0, no argv[0].
-
- Args = {"hello"};
- Expected<int64_t> R1 = CallMain(ES, MainAddr, Args);
- ASSERT_THAT_EXPECTED(R1, Succeeded());
- EXPECT_EQ(*R1, 1 + 5); // argc == 1, strlen("hello") == 5.
-
- Args = {"a", "bb"};
- Expected<int64_t> R2 = CallMain(ES, MainAddr, Args);
- ASSERT_THAT_EXPECTED(R2, Succeeded());
- EXPECT_EQ(*R2, 2 + 1); // argc == 2, strlen("a") == 1.
-
- cantFail(ES.endSession());
-}
-
-TEST(SPSProxiesTest, CallMainAsyncViaCallOperator) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- CallMainProxy CallMain(sps::CallMainProxySpec::dispatch,
- ExecutorAddr::fromPtr(callMainWrapper));
-
- std::vector<std::string> Args = {"foo", "bar"};
- std::promise<MSVCPExpected<int64_t>> P;
- auto F = P.get_future();
- CallMain([&](Expected<int64_t> R) { P.set_value(std::move(R)); }, ES,
- ExecutorAddr::fromPtr(testMain), Args);
-
- Expected<int64_t> R = F.get();
- ASSERT_THAT_EXPECTED(R, Succeeded());
- EXPECT_EQ(*R, 2 + 3); // argc == 2, strlen("foo") == 3.
-
- cantFail(ES.endSession());
-}
-
-// Target for CallVoidVoidProxy: records that it ran via a counter (there is no
-// return value to observe).
-static int VoidVoidCallCount = 0;
-static void voidVoidTarget() { ++VoidVoidCallCount; }
-
-// Executor-side wrapper for CallVoidVoidProxy. Decodes the target address and
-// invokes it as a void() function.
-static CWrapperFunctionBuffer callVoidVoidWrapper(const char *ArgData,
- size_t ArgSize) {
- return WrapperFunction<void(SPSExecutorAddr)>::handle(
- ArgData, ArgSize,
- [](ExecutorAddr FnAddr) { FnAddr.toPtr<void()>()(); })
- .release();
-}
-
-// Exercises the void-return path (ErrorRetT == Error) and the empty argument
-// pack, through both the synchronous and asynchronous call operators.
-TEST(SPSProxiesTest, VoidVoidSyncAndAsync) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- CallVoidVoidProxy Call(sps::CallVoidVoidProxySpec::dispatch,
- ExecutorAddr::fromPtr(callVoidVoidWrapper));
- ExecutorAddr TargetAddr = ExecutorAddr::fromPtr(voidVoidTarget);
-
- // Synchronous: the call operator returns Error, not Expected<T>.
- VoidVoidCallCount = 0;
- EXPECT_THAT_ERROR(Call(ES, TargetAddr), Succeeded());
- EXPECT_EQ(VoidVoidCallCount, 1);
-
- // Asynchronous: the result is delivered as an Error.
- VoidVoidCallCount = 0;
- std::promise<MSVCPError> P;
- auto F = P.get_future();
- Call([&](Error Err) { P.set_value(std::move(Err)); }, ES, TargetAddr);
- EXPECT_THAT_ERROR(Error(F.get()), Succeeded());
- EXPECT_EQ(VoidVoidCallCount, 1);
-
- cantFail(ES.endSession());
-}
-
-// Target for CallInt32Int32Proxy: doubles its argument, so the forwarded value
-// is observable in the result.
-static int32_t int32Int32Target(int32_t X) { return X * 2; }
-
-// Executor-side wrapper for CallInt32Int32Proxy. Decodes the target address and
-// the int32_t argument, invokes the target, and returns the result.
-static CWrapperFunctionBuffer callInt32Int32Wrapper(const char *ArgData,
- size_t ArgSize) {
- return WrapperFunction<int32_t(SPSExecutorAddr, int32_t)>::handle(
- ArgData, ArgSize,
- [](ExecutorAddr FnAddr, int32_t X) -> int32_t {
- return FnAddr.toPtr<int32_t(int32_t)>()(X);
- })
- .release();
-}
-
-// Exercises a non-void proxy with an argument (so argument forwarding through
-// the pack is covered).
-TEST(SPSProxiesTest, Int32Int32Sync) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- CallInt32Int32Proxy Call(sps::CallInt32Int32ProxySpec::dispatch,
- ExecutorAddr::fromPtr(callInt32Int32Wrapper));
- Expected<int32_t> R = Call(ES, ExecutorAddr::fromPtr(int32Int32Target), 21);
- ASSERT_THAT_EXPECTED(R, Succeeded());
- EXPECT_EQ(*R, 42); // 21 * 2.
-
- cantFail(ES.endSession());
-}
-
-// Target for CallInt32VoidProxy.
-static int32_t int32VoidTarget() { return 42; }
-
-// Executor-side wrapper for CallInt32VoidProxy. Decodes the target address,
-// invokes it as an int32_t() function, and returns the result.
-static CWrapperFunctionBuffer callInt32VoidWrapper(const char *ArgData,
- size_t ArgSize) {
- return WrapperFunction<int32_t(SPSExecutorAddr)>::handle(
- ArgData, ArgSize,
- [](ExecutorAddr FnAddr) -> int32_t {
- return FnAddr.toPtr<int32_t()>()();
- })
- .release();
-}
-
-// Exercises a non-void, zero-argument proxy.
-TEST(SPSProxiesTest, Int32VoidSync) {
- ExecutionSession ES(cantFail(SelfExecutorProcessControl::Create()));
-
- CallInt32VoidProxy Call(sps::CallInt32VoidProxySpec::dispatch,
- ExecutorAddr::fromPtr(callInt32VoidWrapper));
- Expected<int32_t> R = Call(ES, ExecutorAddr::fromPtr(int32VoidTarget));
- ASSERT_THAT_EXPECTED(R, Succeeded());
- EXPECT_EQ(*R, 42);
-
- cantFail(ES.endSession());
-}
diff --git a/llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp b/llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp
index 7ce87be841c2d..ebf7a0942ae2c 100644
--- a/llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp
@@ -201,35 +201,10 @@ TEST_F(VPVerifierTest, VPPhiIncomingValueDoesntDominateIncomingBlock) {
TEST_F(VPVerifierTest, DuplicateSuccessorsOutsideRegion) {
VPlan &Plan = getPlan();
- VPInstruction *BranchOnCond =
- new VPInstruction(VPInstruction::BranchOnCond, {Plan.getFalse()});
- VPInstruction *BranchOnCond2 =
- new VPInstruction(VPInstruction::BranchOnCond, {Plan.getFalse()});
-
- VPBasicBlock *VPBB1 = Plan.getEntry();
- VPBasicBlock *VPBB2 = Plan.createVPBasicBlock("");
- VPBasicBlock *VPBB3 = Plan.createVPBasicBlock("");
-
- VPBB2->appendRecipe(BranchOnCond);
- VPBB3->appendRecipe(BranchOnCond2);
-
- VPRegionBlock *R1 = Plan.createLoopRegion(Type::getInt32Ty(C), DebugLoc(),
- "R1", VPBB2, VPBB2);
- VPBlockUtils::connectBlocks(VPBB1, R1);
- VPBlockUtils::connectBlocks(R1, VPBB3);
-
- // VPBB3 is outside the region and has the scalar header as both successors.
- VPBlockUtils::connectBlocks(VPBB3, Plan.getScalarHeader());
- VPBlockUtils::connectBlocks(VPBB3, Plan.getScalarHeader());
-
- EXPECT_EQ(R1, Plan.getVectorLoopRegion());
-
- // Duplicate successors are allowed for blocks with conditional terminators.
- EXPECT_TRUE(verifyVPlanIsValid(Plan));
-}
-
-TEST_F(VPVerifierTest, VectorLoopRegionWithMultiplePredecessors) {
- VPlan &Plan = getPlan();
+ VPIRValue *Zero = Plan.getConstantInt(32, 0);
+ VPInstruction *I1 =
+ new VPInstruction(Instruction::Add, {Zero, Zero},
+ VPIRFlags::getDefaultFlags(Instruction::Add));
VPInstruction *BranchOnCond =
new VPInstruction(VPInstruction::BranchOnCond, {Plan.getFalse()});
VPInstruction *BranchOnCond2 =
@@ -238,92 +213,19 @@ TEST_F(VPVerifierTest, VectorLoopRegionWithMultiplePredecessors) {
VPBasicBlock *VPBB1 = Plan.getEntry();
VPBasicBlock *VPBB2 = Plan.createVPBasicBlock("");
+ VPBB1->appendRecipe(I1);
VPBB1->appendRecipe(BranchOnCond2);
VPBB2->appendRecipe(BranchOnCond);
VPRegionBlock *R1 = Plan.createLoopRegion(Type::getInt32Ty(C), DebugLoc(),
"R1", VPBB2, VPBB2);
- // Connect the region twice, so it does not have a single predecessor and
- // cannot be reached by following the last successors from the entry.
VPBlockUtils::connectBlocks(VPBB1, R1);
VPBlockUtils::connectBlocks(VPBB1, R1);
- VPBlockUtils::connectBlocks(R1, Plan.getScalarHeader());
-
-#if GTEST_HAS_STREAM_REDIRECTION
- ::testing::internal::CaptureStderr();
-#endif
- EXPECT_FALSE(verifyVPlanIsValid(Plan));
-#if GTEST_HAS_STREAM_REDIRECTION
- EXPECT_STREQ("VPlan must have a single top-level loop region, reachable from "
- "the entry by following the last successor of each block\n",
- ::testing::internal::GetCapturedStderr().c_str());
-#endif
-}
-TEST_F(VPVerifierTest, MultipleTopLevelLoopRegions) {
- VPlan &Plan = getPlan();
- VPInstruction *BranchOnCond =
- new VPInstruction(VPInstruction::BranchOnCond, {Plan.getFalse()});
- VPInstruction *BranchOnCond2 =
- new VPInstruction(VPInstruction::BranchOnCond, {Plan.getFalse()});
-
- VPBasicBlock *VPBB1 = Plan.getEntry();
- VPBasicBlock *VPBB2 = Plan.createVPBasicBlock("");
- VPBasicBlock *VPBB3 = Plan.createVPBasicBlock("");
-
- VPBB2->appendRecipe(BranchOnCond);
- VPBB3->appendRecipe(BranchOnCond2);
-
- VPRegionBlock *R1 = Plan.createLoopRegion(Type::getInt32Ty(C), DebugLoc(),
- "R1", VPBB2, VPBB2);
- VPRegionBlock *R2 = Plan.createLoopRegion(Type::getInt32Ty(C), DebugLoc(),
- "R2", VPBB3, VPBB3);
- VPBlockUtils::connectBlocks(VPBB1, R1);
- VPBlockUtils::connectBlocks(R1, R2);
- VPBlockUtils::connectBlocks(R2, Plan.getScalarHeader());
-
-#if GTEST_HAS_STREAM_REDIRECTION
- ::testing::internal::CaptureStderr();
-#endif
- EXPECT_FALSE(verifyVPlanIsValid(Plan));
-#if GTEST_HAS_STREAM_REDIRECTION
- EXPECT_STREQ("VPlan must have a single top-level loop region, reachable from "
- "the entry by following the last successor of each block\n",
- ::testing::internal::GetCapturedStderr().c_str());
-#endif
-}
-
-TEST_F(VPVerifierTest, EntryBlockWithPredecessor) {
- VPlan &Plan = getPlan();
- VPInstruction *BranchOnCond =
- new VPInstruction(VPInstruction::BranchOnCond, {Plan.getFalse()});
- VPInstruction *BranchOnCond2 =
- new VPInstruction(VPInstruction::BranchOnCond, {Plan.getFalse()});
-
- VPBasicBlock *VPBB1 = Plan.getEntry();
- VPBasicBlock *VPBB2 = Plan.createVPBasicBlock("");
- VPBasicBlock *VPBB3 = Plan.createVPBasicBlock("");
-
- VPBB2->appendRecipe(BranchOnCond);
- VPBB3->appendRecipe(BranchOnCond2);
-
- VPRegionBlock *R1 = Plan.createLoopRegion(Type::getInt32Ty(C), DebugLoc(),
- "R1", VPBB2, VPBB2);
- VPBlockUtils::connectBlocks(VPBB1, R1);
- VPBlockUtils::connectBlocks(R1, VPBB3);
- VPBlockUtils::connectBlocks(VPBB3, Plan.getScalarHeader());
- // Branch back to the entry block, which must be the root of the top-level
- // CFG.
- VPBlockUtils::connectBlocks(VPBB3, VPBB1);
+ VPBlockUtils::connectBlocks(R1, Plan.getScalarHeader());
-#if GTEST_HAS_STREAM_REDIRECTION
- ::testing::internal::CaptureStderr();
-#endif
- EXPECT_FALSE(verifyVPlanIsValid(Plan));
-#if GTEST_HAS_STREAM_REDIRECTION
- EXPECT_STREQ("VPlan entry block has predecessors\n",
- ::testing::internal::GetCapturedStderr().c_str());
-#endif
+ // Duplicate successors are allowed for blocks with conditional terminators.
+ EXPECT_TRUE(verifyVPlanIsValid(Plan));
}
TEST_F(VPVerifierTest, DuplicateSuccessorsInsideRegion) {
diff --git a/llvm/utils/gn/secondary/libcxx/include/BUILD.gn b/llvm/utils/gn/secondary/libcxx/include/BUILD.gn
index 1b4567bfccad0..d8158e4681b28 100644
--- a/llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+++ b/llvm/utils/gn/secondary/libcxx/include/BUILD.gn
@@ -1187,6 +1187,7 @@ if (current_toolchain == default_toolchain) {
"__iterator/static_bounded_iter.h",
"__iterator/unreachable_sentinel.h",
"__iterator/wrap_iter.h",
+ "__locale",
"__locale_dir/check_grouping.h",
"__locale_dir/codecvt.h",
"__locale_dir/collate.h",
diff --git a/llvm/utils/gn/secondary/llvm/unittests/ExecutionEngine/Orc/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/ExecutionEngine/Orc/BUILD.gn
index ef2c2496720d9..63d385d09b747 100644
--- a/llvm/utils/gn/secondary/llvm/unittests/ExecutionEngine/Orc/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/unittests/ExecutionEngine/Orc/BUILD.gn
@@ -16,6 +16,8 @@ unittest("OrcJITTests") {
]
sources = [
"COFFAutoImportGeneratorTest.cpp",
+ "CallSPSViaEPCTest.cpp",
+ "CallableTraitsHelperTest.cpp",
"CoreAPIsTest.cpp",
"EPCGenericDylibManagerTest.cpp",
"EPCGenericJITLinkMemoryManagerTest.cpp",
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
index e670e6699e57d..fc674a7afb55c 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
@@ -767,11 +767,6 @@ def LLVM_InvokeOp
let extraClassDeclaration = [{
/// Returns the callee function type.
LLVMFunctionType getCalleeFunctionType();
-
- /// Successor operands are restricted to LLVM-compatible types.
- bool mayForwardTypeToSuccessor(unsigned index, Type type) {
- return isCompatibleType(type);
- }
}];
}
@@ -1128,12 +1123,6 @@ def LLVM_BrOp : LLVM_TerminatorOp<"br",
}]>,
LLVM_TerminatorPassthroughOpBuilder
];
- let extraClassDeclaration = [{
- /// Successor operands are restricted to LLVM-compatible types.
- bool mayForwardTypeToSuccessor(unsigned index, Type type) {
- return isCompatibleType(type);
- }
- }];
}
def LLVM_CondBrOp
: LLVM_TerminatorOp<
@@ -1171,12 +1160,6 @@ def LLVM_CondBrOp
build($_builder, $_state, condition, trueOperands, falseOperands, branchWeights,
{}, trueDest, falseDest);
}]>, LLVM_TerminatorPassthroughOpBuilder];
- let extraClassDeclaration = [{
- /// Successor operands are restricted to LLVM-compatible types.
- bool mayForwardTypeToSuccessor(unsigned index, Type type) {
- return isCompatibleType(type);
- }
- }];
}
//===----------------------------------------------------------------------===//
@@ -1295,11 +1278,6 @@ def LLVM_SwitchOp
MutableOperandRange getCaseOperandsMutable(unsigned index) {
return getCaseOperandsMutable()[index];
}
-
- /// Successor operands are restricted to LLVM-compatible types.
- bool mayForwardTypeToSuccessor(unsigned index, Type type) {
- return isCompatibleType(type);
- }
}];
}
@@ -1959,12 +1937,6 @@ def LLVM_IndirectBrOp : LLVM_TerminatorOp<"indirectbr",
CArg<"BlockRange", "{}">:$successors
)>
];
- let extraClassDeclaration = [{
- /// Successor operands are restricted to LLVM-compatible types.
- bool mayForwardTypeToSuccessor(unsigned index, Type type) {
- return isCompatibleType(type);
- }
- }];
}
def LLVM_ComdatSelectorOp : LLVM_Op<"comdat_selector", [Symbol]> {
diff --git a/mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h b/mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h
index 6363279f6826b..7d6d565d5a4f4 100644
--- a/mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h
+++ b/mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h
@@ -414,6 +414,21 @@ void populateMemRefFlattenAndVectorNarrowTypeEmulationPatterns(
arith::NarrowTypeEmulationConverter &typeConverter,
RewritePatternSet &patterns);
+/// Rewrite a vector `bitcast(trunci)` to use a more efficient sequence of
+/// vector operations comprising `shuffle` and `bitwise` ops.
+/// Warning: these patterns currently only work for little endian targets.
+FailureOr<Value> rewriteBitCastOfTruncI(RewriterBase &rewriter,
+ vector::BitCastOp bitCastOp,
+ arith::TruncIOp truncOp,
+ vector::BroadcastOp maybeBroadcastOp);
+
+/// Rewrite a vector `ext(bitcast)` to use a more efficient sequence of
+/// vector operations comprising `shuffle` and `bitwise` ops.
+/// Warning: these patterns currently only work for little endian targets.
+FailureOr<Value> rewriteExtOfBitCast(RewriterBase &rewriter, Operation *extOp,
+ vector::BitCastOp bitCastOp,
+ vector::BroadcastOp maybeBroadcastOp);
+
/// Appends patterns for rewriting vector operations over narrow types with
/// ops over wider types.
/// Warning: these patterns currently only work for little endian targets.
diff --git a/mlir/include/mlir/Interfaces/ControlFlowInterfaces.td b/mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
index d6aac2114e467..e0ed1ad3cd691 100644
--- a/mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
+++ b/mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
@@ -98,22 +98,6 @@ def BranchOpInterface : OpInterface<"BranchOpInterface"> {
(ins "::mlir::Type":$lhs, "::mlir::Type":$rhs), [{}],
[{ return lhs == rhs; }]
>,
- InterfaceMethod<[{
- Returns true if a value of the given type may be appended to the
- forwarded operands of the successor at the given index, i.e. whether
- the operation could pass such a value along the corresponding
- control-flow edge. Transformations that thread new values across a
- branch, such as block merging, must check this before appending to
- `getSuccessorOperands`: an operation whose successor operands are
- constrained to a subset of types (the LLVM dialect terminators, for
- example, only forward LLVM-compatible values) would otherwise be
- rewritten into an operation that no longer verifies. The default
- implementation accepts any type.
- }],
- "bool", "mayForwardTypeToSuccessor",
- (ins "unsigned":$index, "::mlir::Type":$type), [{}],
- /*defaultImplementation=*/[{ return true; }]
- >,
];
let verify = [{
diff --git a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
index fc50284fc8a94..ff6a5d4a0c29a 100644
--- a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+++ b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
@@ -3131,11 +3131,11 @@ TypedAttr mlir::arith::getIdentityValueAttr(AtomicRMWKind kind, Type resultType,
return builder.getIntegerAttr(resultType, 1);
case AtomicRMWKind::mulf:
return builder.getFloatAttr(resultType, 1);
- // `assign` is not a reduction and has no identity element.
- case AtomicRMWKind::assign:
+ // TODO: Add remaining reduction operations.
+ default:
+ (void)emitOptionalError(loc, "Reduction operation type not supported");
break;
}
- (void)emitOptionalError(loc, "Reduction operation type not supported");
return nullptr;
}
@@ -3226,11 +3226,11 @@ Value mlir::arith::getReductionOp(AtomicRMWKind op, OpBuilder &builder,
return arith::AndIOp::create(builder, loc, lhs, rhs);
case AtomicRMWKind::xori:
return arith::XOrIOp::create(builder, loc, lhs, rhs);
- // `assign` is not a reduction and has no corresponding binary operation.
- case AtomicRMWKind::assign:
+ // TODO: Add remaining reduction operations.
+ default:
+ (void)emitOptionalError(loc, "Reduction operation type not supported");
break;
}
- (void)emitOptionalError(loc, "Reduction operation type not supported");
return nullptr;
}
diff --git a/mlir/lib/Transforms/Utils/RegionUtils.cpp b/mlir/lib/Transforms/Utils/RegionUtils.cpp
index b63a50f6af0a1..ae3ea83758dab 100644
--- a/mlir/lib/Transforms/Utils/RegionUtils.cpp
+++ b/mlir/lib/Transforms/Utils/RegionUtils.cpp
@@ -831,19 +831,12 @@ LogicalResult BlockMergeCluster::addToCluster(BlockEquivalenceData &blockData) {
return success();
}
-/// Returns true if the predecessor terminators of the given block can have
-/// their operands updated by appending values of the given types: each must
-/// implement BranchOpInterface and be willing to forward every one of the
-/// types to the block.
-static bool ableToUpdatePredOperands(Block *block, ArrayRef<Type> types) {
+/// Returns true if the predecessor terminators of the given block can not have
+/// their operands updated.
+static bool ableToUpdatePredOperands(Block *block) {
for (auto it = block->pred_begin(), e = block->pred_end(); it != e; ++it) {
- auto branch = dyn_cast<BranchOpInterface>((*it)->getTerminator());
- if (!branch)
+ if (!isa<BranchOpInterface>((*it)->getTerminator()))
return false;
- unsigned succIndex = it.getSuccessorIndex();
- for (Type type : types)
- if (!branch.mayForwardTypeToSuccessor(succIndex, type))
- return false;
}
return true;
}
@@ -944,27 +937,11 @@ LogicalResult BlockMergeCluster::merge(RewriterBase &rewriter) {
if (!operandsToMerge.empty()) {
// If the cluster has operands to merge, verify that the predecessor
// terminators of each of the blocks can have their successor operands
- // updated: merging threads the mismatched values through them as new
- // successor operands, so each terminator must be able to forward values
- // of those types. The types are read off the leader block; addToCluster
- // already required every block's mismatched operand types to match.
+ // updated.
// TODO: We could try and sub-partition this cluster if only some blocks
// cause the mismatch.
- SmallVector<Type> operandTypes;
- operandTypes.reserve(operandsToMerge.size());
- {
- unsigned curOpIndex = 0;
- Block::iterator opIt = leaderBlock->begin();
- for (const auto &it : operandsToMerge) {
- std::advance(opIt, it.first - curOpIndex);
- curOpIndex = it.first;
- operandTypes.push_back(opIt->getOperand(it.second).getType());
- }
- }
- if (!ableToUpdatePredOperands(leaderBlock, operandTypes) ||
- !llvm::all_of(blocksToMerge, [&](Block *block) {
- return ableToUpdatePredOperands(block, operandTypes);
- }))
+ if (!ableToUpdatePredOperands(leaderBlock) ||
+ !llvm::all_of(blocksToMerge, ableToUpdatePredOperands))
return failure();
// Collect the iterators for each of the blocks to merge. We will walk all
diff --git a/mlir/test/Dialect/LLVMIR/block-merge-successor-operand-types.mlir b/mlir/test/Dialect/LLVMIR/block-merge-successor-operand-types.mlir
deleted file mode 100644
index 41313d16b76c4..0000000000000
--- a/mlir/test/Dialect/LLVMIR/block-merge-successor-operand-types.mlir
+++ /dev/null
@@ -1,48 +0,0 @@
-// RUN: mlir-opt %s -pass-pipeline='builtin.module(func.func(canonicalize{region-simplify=aggressive}))' -split-input-file | FileCheck %s
-
-// Merging identical blocks threads their differing values through the
-// predecessors' terminators as new successor operands. LLVM dialect
-// terminators only forward LLVM-compatible values, so a merge whose new block
-// arguments would be, say, of index type must be refused -- it used to be
-// performed and produced an llvm.cond_br that no longer verified.
-
-// CHECK-LABEL: func @no_merge_of_non_llvm_types(
-func.func @no_merge_of_non_llvm_types(%m: memref<4xf32>, %c: i1) {
- %f = arith.constant 1.0 : f32
- %i0 = arith.constant 0 : index
- %i1 = arith.constant 1 : index
- // CHECK: llvm.cond_br %{{.*}}, ^[[BB1:.*]], ^[[BB2:.*]]
- llvm.cond_br %c, ^a, ^b
- // CHECK: ^[[BB1]]:
- // CHECK: memref.store
-^a:
- memref.store %f, %m[%i0] : memref<4xf32>
- llvm.return
- // CHECK: ^[[BB2]]:
- // CHECK: memref.store
-^b:
- memref.store %f, %m[%i1] : memref<4xf32>
- llvm.return
-}
-
-// -----
-
-// Differing values of an LLVM-compatible type still merge as before.
-
-llvm.func @use(i32)
-
-// CHECK-LABEL: func @merge_of_llvm_types(
-func.func @merge_of_llvm_types(%c: i1) {
- %i0 = llvm.mlir.constant(0 : i32) : i32
- %i1 = llvm.mlir.constant(1 : i32) : i32
- // CHECK: llvm.cond_br %{{.*}}, ^[[BB:.*]](%{{.*}} : i32), ^[[BB]](%{{.*}} : i32)
- llvm.cond_br %c, ^a, ^b
- // CHECK: ^[[BB]](%[[ARG:.*]]: i32):
- // CHECK: llvm.call @use(%[[ARG]])
-^a:
- llvm.call @use(%i0) : (i32) -> ()
- llvm.return
-^b:
- llvm.call @use(%i1) : (i32) -> ()
- llvm.return
-}
diff --git a/offload/include/OpenMP/OMPT/Callback.h b/offload/include/OpenMP/OMPT/Callback.h
index 2bc3f59dcd3ee..9d545c643223f 100644
--- a/offload/include/OpenMP/OMPT/Callback.h
+++ b/offload/include/OpenMP/OMPT/Callback.h
@@ -69,14 +69,18 @@ extern ompt_get_callback_t lookupCallbackByCode;
/// \p InterfaceFunctionName the name of the OMPT callback function to look up
extern ompt_function_lookup_t lookupCallbackByName;
-/// Initializes OMPT in this library. Passed to libomp via ompt_libomp_connect.
+/// This is the function called by the higher layer (libomp / libomtarget)
+/// responsible for initializing OMPT in this library. This is passed to libomp
+/// as part of the OMPT connector object.
/// \p lookup to be used to query callbacks registered with libomp
/// \p initial_device_num initial device num (id) provided by libomp
/// \p tool_data as provided by the tool
int initializeLibrary(ompt_function_lookup_t lookup, int initial_device_num,
ompt_data_t *tool_data);
-/// Finalizes OMPT in this library. Passed to libomp via ompt_libomp_connect.
+/// This function is passed to libomp / libomtarget as part of the OMPT
+/// connector object. It is called by libomp during finalization of OMPT in
+/// libomptarget -OR- by libomptarget during finalization of OMPT in the plugin.
/// \p tool_data as provided by the tool
void finalizeLibrary(ompt_data_t *tool_data);
diff --git a/offload/include/OpenMP/OMPT/Connector.h b/offload/include/OpenMP/OMPT/Connector.h
new file mode 100644
index 0000000000000..add8941cc4905
--- /dev/null
+++ b/offload/include/OpenMP/OMPT/Connector.h
@@ -0,0 +1,112 @@
+//===-- OpenMP/OMPT/Connector.h - OpenMP Tooling lib connector -*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Support used by OMPT implementation to establish communication between
+// various OpenMP runtime libraries: host openmp library, target-independent
+// runtime library, and device-dependent runtime libraries.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef OMPTARGET_OPENMP_OMPT_CONNECTOR_H
+#define OMPTARGET_OPENMP_OMPT_CONNECTOR_H
+
+#ifdef OMPT_SUPPORT
+
+#include "llvm/Support/DynamicLibrary.h"
+
+#include <memory>
+#include <string>
+
+#include "omp-tools.h"
+#include "omptarget.h"
+
+#include "Shared/Debug.h"
+
+using namespace llvm::omp::target::debug;
+
+#pragma push_macro("DEBUG_PREFIX")
+#undef DEBUG_PREFIX
+#define DEBUG_PREFIX "OMPT"
+
+/// Type for the function to be invoked for connecting two libraries.
+typedef void (*OmptConnectRtnTy)(ompt_start_tool_result_t *result);
+
+/// Establish connection between openmp runtime libraries
+///
+/// This class is used to communicate between an OMPT implementation in
+/// libomptarget and libomp. It is also used to communicate between an
+/// OMPT implementation in a device-specific plugin and
+/// libomptarget. The decision whether OMPT is enabled or not needs to
+/// be made when the library is loaded before any functions in the
+/// library are invoked. For that reason, an instance of this class is
+/// intended to be defined in the constructor for libomptarget or a
+/// plugin so that the decision about whether OMPT is supposed to be
+/// enabled is known before any interface function in the library is
+/// invoked.
+class OmptLibraryConnectorTy {
+public:
+ /// Use \p LibName as the prefix of the global function used for connecting
+ /// two libraries, the source indicated by \p LibName and the destination
+ /// being the one that creates this object.
+ OmptLibraryConnectorTy(const char *Ident) {
+ LibIdent.append(Ident);
+ IsInitialized = false;
+ }
+ OmptLibraryConnectorTy() = delete;
+ /// Use \p OmptResult init to connect the two libraries denoted by this
+ /// object. The init function of \p OmptResult will be used during connection
+ /// and the fini function of \p OmptResult will be used during teardown.
+ void connect(ompt_start_tool_result_t *OmptResult) {
+ initialize();
+ if (!LibConnHandle)
+ return;
+ // Call the function provided by the source library for connect
+ LibConnHandle(OmptResult);
+ }
+
+private:
+ void initialize() {
+ if (IsInitialized)
+ return;
+
+ std::string ErrMsg;
+ std::string LibName = LibIdent;
+ LibName += ".so";
+
+ ODBG(ODT_Tool) << "OMPT: Trying to load library " << LibName;
+ auto DynLibHandle = std::make_unique<llvm::sys::DynamicLibrary>(
+ llvm::sys::DynamicLibrary::getPermanentLibrary(LibName.c_str(),
+ &ErrMsg));
+ if (!DynLibHandle->isValid()) {
+ // The upper layer will bail out if the handle is null.
+ LibConnHandle = nullptr;
+ } else {
+ auto LibConnRtn = "ompt_" + LibIdent + "_connect";
+ ODBG(ODT_Tool) << "OMPT: Trying to get address of connection routine "
+ << LibConnRtn;
+ LibConnHandle = reinterpret_cast<OmptConnectRtnTy>(
+ DynLibHandle->getAddressOfSymbol(LibConnRtn.c_str()));
+ }
+ ODBG(ODT_Tool) << "OMPT: Library connection handle = "
+ << reinterpret_cast<void *>(LibConnHandle);
+ IsInitialized = true;
+ }
+
+ /// Ensure initialization occurs only once
+ bool IsInitialized;
+ /// Handle of connect routine provided by source library
+ OmptConnectRtnTy LibConnHandle;
+ /// Name of connect routine provided by source library
+ std::string LibIdent;
+};
+
+#endif // OMPT_SUPPORT
+
+#pragma pop_macro("DEBUG_PREFIX")
+
+#endif // OMPTARGET_OPENMP_OMPT_CONNECTOR_H
diff --git a/offload/libomptarget/OpenMP/OMPT/Callback.cpp b/offload/libomptarget/OpenMP/OMPT/Callback.cpp
index 150fcb85015f7..1e03f1455d1b2 100644
--- a/offload/libomptarget/OpenMP/OMPT/Callback.cpp
+++ b/offload/libomptarget/OpenMP/OMPT/Callback.cpp
@@ -19,15 +19,14 @@
#include "Shared/Debug.h"
#include "OpenMP/OMPT/Callback.h"
+#include "OpenMP/OMPT/Connector.h"
#include "OpenMP/OMPT/Interface.h"
+#include "llvm/Support/DynamicLibrary.h"
+
#undef DEBUG_PREFIX
#define DEBUG_PREFIX "OMPT"
-/// Registers this library's initialize and finalize functions with libomp,
-/// which always defines this entry point (a stub if built without OMPT).
-extern "C" void ompt_libomp_connect(ompt_start_tool_result_t *);
-
// Define OMPT callback functions (bound to actual callbacks later on)
#define defineOmptCallback(Name, Type, Code) \
Name##_t llvm::omp::target::ompt::Name##_fn = nullptr;
@@ -538,14 +537,18 @@ void llvm::omp::target::ompt::finalizeLibrary(ompt_data_t *data) {
void llvm::omp::target::ompt::connectLibrary() {
ODBG(ODT_Tool) << "Entering connectLibrary";
- // libomp retains this pointer to run the finalizer
+ // Connect with libomp
+ static OmptLibraryConnectorTy LibompConnector("libomp");
static ompt_start_tool_result_t OmptResult;
+
+ // Initialize OmptResult with the init and fini functions that will be
+ // called by the connector
OmptResult.initialize = ompt::initializeLibrary;
OmptResult.finalize = ompt::finalizeLibrary;
OmptResult.tool_data.value = 0;
- // Calls initializeLibrary if a tool enabled OMPT
- ompt_libomp_connect(&OmptResult);
+ // Now call connect that causes the above init/fini functions to be called
+ LibompConnector.connect(&OmptResult);
#define bindOmptCallback(Name, Type, Code) \
if (lookupCallbackByCode) \
diff --git a/openmp/runtime/src/ompt-general.cpp b/openmp/runtime/src/ompt-general.cpp
index 79b56f35fb5be..8f1ba4910815e 100644
--- a/openmp/runtime/src/ompt-general.cpp
+++ b/openmp/runtime/src/ompt-general.cpp
@@ -948,8 +948,8 @@ static ompt_interface_fn_t ompt_libomp_target_fn_lookup(const char *s) {
return (ompt_interface_fn_t)0;
}
-/// This function is called by libomptarget to assign callbacks already
-/// registered with libomp.
+/// This function is called by the libomptarget connector to assign
+/// callbacks already registered with libomp.
_OMP_EXTERN void ompt_libomp_connect(ompt_start_tool_result_t *result) {
OMPT_VERBOSE_INIT_PRINT("libomp --> OMPT: Enter ompt_libomp_connect\n");
>From c9634d655ca61454b19ac88d68dc4f2ff80fb236 Mon Sep 17 00:00:00 2001
From: Durgesh Nandan Mohanty <durgeshnandanmohanty at gmail.com>
Date: Sun, 9 Aug 2026 18:41:29 +0000
Subject: [PATCH 2/2] [AArch64] Fold vector
fptoui/fptosi(fdiv(uitofp/sitofp(x), uitofp/sitofp(y))) into udiv/sdiv for
SVE
---
.../Target/AArch64/AArch64ISelLowering.cpp | 36 ++++++++++++++++---
1 file changed, 31 insertions(+), 5 deletions(-)
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 2ac6c5fbc471a..15fde3cc33351 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -21683,12 +21683,38 @@ static SDValue performIntToFpCombine(SDNode *N, SelectionDAG &DAG,
static SDValue performFpToIntCombine(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI,
const AArch64Subtarget *Subtarget) {
- if (SDValue Res =
- tryToReplaceScalarFPConversionWithSVE(N, DAG, DCI, Subtarget))
- return Res;
+ static SDValue performFpToIntCombine(SDNode * N, SelectionDAG & DAG,
+ TargetLowering::DAGCombinerInfo & DCI,
+ const AArch64Subtarget *Subtarget) {
+ if (SDValue Res =
+ tryToReplaceScalarFPConversionWithSVE(N, DAG, DCI, Subtarget))
+ return Res;
- return SDValue();
-}
+ EVT VT = N->getValueType(0);
+ if (VT.isScalableVector() && Subtarget->hasSVE()) {
+ SDValue FDiv = N->getOperand(0);
+ if (FDiv.getOpcode() == ISD::FDIV && FDiv.hasOneUse() &&
+ VT.getVectorElementType() == MVT::i32 &&
+ FDiv.getValueType().getVectorElementType() == MVT::f64) {
+ unsigned ToFPOpcode = (N->getOpcode() == ISD::FP_TO_UINT)
+ ? ISD::UINT_TO_FP
+ : ISD::SINT_TO_FP;
+ unsigned DivOpcode =
+ (N->getOpcode() == ISD::FP_TO_UINT) ? ISD::UDIV : ISD::SDIV;
+ SDValue Op0 = FDiv.getOperand(0);
+ SDValue Op1 = FDiv.getOperand(1);
+
+ if (Op0.getOpcode() == ToFPOpcode && Op1.getOpcode() == ToFPOpcode &&
+ Op0.getOperand(0).getValueType() == VT &&
+ Op1.getOperand(0).getValueType() == VT) {
+ return DAG.getNode(DivOpcode, SDLoc(N), VT, Op0.getOperand(0),
+ Op1.getOperand(0));
+ }
+ }
+ }
+
+ return SDValue();
+ }
// Given a tree of and/or(csel(0, 1, cc0), csel(0, 1, cc1)), we may be able to
// convert to csel(ccmp(.., cc0)), depending on cc1:
More information about the flang-commits
mailing list