Detect undef value early and save unnecessary NodeMap query.

llvm-svn: 112864
This commit is contained in:
Devang Patel 2010-09-02 21:29:42 +00:00
parent 7d1d7537cf
commit 3bffd52d78
1 changed files with 11 additions and 0 deletions

View File

@ -4074,6 +4074,17 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
// absolute, but not relative, values are different depending on whether
// debug info exists.
++SDNodeOrder;
// Check if address has undef value.
if (isa<UndefValue>(Address) ||
(Address->use_empty() && !isa<Argument>(Address))) {
SDDbgValue*SDV =
DAG.getDbgValue(Variable, UndefValue::get(Address->getType()),
0, dl, SDNodeOrder);
DAG.AddDbgValue(SDV, 0, false);
return 0;
}
SDValue &N = NodeMap[Address];
if (!N.getNode() && isa<Argument>(Address))
// Check unused arguments map.