From 2ed89001e14692b52ad728388268e8369e10e05a Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 15 May 2021 16:13:34 +0100 Subject: [PATCH] [X86] X86CmovConverterPass::convertCmovInstsToBranches - take a copy of the DebugLoc not a reference as it may be deleted. Fixes msan warning due to rG9ca2c50b3601 --- llvm/lib/Target/X86/X86CmovConversion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/X86/X86CmovConversion.cpp b/llvm/lib/Target/X86/X86CmovConversion.cpp index d58566c20215b..a2de0dc08292c 100644 --- a/llvm/lib/Target/X86/X86CmovConversion.cpp +++ b/llvm/lib/Target/X86/X86CmovConversion.cpp @@ -650,7 +650,7 @@ void X86CmovConverterPass::convertCmovInstsToBranches( MachineInstr &MI = *Group.front(); MachineInstr *LastCMOV = Group.back(); - const DebugLoc &DL = MI.getDebugLoc(); + DebugLoc DL = MI.getDebugLoc(); X86::CondCode CC = X86::CondCode(X86::getCondFromCMov(MI)); X86::CondCode OppCC = X86::GetOppositeBranchCondition(CC);