From 15949a13ec262587ec074632ccdd05e9cd0c5ec2 Mon Sep 17 00:00:00 2001 From: Valentijn van de Beek Date: Tue, 1 Oct 2024 21:46:25 +0200 Subject: [PATCH] Fixup! Create undef using buildUndef --- llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp index 8ef2b03571a9dc1..cd79df7c76fdc9f 100644 --- a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp @@ -4284,12 +4284,11 @@ void CombinerHelper::applyCombineExtractToShuffle( } // We could reuse the same vector register and shuffle them both together - // but it is nicer for later optimizations to explicitely make it undef. + // but it is nicer for later optimizations to explicitly make it undef. const GBuildVector *BuildVector = cast(&MI); Register SecondRegister = VectorRegisters.second; if (FirstRegister == SecondRegister) { - SecondRegister = MRI.createGenericVirtualRegister(FirstRegisterType); - Builder.buildUndef(SecondRegister); + SecondRegister = Builder.buildUndef(FirstRegisterType).getReg(0); } Builder.buildShuffleVector(BuildVector->getOperand(0), FirstRegister,