OSDN Git Service

Fix to make the CBE always emit comparisons inline. Hopefully this will
authorChris Lattner <sabre@nondot.org>
Thu, 20 May 2004 20:25:50 +0000 (20:25 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 20 May 2004 20:25:50 +0000 (20:25 +0000)
fix the really bad code we're getting on PPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13609 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CBackend/CBackend.cpp
lib/Target/CBackend/Writer.cpp

index ae3ba80..6e536f0 100644 (file)
@@ -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() ||
index ae3ba80..6e536f0 100644 (file)
@@ -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() ||