aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Analysis/IPA/Andersens.cpp8
-rw-r--r--test/Analysis/Andersens/2007-11-19-InlineAsm.ll8
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp
index 08b9dc3de2..da4fa82f06 100644
--- a/lib/Analysis/IPA/Andersens.cpp
+++ b/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/test/Analysis/Andersens/2007-11-19-InlineAsm.ll b/test/Analysis/Andersens/2007-11-19-InlineAsm.ll
new file mode 100644
index 0000000000..c1ab6c7b1a
--- /dev/null
+++ b/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
+}
+