xref: /llvm-project/llvm/test/Transforms/CodeGenPrepare/dead-allocation.ll (revision f1ec0d12bb0843f0deab83ef2b5cf1339cbc4f0b)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; Eliminate the dead allocation instruction
3; REQUIRES: arm-registered-target
4; RUN: opt -passes='require<profile-summary>,function(codegenprepare)' < %s -S | FileCheck %s
5
6target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
7target triple = "armv7--linux-gnueabihf"
8
9@.str = private unnamed_addr constant [2 x i8] c"a\00", align 1
10
11define void @func() {
12; CHECK-LABEL: @func(
13; CHECK-NEXT:  entry:
14; CHECK-NEXT:    ret void
15;
16entry:
17  %0 = tail call noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i64 noundef 32)
18  %1 = icmp ugt ptr %0, @.str
19  tail call void @llvm.assume(i1 %1)
20  ret void
21}
22
23declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr
24declare void @llvm.assume(i1 noundef)
25