diff options
| -rw-r--r-- | llvm/test/Transforms/SCCP/ipsccp-basic.ll | 1 | ||||
| -rw-r--r-- | llvm/tools/opt/Debugify.cpp | 11 |
2 files changed, 8 insertions, 4 deletions
diff --git a/llvm/test/Transforms/SCCP/ipsccp-basic.ll b/llvm/test/Transforms/SCCP/ipsccp-basic.ll index 4db5c4478d3..b7db8689115 100644 --- a/llvm/test/Transforms/SCCP/ipsccp-basic.ll +++ b/llvm/test/Transforms/SCCP/ipsccp-basic.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -ipsccp -S | FileCheck %s +; RUN: opt < %s -enable-debugify -ipsccp -debugify-quiet -disable-output ;;======================== test1 diff --git a/llvm/tools/opt/Debugify.cpp b/llvm/tools/opt/Debugify.cpp index 54ff00849b0..e8437016d94 100644 --- a/llvm/tools/opt/Debugify.cpp +++ b/llvm/tools/opt/Debugify.cpp @@ -184,12 +184,15 @@ bool diagnoseMisSizedDbgValue(Module &M, DbgValueInst *DVI) { Type *Ty = V->getType(); uint64_t ValueOperandSize = getAllocSizeInBits(M, Ty); - uint64_t DbgVarSize = *DVI->getFragmentSizeInBits(); - bool HasBadSize = Ty->isIntegerTy() ? (ValueOperandSize < DbgVarSize) - : (ValueOperandSize != DbgVarSize); + Optional<uint64_t> DbgVarSize = DVI->getFragmentSizeInBits(); + if (!ValueOperandSize || !DbgVarSize) + return false; + + bool HasBadSize = Ty->isIntegerTy() ? (ValueOperandSize < *DbgVarSize) + : (ValueOperandSize != *DbgVarSize); if (HasBadSize) { dbg() << "ERROR: dbg.value operand has size " << ValueOperandSize - << ", but its variable has size " << DbgVarSize << ": "; + << ", but its variable has size " << *DbgVarSize << ": "; DVI->print(dbg()); dbg() << "\n"; } |

