diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2007-11-22 03:07:37 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2007-11-22 03:07:37 +0000 |
commit | 016547d2267b03f95d855b8ef5496eff69d5272c (patch) | |
tree | f73ccc83d04be5e2f3ae140cba0ba45f9709137a | |
parent | 94ea8aab3405d0152fa85a22b7ec5432a33eeed9 (diff) | |
download | bcm5719-llvm-016547d2267b03f95d855b8ef5496eff69d5272c.tar.gz bcm5719-llvm-016547d2267b03f95d855b8ef5496eff69d5272c.zip |
Create nodes for inline asm so that we don't crash looking for the node later.
llvm-svn: 44267
-rw-r--r-- | llvm/lib/Analysis/IPA/Andersens.cpp | 8 | ||||
-rw-r--r-- | llvm/test/Analysis/Andersens/2007-11-19-InlineAsm.ll | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/IPA/Andersens.cpp b/llvm/lib/Analysis/IPA/Andersens.cpp index 08b9dc3de22..da4fa82f06a 100644 --- a/llvm/lib/Analysis/IPA/Andersens.cpp +++ b/llvm/lib/Analysis/IPA/Andersens.cpp @@ -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++; + } } } diff --git a/llvm/test/Analysis/Andersens/2007-11-19-InlineAsm.ll b/llvm/test/Analysis/Andersens/2007-11-19-InlineAsm.ll new file mode 100644 index 00000000000..c1ab6c7b1a4 --- /dev/null +++ b/llvm/test/Analysis/Andersens/2007-11-19-InlineAsm.ll @@ -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 +} + |