From: Serguei Katkov Date: Sun, 5 Nov 2017 07:59:02 +0000 (+0000) Subject: [CGP] Fix the bug found by asan. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d3469412e0c2e079fede5a837b2775bd85d405c3;p=llvm [CGP] Fix the bug found by asan. Try to fix the asan failure introduced by r317429. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317431 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenPrepare.cpp b/lib/CodeGen/CodeGenPrepare.cpp index 0c0bc4d13aa..2a678291c42 100644 --- a/lib/CodeGen/CodeGenPrepare.cpp +++ b/lib/CodeGen/CodeGenPrepare.cpp @@ -4278,8 +4278,8 @@ bool CodeGenPrepare::optimizeMemoryInst(Instruction *MemoryInst, Value *Addr, // the graph are compatible. bool PhiOrSelectSeen = false; SmallVector 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();