[SelectionDAG] Move variable declaration to its first assignment. NFC
authorCraig Topper <craig.topper@sifive.com>
Mon, 3 Apr 2023 21:02:26 +0000 (14:02 -0700)
committerCraig Topper <craig.topper@sifive.com>
Mon, 3 Apr 2023 21:03:05 +0000 (14:03 -0700)
We declared this variable and assigned it to true, but then overwrote
it before its first use.

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

index bb9cc40..0a34856 100644 (file)
@@ -7503,13 +7503,12 @@ void SelectionDAGBuilder::visitVPLoad(
   AAMDNodes AAInfo = VPIntrin.getAAMetadata();
   const MDNode *Ranges = VPIntrin.getMetadata(LLVMContext::MD_range);
   SDValue LD;
-  bool AddToChain = true;
   // Do not serialize variable-length loads of constant memory with
   // anything.
   if (!Alignment)
     Alignment = DAG.getEVTAlign(VT);
   MemoryLocation ML = MemoryLocation::getAfter(PtrOperand, AAInfo);
-  AddToChain = !AA || !AA->pointsToConstantMemory(ML);
+  bool AddToChain = !AA || !AA->pointsToConstantMemory(ML);
   SDValue InChain = AddToChain ? DAG.getRoot() : DAG.getEntryNode();
   MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand(
       MachinePointerInfo(PtrOperand), MachineMemOperand::MOLoad,