[GlobalISel] Fix -Wunused-variable
authorFangrui Song <i@maskray.me>
Tue, 1 Dec 2020 02:25:53 +0000 (18:25 -0800)
committerFangrui Song <i@maskray.me>
Tue, 1 Dec 2020 02:25:54 +0000 (18:25 -0800)
llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp

index 1e39605..8abee20 100644 (file)
@@ -638,8 +638,8 @@ MachineIRBuilder::buildBuildVectorTrunc(const DstOp &Res,
 MachineInstrBuilder MachineIRBuilder::buildShuffleSplat(const DstOp &Res,
                                                         const SrcOp &Src) {
   LLT DstTy = Res.getLLTTy(*getMRI());
-  LLT SrcTy = Src.getLLTTy(*getMRI());
-  assert(SrcTy == DstTy.getElementType() && "Expected Src to match Dst elt ty");
+  assert(Src.getLLTTy(*getMRI()) == DstTy.getElementType() &&
+         "Expected Src to match Dst elt ty");
   auto UndefVec = buildUndef(DstTy);
   auto Zero = buildConstant(LLT::scalar(64), 0);
   auto InsElt = buildInsertVectorElement(DstTy, UndefVec, Src, Zero);