mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Load from GV stub should be locally CSE'd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55763 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
90960280ee
commit
373d50af1d
@ -71,6 +71,8 @@ bool X86FastISel::X86SelectConstAddr(Value *V,
|
||||
X86AddressMode AM;
|
||||
AM.GV = GV;
|
||||
addFullAddress(BuildMI(MBB, TII.get(Opc), Op0), AM);
|
||||
// Prevent loading GV stub multiple times in same MBB.
|
||||
LocalValueMap[V] = Op0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
12
test/CodeGen/X86/fast-isel-mem.ll
Normal file
12
test/CodeGen/X86/fast-isel-mem.ll
Normal file
@ -0,0 +1,12 @@
|
||||
; RUN: llvm-as < %s | llc -fast-isel -mtriple=i386-apple-darwin -mattr=sse2 | \
|
||||
; RUN: grep mov | grep lazy_ptr | count 1
|
||||
|
||||
@src = external global i32
|
||||
|
||||
define i32 @loadgv() nounwind {
|
||||
entry:
|
||||
%0 = load i32* @src, align 4
|
||||
%1 = load i32* @src, align 4
|
||||
%2 = add i32 %0, %1
|
||||
ret i32 %2
|
||||
}
|
@ -47,11 +47,3 @@ entry:
|
||||
%tmp2 = bitcast i32 0 to i32
|
||||
ret i32 %tmp2
|
||||
}
|
||||
|
||||
@src = external global i32
|
||||
|
||||
define i32 @loadgv() nounwind {
|
||||
entry:
|
||||
%0 = load i32* @src, align 4
|
||||
ret i32 %0
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user