From 433e25a9201a4102adc44b7525382886ddc56417 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 20 May 2004 20:25:50 +0000 Subject: [PATCH] Fix to make the CBE always emit comparisons inline. Hopefully this will 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 | 4 ++++ lib/Target/CBackend/Writer.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index ae3ba809408..6e536f07298 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(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 ae3ba809408..6e536f07298 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(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() || -- 2.34.1