aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavide Italiano <ditaliano@apple.com>2020-06-15 14:25:30 -0700
committerDavide Italiano <ditaliano@apple.com>2020-06-15 14:25:43 -0700
commitc2dccf9d5e34278cb2ed0a018405848850508b99 (patch)
tree8cc23084639887c722d2a432332c3fa6ccf21f2b /llvm/lib
parenta93ff1826b4bfd1674ea99dd45609b9e07792f6c (diff)
downloadllvm-c2dccf9d5e34278cb2ed0a018405848850508b99.zip
llvm-c2dccf9d5e34278cb2ed0a018405848850508b99.tar.gz
llvm-c2dccf9d5e34278cb2ed0a018405848850508b99.tar.bz2
[CodeGenPrepare] Reset the debug location when promoting trunc(s)
The promotion machinery in CGP moves instructions retaining debug locations. When the transformation is local, this is mostly correct, but when instructions are moved cross-BBs, this is not always true and causes jumpiness in line tables. This is the first of a series of commits. sext(s) and zext(s) need to be treated similarly. Differential Revision: https://reviews.llvm.org/D81879
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index d238804..935fc95 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -2605,6 +2605,7 @@ class TypePromotionTransaction {
/// trunc Opnd to Ty.
TruncBuilder(Instruction *Opnd, Type *Ty) : TypePromotionAction(Opnd) {
IRBuilder<> Builder(Opnd);
+ Builder.SetCurrentDebugLocation(DebugLoc());
Val = Builder.CreateTrunc(Opnd, Ty, "promoted");
LLVM_DEBUG(dbgs() << "Do: TruncBuilder: " << *Val << "\n");
}