[llvm] r330052 - [CostModel][X86] Regenerate latency/codesize cost tests

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 13 11:56:58 PDT 2018


Author: rksimon
Date: Fri Apr 13 11:56:58 2018
New Revision: 330052

URL: http://llvm.org/viewvc/llvm-project?rev=330052&view=rev
Log:
[CostModel][X86] Regenerate latency/codesize cost tests

Modified:
    llvm/trunk/test/Analysis/CostModel/X86/costmodel.ll

Modified: llvm/trunk/test/Analysis/CostModel/X86/costmodel.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CostModel/X86/costmodel.ll?rev=330052&r1=330051&r2=330052&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/CostModel/X86/costmodel.ll (original)
+++ llvm/trunk/test/Analysis/CostModel/X86/costmodel.ll Fri Apr 13 11:56:58 2018
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
 ; RUN: opt < %s -cost-model -cost-kind=latency -analyze -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 | FileCheck %s --check-prefix=LATENCY
 ; RUN: opt < %s -cost-model -cost-kind=code-size -analyze -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 | FileCheck %s --check-prefix=CODESIZE
 
@@ -8,48 +9,41 @@ target datalayout = "e-p:64:64:64-i1:8:8
 declare { i32, i1 } @llvm.uadd.with.overflow.i32(i32, i32)
 
 define i64 @foo(i64 %arg) {
-
-  ; LATENCY:  cost of 0 {{.*}} alloca i32
-  ; CODESIZE: cost of 0 {{.*}} alloca i32
+; LATENCY-LABEL: 'foo'
+; LATENCY-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %A1 = alloca i32, align 8
+; LATENCY-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A2 = alloca i64, i64 undef, align 8
+; LATENCY-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %I64 = add i64 undef, undef
+; LATENCY-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %1 = load i64, i64* undef, align 4
+; LATENCY-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %BC = bitcast i8* undef to i32*
+; LATENCY-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %I2P = inttoptr i64 undef to i8*
+; LATENCY-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %P2I = ptrtoint i8* undef to i64
+; LATENCY-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %TC = trunc i64 undef to i32
+; LATENCY-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %uadd = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 undef, i32 undef)
+; LATENCY-NEXT:  Cost Model: Found an estimated cost of 40 for instruction: call void undef()
+; LATENCY-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 undef
+;
+; CODESIZE-LABEL: 'foo'
+; CODESIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %A1 = alloca i32, align 8
+; CODESIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %A2 = alloca i64, i64 undef, align 8
+; CODESIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %I64 = add i64 undef, undef
+; CODESIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load i64, i64* undef, align 4
+; CODESIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %BC = bitcast i8* undef to i32*
+; CODESIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %I2P = inttoptr i64 undef to i8*
+; CODESIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %P2I = ptrtoint i8* undef to i64
+; CODESIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %TC = trunc i64 undef to i32
+; CODESIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %uadd = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 undef, i32 undef)
+; CODESIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: call void undef()
+; CODESIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 undef
+;
   %A1 = alloca i32, align 8
-
-  ; LATENCY:  cost of 1 {{.*}} alloca i64, i64 undef
-  ; CODESIZE: cost of 1 {{.*}} alloca i64, i64 undef
   %A2 = alloca i64, i64 undef, align 8
-
-  ; LATENCY:  cost of 1 {{.*}} %I64 = add
-  ; CODESIZE: cost of 1 {{.*}} %I64 = add
   %I64 = add i64 undef, undef
-
-  ; LATENCY:  cost of 4 {{.*}} load
-  ; CODESIZE: cost of 1 {{.*}} load
   load i64, i64* undef, align 4
-
-  ; LATENCY:  cost of 0 {{.*}} bitcast
-  ; CODESIZE: cost of 0 {{.*}} bitcast
   %BC = bitcast i8* undef to i32*
-
-  ; LATENCY:  cost of 0 {{.*}} inttoptr
-  ; CODESIZE: cost of 0 {{.*}} inttoptr
   %I2P = inttoptr i64 undef to i8*
-
-  ; LATENCY:  cost of 0 {{.*}} ptrtoint
-  ; CODESIZE: cost of 0 {{.*}} ptrtoint
   %P2I = ptrtoint i8* undef to i64
-
-  ; LATENCY:  cost of 0 {{.*}} trunc
-  ; CODESIZE: cost of 0 {{.*}} trunc
   %TC = trunc i64 undef to i32
-
-  ; LATENCY:  cost of 1 {{.*}} call
-  ; CODESIZE: cost of 1 {{.*}} call
   %uadd = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 undef, i32 undef)
-
-  ; LATENCY:  cost of 40 {{.*}} call void undef
-  ; CODESIZE: cost of 1 {{.*}} call void undef
   call void undef()
-
-  ; LATENCY:  cost of 1 {{.*}} ret
-  ; CODESIZE: cost of 1 {{.*}} ret
   ret i64 undef
 }




More information about the llvm-commits mailing list