[CGP] Fix the bug found by asan.
authorSerguei Katkov <serguei.katkov@azul.com>
Sun, 5 Nov 2017 07:59:02 +0000 (07:59 +0000)
committerSerguei Katkov <serguei.katkov@azul.com>
Sun, 5 Nov 2017 07:59:02 +0000 (07:59 +0000)
Try to fix the asan failure introduced by r317429.

llvm-svn: 317431

llvm/lib/CodeGen/CodeGenPrepare.cpp

index 0c0bc4d..2a67829 100644 (file)
@@ -4278,8 +4278,8 @@ bool CodeGenPrepare::optimizeMemoryInst(Instruction *MemoryInst, Value *Addr,
   // the graph are compatible.
   bool PhiOrSelectSeen = false;
   SmallVector<Instruction*, 16> AddrModeInsts;
-  AddressingModeCombiner AddrModes({ *DL, TLInfo },
-                                   { Addr, MemoryInst->getParent() });
+  const SimplifyQuery SQ(*DL, TLInfo);
+  AddressingModeCombiner AddrModes(SQ, { Addr, MemoryInst->getParent() });
   TypePromotionTransaction TPT(RemovedInsts);
   TypePromotionTransaction::ConstRestorationPt LastKnownGood =
       TPT.getRestorationPoint();