summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorstozer <stephen.tozer@sony.com>2019-12-18 11:46:10 +0000
committerstozer <stephen.tozer@sony.com>2019-12-18 11:46:10 +0000
commit1f3dd83cc1f2b8f72b9d59e2b4221b12fb7f9a95 (patch)
tree3d2a01dc183bd1f08d3f95da5a62fcb9bf399dd8 /llvm/lib/Transforms/Utils
parentbad6a76041ee4c360f96bdaa1f4cc5606eda203e (diff)
downloadbcm5719-llvm-1f3dd83cc1f2b8f72b9d59e2b4221b12fb7f9a95.tar.gz
bcm5719-llvm-1f3dd83cc1f2b8f72b9d59e2b4221b12fb7f9a95.zip
Revert "[DebugInfo] Correctly handle salvaged casts and split fragments at ISel"
Reverted due to build failure on windows bots. This reverts commit bb1b0bc4e57428ce364d3d6c075ff03cb8973462.
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index b2d511c7c9a..d5690a04f53 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1676,8 +1676,9 @@ DIExpression *llvm::salvageDebugInfoImpl(Instruction &I,
};
// initializer-list helper for applying operators to the source DIExpression.
- auto applyOps = [&](ArrayRef<uint64_t> Opcodes) -> DIExpression * {
- SmallVector<uint64_t, 8> Ops(Opcodes.begin(), Opcodes.end());
+ auto applyOps =
+ [&](std::initializer_list<uint64_t> Opcodes) -> DIExpression * {
+ SmallVector<uint64_t, 8> Ops(Opcodes);
return doSalvage(Ops);
};
@@ -1685,21 +1686,8 @@ DIExpression *llvm::salvageDebugInfoImpl(Instruction &I,
// No-op casts and zexts are irrelevant for debug info.
if (CI->isNoopCast(DL) || isa<ZExtInst>(&I))
return SrcDIExpr;
-
- Type *Type = CI->getType();
- // Casts other than Trunc or SExt to scalar types cannot be salvaged.
- if (Type->isVectorTy() || (!isa<TruncInst>(&I) && !isa<SExtInst>(&I)))
- return nullptr;
-
- Value *FromValue = CI->getOperand(0);
- unsigned FromTypeBitSize = FromValue->getType()->getScalarSizeInBits();
- unsigned ToTypeBitSize = Type->getScalarSizeInBits();
-
- return applyOps(DIExpression::getExtOps(FromTypeBitSize, ToTypeBitSize,
- isa<SExtInst>(&I)));
- }
-
- if (auto *GEP = dyn_cast<GetElementPtrInst>(&I)) {
+ return nullptr;
+ } else if (auto *GEP = dyn_cast<GetElementPtrInst>(&I)) {
unsigned BitWidth =
M.getDataLayout().getIndexSizeInBits(GEP->getPointerAddressSpace());
// Rewrite a constant GEP into a DIExpression.
OpenPOWER on IntegriCloud