Fix to make the CBE always emit comparisons inline. Hopefully this will
fix the really bad code we're getting on PPC.
llvm-svn: 13609
diff --git a/llvm/lib/Target/CBackend/Writer.cpp b/llvm/lib/Target/CBackend/Writer.cpp
index ae3ba80..6e536f0 100644
--- a/llvm/lib/Target/CBackend/Writer.cpp
+++ b/llvm/lib/Target/CBackend/Writer.cpp
@@ -126,6 +126,10 @@
// 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() ||