1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/Transforms/IndVarSimplify/signed-trip-count.ll
Mehdi Amini 29ebc2d39f Make DataLayout Non-Optional in the Module
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>
llvm-svn: 231270
2015-03-04 18:43:29 +00:00

35 lines
908 B
LLVM

; RUN: opt < %s -indvars -S > %t
; RUN: not grep sext %t
; RUN: grep phi %t | count 1
; Provide legal integer types.
target datalayout = "n8:16:32:64"
define void @foo(i64* nocapture %x, i32 %n) nounwind {
entry:
%tmp102 = icmp sgt i32 %n, 0 ; <i1> [#uses=1]
br i1 %tmp102, label %bb.nph, label %return
bb.nph: ; preds = %entry
br label %bb
bb: ; preds = %bb7, %bb.nph
%i.01 = phi i32 [ %tmp6, %bb7 ], [ 0, %bb.nph ] ; <i32> [#uses=3]
%tmp1 = sext i32 %i.01 to i64 ; <i64> [#uses=1]
%tmp4 = getelementptr i64, i64* %x, i32 %i.01 ; <i64*> [#uses=1]
store i64 %tmp1, i64* %tmp4, align 8
%tmp6 = add i32 %i.01, 1 ; <i32> [#uses=2]
br label %bb7
bb7: ; preds = %bb
%tmp10 = icmp slt i32 %tmp6, %n ; <i1> [#uses=1]
br i1 %tmp10, label %bb, label %bb7.return_crit_edge
bb7.return_crit_edge: ; preds = %bb7
br label %return
return: ; preds = %bb7.return_crit_edge, %entry
ret void
}