[CGP] Fix the bug found by asan.

Try to fix the asan failure introduced by r317429.

llvm-svn: 317431
This commit is contained in:
Serguei Katkov 2017-11-05 07:59:02 +00:00
parent cde03f3d27
commit aee6375b02
1 changed files with 2 additions and 2 deletions

View 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();