From: Dan Gohman Date: Mon, 29 Sep 2008 21:13:15 +0000 (+0000) Subject: Fix an over-pessimization about GlobalVariable addresses in X86FastISel. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7962e856d1460cc61ce246e31ca77e99f85228a3;p=oota-llvm.git Fix an over-pessimization about GlobalVariable addresses in X86FastISel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56802 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp index d266451075d..3bce3b0c9c7 100644 --- a/lib/Target/X86/X86FastISel.cpp +++ b/lib/Target/X86/X86FastISel.cpp @@ -462,7 +462,7 @@ bool X86FastISel::X86SelectAddress(Value *V, X86AddressMode &AM, bool isCall) { } // If all else fails, try to materialize the value in a register. - if (!AM.GV && getTargetMachine()->symbolicAddressesAreRIPRel()) { + if (!AM.GV || !getTargetMachine()->symbolicAddressesAreRIPRel()) { if (AM.Base.Reg == 0) { AM.Base.Reg = getRegForValue(V); return AM.Base.Reg != 0;