Skip to content

[DAG] Adding MVT::widenIntegerElementType to widen both Scalar and Vectors of integer type.#207148

Merged
RKSimon merged 21 commits into
llvm:mainfrom
ChiragPatel8:Issue_206730
Jul 8, 2026
Merged

[DAG] Adding MVT::widenIntegerElementType to widen both Scalar and Vectors of integer type.#207148
RKSimon merged 21 commits into
llvm:mainfrom
ChiragPatel8:Issue_206730

Conversation

@ChiragPatel8

Copy link
Copy Markdown
Contributor

Adding MVT::widenIntegerElementType to widen both Scalar and Vectors of integer type. e.g. i16 -> i32, v8i32->v8i64.

fixes #206730

@ChiragPatel8

Copy link
Copy Markdown
Contributor Author

cc @RKSimon

@RKSimon RKSimon self-requested a review July 2, 2026 10:04

@RKSimon RKSimon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Find a few examples of uses - no need to be exhaustive, but you should have scalar vector and combined scalar/vector coverage.

HexagonISelLowering.cpp has a few examples

Comment thread llvm/include/llvm/CodeGenTypes/MachineValueType.h Outdated
@ChiragPatel8

Copy link
Copy Markdown
Contributor Author

I have made few replacement in Hexagon target files and ran check-llvm test. I would appreciate if someone from Hexagon target maintainer could take a look. Changes seem minor to my eyes. Thank you.

@ChiragPatel8 ChiragPatel8 requested a review from RKSimon July 4, 2026 09:38
Comment thread llvm/include/llvm/CodeGenTypes/MachineValueType.h
@ChiragPatel8 ChiragPatel8 requested a review from RKSimon July 7, 2026 09:47
nxv2i32.getSizeInBits());
}

TEST(ScalableVectorMVTsTest, WideningIntegerMVTs) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these are scalable vector tests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you kindly point me to the file where these tests should go ? or should I add new unittest file MVTTests.cpp with these tests?

@ChiragPatel8 ChiragPatel8 requested a review from RKSimon July 7, 2026 20:47

@RKSimon RKSimon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - cheers (Codegen usage is a lot more useful than unit tests here)

@RKSimon RKSimon enabled auto-merge (squash) July 8, 2026 08:42
@RKSimon RKSimon merged commit 736771b into llvm:main Jul 8, 2026
10 of 11 checks passed
@llvm-ci

llvm-ci commented Jul 8, 2026

Copy link
Copy Markdown

LLVM Buildbot has detected a new failure on builder release-noassertions-warnings running on google-integrate-b1 while building llvm at step 6 "build-default".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/228/builds/4056

Here is the relevant piece of the build log for the reference
Step 6 (build-default) failure: cmake (failure)
...
154.159 [2683/34/5925] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonMachineFunctionInfo.cpp.o
154.218 [2682/34/5926] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonOptimizeSZextends.cpp.o
154.312 [2681/34/5927] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonCommonGEP.cpp.o
154.326 [2680/34/5928] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonHardwareLoops.cpp.o
154.717 [2679/34/5929] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonNewValueJump.cpp.o
154.780 [2678/34/5930] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonMCInstLower.cpp.o
155.028 [2677/34/5931] Building CXX object lib/Target/ARM/Disassembler/CMakeFiles/LLVMARMDisassembler.dir/ARMDisassembler.cpp.o
155.163 [2676/34/5932] Linking CXX static library lib/libLLVMARMDisassembler.a
155.364 [2675/34/5933] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonQFPOptimizer.cpp.o
155.465 [2674/34/5934] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonISelLowering.cpp.o
FAILED: lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonISelLowering.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /usr/bin/c++ -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/release-noassertions-warnings-build/build/lib/Target/Hexagon -I/b/release-noassertions-warnings-build/llvm-project/llvm/lib/Target/Hexagon -I/b/release-noassertions-warnings-build/build/include -I/b/release-noassertions-warnings-build/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -O3 -DNDEBUG -std=c++17 -fvisibility=hidden -fno-exceptions -funwind-tables -fno-rtti -Winvalid-pch -Xclang -include-pch -Xclang /b/release-noassertions-warnings-build/build/lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /b/release-noassertions-warnings-build/build/lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/cmake_pch.hxx -MD -MT lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonISelLowering.cpp.o -MF lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonISelLowering.cpp.o.d -o lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonISelLowering.cpp.o -c /b/release-noassertions-warnings-build/llvm-project/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
/b/release-noassertions-warnings-build/llvm-project/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp:1069:9: error: unused variable 'ElemTy' [-Werror,-Wunused-variable]
 1069 |     MVT ElemTy = OpTy.getVectorElementType();
      |         ^~~~~~
