[llvm-branch-commits] [llvm] 36fe1a9 - [GlobalISel] Fix -Wunused-variable

Fangrui Song via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Nov 30 18:30:35 PST 2020


Author: Fangrui Song
Date: 2020-11-30T18:25:54-08:00
New Revision: 36fe1a9dea94ad2babfec3acdf366dabd19db550

URL: https://github.com/llvm/llvm-project/commit/36fe1a9dea94ad2babfec3acdf366dabd19db550
DIFF: https://github.com/llvm/llvm-project/commit/36fe1a9dea94ad2babfec3acdf366dabd19db550.diff

LOG: [GlobalISel] Fix -Wunused-variable

Added: 
    

Modified: 
    llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
index 1e39605c90be..8abee20690f8 100644
--- a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
@@ -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);


        


More information about the llvm-branch-commits mailing list