brintos

brintos / llvm-project-archived public Read only

0
0
Text · 860 B · 608f739 Raw
21 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 42; RUN: opt -S -passes=newgvn < %s | FileCheck %s3; Check that loads from calloc are recognized as being zero.4 5target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"6 7; Function Attrs: nounwind uwtable8define i32 @test1() {9; CHECK-LABEL: define i32 @test1() {10; CHECK-NEXT:    [[TMP1:%.*]] = tail call noalias ptr @calloc(i64 1, i64 4)11; CHECK-NEXT:    ret i32 012;13  %1 = tail call noalias ptr @calloc(i64 1, i64 4)14  ; This load is trivially constant zero15  %2 = load i32, ptr %1, align 416  ret i32 %217 18}19 20declare noalias ptr @calloc(i64, i64) mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc"21