mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
c94da20917
Summary: DataLayout keeps the string used for its creation. As a side effect it is no longer needed in the Module. This is "almost" NFC, the string is no longer canonicalized, you can't rely on two "equals" DataLayout having the same string returned by getStringRepresentation(). Get rid of DataLayoutPass: the DataLayout is in the Module The DataLayout is "per-module", let's enforce this by not duplicating it more than necessary. One more step toward non-optionality of the DataLayout in the module. Make DataLayout Non-Optional in the Module Module->getDataLayout() will never returns nullptr anymore. Reviewers: echristo Subscribers: resistor, llvm-commits, jholewinski Differential Revision: http://reviews.llvm.org/D7992 From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231270 91177308-0d34-0410-b5e6-96231b3b80d8
37 lines
1.3 KiB
LLVM
37 lines
1.3 KiB
LLVM
; RUN: opt < %s -scalarrepl -S | not grep shr
|
|
|
|
; FIXME: I think this test is no longer valid.
|
|
; It was working because SROA was aborting when
|
|
; no datalayout was supplied
|
|
; XFAIL: *
|
|
|
|
|
|
%struct.S = type { i16 }
|
|
|
|
define zeroext i1 @f(i16 signext %b) {
|
|
entry:
|
|
%b_addr = alloca i16 ; <i16*> [#uses=2]
|
|
%retval = alloca i32 ; <i32*> [#uses=2]
|
|
%s = alloca %struct.S ; <%struct.S*> [#uses=2]
|
|
%tmp = alloca i32 ; <i32*> [#uses=2]
|
|
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
|
|
store i16 %b, i16* %b_addr
|
|
%tmp1 = getelementptr %struct.S, %struct.S* %s, i32 0, i32 0 ; <i16*> [#uses=1]
|
|
%tmp2 = load i16, i16* %b_addr, align 2 ; <i16> [#uses=1]
|
|
store i16 %tmp2, i16* %tmp1, align 2
|
|
%tmp3 = getelementptr %struct.S, %struct.S* %s, i32 0, i32 0 ; <i16*> [#uses=1]
|
|
%tmp34 = bitcast i16* %tmp3 to [2 x i1]* ; <[2 x i1]*> [#uses=1]
|
|
%tmp5 = getelementptr [2 x i1], [2 x i1]* %tmp34, i32 0, i32 1 ; <i1*> [#uses=1]
|
|
%tmp6 = load i1, i1* %tmp5, align 1 ; <i1> [#uses=1]
|
|
%tmp67 = zext i1 %tmp6 to i32 ; <i32> [#uses=1]
|
|
store i32 %tmp67, i32* %tmp, align 4
|
|
%tmp8 = load i32, i32* %tmp, align 4 ; <i32> [#uses=1]
|
|
store i32 %tmp8, i32* %retval, align 4
|
|
br label %return
|
|
|
|
return: ; preds = %entry
|
|
%retval9 = load i32, i32* %retval ; <i32> [#uses=1]
|
|
%retval910 = trunc i32 %retval9 to i1 ; <i1> [#uses=1]
|
|
ret i1 %retval910
|
|
}
|