/b/release-noassertions-warnings-build/llvm-project/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp:1126:9: error: unused variable 'ElemTy' [-Werror,-Wunused-variable]
 1126 |     MVT ElemTy = OpTy.getVectorElementType();
      |         ^~~~~~
2 errors generated.
155.507 [2674/33/5935] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonPeephole.cpp.o
155.892 [2674/32/5936] Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMISelLowering.cpp.o
155.957 [2674/31/5937] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonSelectionDAGInfo.cpp.o
156.006 [2674/30/5938] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonSplitConst32AndConst64.cpp.o
156.021 [2674/29/5939] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonGenInsert.cpp.o
156.265 [2674/28/5940] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonXQFloatGenerator.cpp.o
156.329 [2674/27/5941] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonTargetObjectFile.cpp.o
156.534 [2674/26/5942] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonOptAddrMode.cpp.o
157.100 [2674/25/5943] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonISelLoweringHVX.cpp.o
157.147 [2674/24/5944] Building CXX object lib/Target/BPF/CMakeFiles/LLVMBPFCodeGen.dir/BPFTargetMachine.cpp.o
157.165 [2674/23/5945] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonVectorPrint.cpp.o
157.176 [2674/22/5946] Building CXX object lib/Target/AMDGPU/CMakeFiles/LLVMAMDGPUCodeGen.dir/AMDGPUTargetMachine.cpp.o
157.249 [2674/21/5947] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonRegisterInfo.cpp.o
157.251 [2674/20/5948] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonTfrCleanup.cpp.o
157.338 [2674/19/5949] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonRDFOpt.cpp.o
157.347 [2674/18/5950] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonFrameLowering.cpp.o
157.404 [2674/17/5951] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonLoadStoreWidening.cpp.o
157.626 [2674/16/5952] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonSplitDouble.cpp.o
157.814 [2674/15/5953] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonVectorLoopCarriedReuse.cpp.o
157.855 [2674/14/5954] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonSubtarget.cpp.o
157.947 [2674/13/5955] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonGlobalScheduler.cpp.o
157.957 [2674/12/5956] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonISelDAGToDAGHVX.cpp.o
158.176 [2674/11/5957] Building CXX object lib/Target/ARM/AsmParser/CMakeFiles/LLVMARMAsmParser.dir/ARMAsmParser.cpp.o
158.433 [2674/10/5958] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonPostRAHandleQFP.cpp.o
158.531 [2674/9/5959] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonISelDAGToDAG.cpp.o
158.952 [2674/8/5960] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonInstrInfo.cpp.o
159.312 [2674/7/5961] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonLoopIdiomRecognition.cpp.o
159.560 [2674/6/5962] Building CXX object lib/Target/Lanai/CMakeFiles/LLVMLanaiCodeGen.dir/LanaiCodeGenPassBuilder.cpp.o
160.406 [2674/5/5963] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonTargetTransformInfo.cpp.o
162.586 [2674/4/5964] Building CXX object lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonTargetMachine.cpp.o

RKSimon pushed a commit that referenced this pull request Jul 8, 2026
llvm-sync Bot pushed a commit to arm/arm-toolchain that referenced this pull request Jul 8, 2026
llvm-upstreamsync Bot pushed a commit to qualcomm/cpullvm-toolchain that referenced this pull request Jul 8, 2026
llvm-upstream-sync Bot pushed a commit to sriyalamar/cpullvm-toolchain that referenced this pull request Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DAG] Add MVT::widenIntegerElementType and MVT::widenIntegerVectorElementType

3 participants