1 ; RUN: opt < %s -S -basicaa -licm | FileCheck %s
3 ; Check that the LICM pass does not operate on a loop which has the
4 ; llvm.licm.disable metadata.
5 ; CHECK-LABEL: @licm_disable
9 ; CHECK: load i64, i64* bitcast (i32** @in to i64*)
11 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
12 target triple = "x86_64-pc-windows-msvc"
14 @in = internal unnamed_addr global i32* null, align 8
15 @out = internal unnamed_addr global i32* null, align 8
17 define void @licm_disable(i32 %N) {
21 do.body: ; preds = %entry
22 %i.0 = phi i32 [ 0, %entry ], [ %inc, %do.body ]
23 %v1 = load i64, i64* bitcast (i32** @in to i64*), align 8
24 store i64 %v1, i64* bitcast (i32** @out to i64*), align 8
25 %inc = add nsw i32 %i.0, 1
26 %cmp = icmp slt i32 %inc, %N
27 br i1 %cmp, label %do.body, label %do.end, !llvm.loop !1
29 do.end: ; preds = %do.body
33 !2 = !{!"llvm.licm.disable"}