summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2014-07-16 22:20:51 +0000
committerJuergen Ributzka <juergen@apple.com>2014-07-16 22:20:51 +0000
commit618ce3e85ed1c68e89dc696b7c9ab94a6a910797 (patch)
tree58f42ec500e16de329bfa7518eb4a822a247a6f7 /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
parent8b205306892ea701978a2b789f6eafe4277648a7 (diff)
downloadbcm5719-llvm-618ce3e85ed1c68e89dc696b7c9ab94a6a910797.tar.gz
bcm5719-llvm-618ce3e85ed1c68e89dc696b7c9ab94a6a910797.zip
[FastISel] Local values shouldn't be alive across an inline asm call with side effects.
This fixes an issue where a local value is defined before and used after an inline asm call with side effects. This fix simply flushes the local value map, which updates the insertion point for the inline asm call to be above any previously defined local values. This fixes <rdar://problem/17694203> llvm-svn: 213203
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index f071efa7b55..ad75e916cef 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -1038,6 +1038,11 @@ bool FastISel::SelectCall(const User *I) {
// Handle simple inline asms.
if (const InlineAsm *IA = dyn_cast<InlineAsm>(Call->getCalledValue())) {
+ // If the inline asm has side effects, then make sure that no local value
+ // lives across by flushing the local value map.
+ if (IA->hasSideEffects())
+ flushLocalValueMap();
+
// Don't attempt to handle constraints.
if (!IA->getConstraintString().empty())
return false;
OpenPOWER on IntegriCloud