summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/IntrinsicInst.cpp7
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp38
2 files changed, 0 insertions, 45 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp
index 9ffcae1f8f8..67bd5b69bb0 100644
--- a/llvm/lib/IR/IntrinsicInst.cpp
+++ b/llvm/lib/IR/IntrinsicInst.cpp
@@ -24,7 +24,6 @@
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/IR/Constants.h"
-#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
@@ -49,12 +48,6 @@ Value *DbgInfoIntrinsic::getVariableLocation(bool AllowNullOp) const {
return nullptr;
}
-Optional<uint64_t> DbgInfoIntrinsic::getFragmentSizeInBits() const {
- if (auto Fragment = getExpression()->getFragmentInfo())
- return Fragment->SizeInBits;
- return getVariable()->getSizeInBits();
-}
-
int llvm::Intrinsic::lookupLLVMIntrinsicByName(ArrayRef<const char *> NameTable,
StringRef Name) {
assert(Name.startswith("llvm."));
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 5a3a89bed2b..406b52607f0 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1228,23 +1228,6 @@ static bool PhiHasDebugValue(DILocalVariable *DIVar,
return false;
}
-/// Check if the store size of \p ValTy is large enough to cover the variable
-/// (or fragment of the variable) described by \p DII.
-///
-/// This is primarily intended as a helper for the different
-/// ConvertDebugDeclareToDebugValue functions. The dbg.declare/dbg.addr that is
-/// converted describes an alloca'd variable, so we need to use the
-/// store size of the value when doing the comparison. E.g. an i1 value will be
-/// identified as covering an n-bit fragment, if the store size of i1 is at
-/// least n bits.
-static bool valueCoversEntireFragment(Type *ValTy, DbgInfoIntrinsic *DII) {
- const DataLayout &DL = DII->getModule()->getDataLayout();
- uint64_t ValueSize = DL.getTypeStoreSizeInBits(ValTy);
- if (auto FragmentSize = DII->getFragmentSizeInBits())
- return ValueSize >= *FragmentSize;
- return false;
-}
-
/// Inserts a llvm.dbg.value intrinsic before a store to an alloca'd value
/// that has an associated llvm.dbg.declare or llvm.dbg.addr intrinsic.
void llvm::ConvertDebugDeclareToDebugValue(DbgInfoIntrinsic *DII,
@@ -1255,21 +1238,6 @@ void llvm::ConvertDebugDeclareToDebugValue(DbgInfoIntrinsic *DII,
auto *DIExpr = DII->getExpression();
Value *DV = SI->getOperand(0);
- if (!valueCoversEntireFragment(SI->getValueOperand()->getType(), DII)) {
- // FIXME: If storing to a part of the variable described by the dbg.declare,
- // then we want to insert a dbg.value for the corresponding fragment.
- LLVM_DEBUG(dbgs() << "Failed to convert dbg.declare to dbg.value: "
- << *DII << '\n');
- // For now, when there is a store to parts of the variable (but we do not
- // know which part) we insert an dbg.value instrinsic to indicate that we
- // know nothing about the variable's content.
- DV = UndefValue::get(DV->getType());
- if (!LdStHasDebugValue(DIVar, DIExpr, SI))
- Builder.insertDbgValueIntrinsic(DV, DIVar, DIExpr, DII->getDebugLoc(),
- SI);
- return;
- }
-
// If an argument is zero extended then use argument directly. The ZExt
// may be zapped by an optimization pass in future.
Argument *ExtendedArg = nullptr;
@@ -1313,9 +1281,6 @@ void llvm::ConvertDebugDeclareToDebugValue(DbgInfoIntrinsic *DII,
if (LdStHasDebugValue(DIVar, DIExpr, LI))
return;
- assert(valueCoversEntireFragment(LI->getType(), DII) &&
- "Load is not loading the full variable fragment.");
-
// We are now tracking the loaded value instead of the address. In the
// future if multi-location support is added to the IR, it might be
// preferable to keep tracking both the loaded value and the original
@@ -1336,9 +1301,6 @@ void llvm::ConvertDebugDeclareToDebugValue(DbgInfoIntrinsic *DII,
if (PhiHasDebugValue(DIVar, DIExpr, APN))
return;
- assert(valueCoversEntireFragment(APN->getType(), DII) &&
- "PHI node is not describing the full variable.");
-
BasicBlock *BB = APN->getParent();
auto InsertionPt = BB->getFirstInsertionPt();
OpenPOWER on IntegriCloud