1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/Transforms/Inline/lifetime-no-datalayout.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

24 lines
438 B
LLVM

; RUN: opt -inline -S < %s | FileCheck %s
declare void @use(i8* %a)
define void @helper() {
%a = alloca i8
call void @use(i8* %a)
ret void
}
; Size in llvm.lifetime.X should be 1 (default for i8).
define void @test() {
; CHECK-LABEL: @test(
; CHECK-NOT: lifetime
; CHECK: llvm.lifetime.start(i64 1
; CHECK-NOT: lifetime
; CHECK: llvm.lifetime.end(i64 1
call void @helper()
; CHECK-NOT: lifetime
; CHECK: ret void
ret void
}