From d3469412e0c2e079fede5a837b2775bd85d405c3 Mon Sep 17 00:00:00 2001 From: Serguei Katkov Date: Sun, 5 Nov 2017 07:59:02 +0000 Subject: [PATCH] [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 --- lib/CodeGen/CodeGenPrepare.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); -- 2.50.1