2009-11-11 16:34:13 +01:00
|
|
|
; Test to make sure unused llvm.invariant.start calls are not trivially eliminated
|
|
|
|
; RUN: opt < %s -instcombine -S | FileCheck %s
|
|
|
|
|
|
|
|
declare void @g(i8*)
|
|
|
|
|
2010-04-08 20:03:05 +02:00
|
|
|
declare {}* @llvm.invariant.start(i64, i8* nocapture) nounwind readonly
|
2009-11-11 16:34:13 +01:00
|
|
|
|
|
|
|
define i8 @f() {
|
|
|
|
%a = alloca i8 ; <i8*> [#uses=4]
|
|
|
|
store i8 0, i8* %a
|
2010-04-08 20:03:05 +02:00
|
|
|
%i = call {}* @llvm.invariant.start(i64 1, i8* %a) ; <{}*> [#uses=0]
|
|
|
|
; CHECK: call {}* @llvm.invariant.start
|
2009-11-11 16:34:13 +01:00
|
|
|
call void @g(i8* %a)
|
|
|
|
%r = load i8* %a ; <i8> [#uses=1]
|
|
|
|
ret i8 %r
|
|
|
|
}
|