Home | History | Annotate | Download | only in InstCombine
      1 ; Test to make sure unused llvm.invariant.start calls are not trivially eliminated
      2 ; RUN: opt < %s -instcombine -S | FileCheck %s
      3 
      4 declare void @g(i8*)
      5 
      6 declare {}* @llvm.invariant.start(i64, i8* nocapture) nounwind readonly
      7 
      8 define i8 @f() {
      9   %a = alloca i8                                  ; <i8*> [#uses=4]
     10   store i8 0, i8* %a
     11   %i = call {}* @llvm.invariant.start(i64 1, i8* %a) ; <{}*> [#uses=0]
     12   ; CHECK: call {}* @llvm.invariant.start
     13   call void @g(i8* %a)
     14   %r = load i8, i8* %a                                ; <i8> [#uses=1]
     15   ret i8 %r
     16 }
     17