Skip to content

Commit

Permalink
Fixup! Create undef using buildUndef
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentijnvdBeek committed Oct 1, 2024
1 parent 7e961db commit 15949a1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<GBuildVector>(&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,
Expand Down

0 comments on commit 15949a1

Please sign in to comment.