[llvm] ee99426 - [AArch64] Revise a warning fix

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 14 10:47:08 PST 2021


Author: Kazu Hirata
Date: 2021-12-14T10:46:57-08:00
New Revision: ee99426c770605bd3eacc0d908a9b30e7f61dab9

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

LOG: [AArch64] Revise a warning fix

This patch revises the warning fix done in
a93b1792f1c8f7e2e7c931993110dc48f7ddba01.  Specifically, it rolls the
MRI.getType call into the assert, thereby avoiding the named variable.

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp b/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
index bbf6720985b2c..3dec980a819a4 100644
--- a/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
+++ b/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
@@ -312,9 +312,8 @@ static void applySplitStoreZero128(MachineInstr &MI, MachineRegisterInfo &MRI,
                                    GISelChangeObserver &Observer) {
   B.setInstrAndDebugLoc(MI);
   GStore &Store = cast<GStore>(MI);
-  LLT ValTy = MRI.getType(Store.getValueReg());
-  assert(ValTy.isVector() && "Expected a vector store value");
-  (void)ValTy;
+  assert(MRI.getType(Store.getValueReg()).isVector() &&
+         "Expected a vector store value");
   LLT NewTy = LLT::scalar(64);
   Register PtrReg = Store.getPointerReg();
   auto Zero = B.buildConstant(NewTy, 0);


        


More information about the llvm-commits mailing list