aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/CBackend/CBackend.cpp4
-rw-r--r--lib/Target/CBackend/Writer.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index ae3ba80940..6e536f0729 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -126,6 +126,10 @@ namespace {
// printed and an extra copy of the expr is not emitted.
//
static bool isInlinableInst(const Instruction &I) {
+ // Always inline setcc instructions, even if they are shared by multiple
+ // expressions. GCC generates horrible code if we don't.
+ if (isa<SetCondInst>(I)) return true;
+
// Must be an expression, must be used exactly once. If it is dead, we
// emit it inline where it would go.
if (I.getType() == Type::VoidTy || !I.hasOneUse() ||
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp
index ae3ba80940..6e536f0729 100644
--- a/lib/Target/CBackend/Writer.cpp
+++ b/lib/Target/CBackend/Writer.cpp
@@ -126,6 +126,10 @@ namespace {
// printed and an extra copy of the expr is not emitted.
//
static bool isInlinableInst(const Instruction &I) {
+ // Always inline setcc instructions, even if they are shared by multiple
+ // expressions. GCC generates horrible code if we don't.
+ if (isa<SetCondInst>(I)) return true;
+
// Must be an expression, must be used exactly once. If it is dead, we
// emit it inline where it would go.
if (I.getType() == Type::VoidTy || !I.hasOneUse() ||