Create nodes for inline asm so that we don't crash looking for the node later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44267 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky 2007-11-22 03:07:37 +00:00
parent 8b0ec64400
commit 4ac0e8da4a
2 changed files with 16 additions and 0 deletions

View File

@ -668,6 +668,14 @@ void Andersens::IdentifyObjects(Module &M) {
if (AllocationInst *AI = dyn_cast<AllocationInst>(&*II))
ObjectNodes[AI] = NumObjects++;
}
// Calls to inline asm need to be added as well because the callee isn't
// referenced anywhere else.
if (CallInst *CI = dyn_cast<CallInst>(&*II)) {
Value *Callee = CI->getCalledValue();
if (isa<InlineAsm>(Callee))
ValueNodes[Callee] = NumObjects++;
}
}
}

View File

@ -0,0 +1,8 @@
; RUN: llvm-as < %s | opt -anders-aa -disable-output
define void @x(i16 %Y) {
entry:
%tmp = call i16 asm "bswap $0", "=r,r"(i16 %Y)
ret void
}