[llvm] r291813 - [DebugInfo] Remove redundant check in SimplifyCFG; NFC.
Robert Lougher via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 12 13:11:09 PST 2017
Author: rlougher
Date: Thu Jan 12 15:11:09 2017
New Revision: 291813
URL: http://llvm.org/viewvc/llvm-project?rev=291813&view=rev
Log:
[DebugInfo] Remove redundant check in SimplifyCFG; NFC.
Modified:
llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=291813&r1=291812&r2=291813&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Thu Jan 12 15:11:09 2017
@@ -1275,10 +1275,9 @@ static bool HoistThenElseCodeToIf(Branch
LLVMContext::MD_mem_parallel_loop_access};
combineMetadata(I1, I2, KnownIDs);
- // If the debug loc for I1 and I2 are different, as we are combining them
- // into one instruction, we do not want to select debug loc randomly from
- // I1 or I2.
- if (!isa<CallInst>(I1) && I1->getDebugLoc() != I2->getDebugLoc())
+ // I1 and I2 are being combined into a single instruction. Its debug
+ // location is the merged locations of the original instructions.
+ if (!isa<CallInst>(I1))
I1->setDebugLoc(
DILocation::getMergedLocation(I1->getDebugLoc(), I2->getDebugLoc()));
More information about the llvm-commits
mailing list