[llvm] 2ed8900 - [X86] X86CmovConverterPass::convertCmovInstsToBranches - take a copy of the DebugLoc not a reference as it may be deleted.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat May 15 08:14:02 PDT 2021


Author: Simon Pilgrim
Date: 2021-05-15T16:13:34+01:00
New Revision: 2ed89001e14692b52ad728388268e8369e10e05a

URL: https://github.com/llvm/llvm-project/commit/2ed89001e14692b52ad728388268e8369e10e05a
DIFF: https://github.com/llvm/llvm-project/commit/2ed89001e14692b52ad728388268e8369e10e05a.diff

LOG: [X86] X86CmovConverterPass::convertCmovInstsToBranches - take a copy of the DebugLoc not a reference as it may be deleted.

Fixes msan warning due to rG9ca2c50b3601

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86CmovConversion.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86CmovConversion.cpp b/llvm/lib/Target/X86/X86CmovConversion.cpp
index d58566c20215..a2de0dc08292 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);


        


More information about the llvm-commits mailing list