From 098786e9f79cb5fde96e842f9ef40555f55683cf Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 19 Sep 2008 23:42:04 +0000 Subject: Fix a FastISel GlobalVariable CSE bug. llvm-svn: 56376 --- llvm/lib/Target/X86/X86FastISel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp index 040eb0d4f77..309a3f3f798 100644 --- a/llvm/lib/Target/X86/X86FastISel.cpp +++ b/llvm/lib/Target/X86/X86FastISel.cpp @@ -379,8 +379,10 @@ bool X86FastISel::X86SelectAddress(Value *V, X86AddressMode &AM, bool isCall) { if (Subtarget->GVRequiresExtraLoad(GV, TM, isCall)) { // Check to see if we've already materialized this // value in a register in this block. - if (unsigned Reg = LocalValueMap[V]) - return Reg; + if (unsigned Reg = LocalValueMap[V]) { + AM.Base.Reg = Reg; + return true; + } // Issue load from stub if necessary. unsigned Opc = 0; const TargetRegisterClass *RC = NULL; -- cgit v1.2.3