summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 39d66e0f9b0..e75127f77e8 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1492,6 +1492,7 @@ void llvm::salvageDebugInfo(Instruction &I) {
return;
auto &M = *I.getModule();
+ auto &DL = M.getDataLayout();
auto wrapMD = [&](Value *V) {
return MetadataAsValue::get(I.getContext(), ValueAsMetadata::get(V));
@@ -1519,7 +1520,7 @@ void llvm::salvageDebugInfo(Instruction &I) {
};
if (auto *CI = dyn_cast<CastInst>(&I)) {
- if (!CI->isNoopCast(M.getDataLayout()))
+ if (!CI->isNoopCast(DL))
return;
// No-op casts are irrelevant for debug info.
@@ -1539,6 +1540,7 @@ void llvm::salvageDebugInfo(Instruction &I) {
for (auto *DII : DbgUsers)
applyOffset(DII, Offset.getSExtValue());
} else if (auto *BI = dyn_cast<BinaryOperator>(&I)) {
+ // Rewrite binary operations with constant integer operands.
auto *ConstInt = dyn_cast<ConstantInt>(I.getOperand(1));
if (!ConstInt || ConstInt->getBitWidth() > 64)
return;
OpenPOWER on IntegriCloud