Skip to content

Commit 67464df

Browse files
author
Joe Ellis
committed
[DebugInfo] Only perform TypeSize -> unsigned cast when necessary
This commit moves a line in SelectionDAGBuilder::handleDebugValue to avoid implicitly casting a TypeSize object to an unsigned earlier than necessary. It was possible that we bail out of the loop before the value is ever used, which means we could create a superfluous TypeSize warning. Reviewed By: DavidTruby Differential Revision: https://reviews.llvm.org/D96423
1 parent 0881a4f commit 67464df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,10 +1321,11 @@ bool SelectionDAGBuilder::handleDebugValue(const Value *V, DILocalVariable *Var,
13211321
if (auto Fragment = Expr->getFragmentInfo())
13221322
BitsToDescribe = Fragment->SizeInBits;
13231323
for (auto RegAndSize : RFV.getRegsAndSizes()) {
1324-
unsigned RegisterSize = RegAndSize.second;
13251324
// Bail out if all bits are described already.
13261325
if (Offset >= BitsToDescribe)
13271326
break;
1327+
// TODO: handle scalable vectors.
1328+
unsigned RegisterSize = RegAndSize.second;
13281329
unsigned FragmentSize = (Offset + RegisterSize > BitsToDescribe)
13291330
? BitsToDescribe - Offset
13301331
: RegisterSize;

0 commit comments

Comments
 (0)