Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/Analysis/CostModel/X86/intrinsic-cost-kinds.ll
Show All 37 Lines | |||||
define void @umul(i32 %a, i32 %b, <16 x i32> %va, <16 x i32> %vb) { | define void @umul(i32 %a, i32 %b, <16 x i32> %va, <16 x i32> %vb) { | ||||
; THRU-LABEL: 'umul' | ; THRU-LABEL: 'umul' | ||||
; THRU-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %a, i32 %b) | ; THRU-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %a, i32 %b) | ||||
; THRU-NEXT: Cost Model: Found an estimated cost of 120 for instruction: %v = call { <16 x i32>, <16 x i1> } @llvm.umul.with.overflow.v16i32(<16 x i32> %va, <16 x i32> %vb) | ; THRU-NEXT: Cost Model: Found an estimated cost of 120 for instruction: %v = call { <16 x i32>, <16 x i1> } @llvm.umul.with.overflow.v16i32(<16 x i32> %va, <16 x i32> %vb) | ||||
; THRU-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void | ; THRU-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void | ||||
; | ; | ||||
; LATE-LABEL: 'umul' | ; LATE-LABEL: 'umul' | ||||
; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %a, i32 %b) | ; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %a, i32 %b) | ||||
; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v = call { <16 x i32>, <16 x i1> } @llvm.umul.with.overflow.v16i32(<16 x i32> %va, <16 x i32> %vb) | ; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v = call { <16 x i32>, <16 x i1> } @llvm.umul.with.overflow.v16i32(<16 x i32> %va, <16 x i32> %vb) | ||||
; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ||||
pengfei: Why no diffs in latency? | |||||
Latency is currently using a different path before we ever reach functions like getIntrinsicInstrCost(), so it is unaffected. We need to see how latency is used in its callers to decide if it should be changed too. spatel: Latency is currently using a different path before we ever reach functions like… | |||||
; | ; | ||||
; SIZE-LABEL: 'umul' | ; SIZE-LABEL: 'umul' | ||||
; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %a, i32 %b) | ; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %a, i32 %b) | ||||
; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v = call { <16 x i32>, <16 x i1> } @llvm.umul.with.overflow.v16i32(<16 x i32> %va, <16 x i32> %vb) | ; SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %v = call { <16 x i32>, <16 x i1> } @llvm.umul.with.overflow.v16i32(<16 x i32> %va, <16 x i32> %vb) | ||||
; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ||||
; | ; | ||||
; SIZE_LATE-LABEL: 'umul' | ; SIZE_LATE-LABEL: 'umul' | ||||
; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %a, i32 %b) | ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %a, i32 %b) | ||||
; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v = call { <16 x i32>, <16 x i1> } @llvm.umul.with.overflow.v16i32(<16 x i32> %va, <16 x i32> %vb) | ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %v = call { <16 x i32>, <16 x i1> } @llvm.umul.with.overflow.v16i32(<16 x i32> %va, <16 x i32> %vb) | ||||
; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ||||
; | ; | ||||
%s = call {i32, i1} @llvm.umul.with.overflow.i32(i32 %a, i32 %b) | %s = call {i32, i1} @llvm.umul.with.overflow.i32(i32 %a, i32 %b) | ||||
%v = call {<16 x i32>, <16 x i1>} @llvm.umul.with.overflow.v16i32(<16 x i32> %va, <16 x i32> %vb) | %v = call {<16 x i32>, <16 x i1>} @llvm.umul.with.overflow.v16i32(<16 x i32> %va, <16 x i32> %vb) | ||||
ret void | ret void | ||||
} | } | ||||
define void @smax(i32 %a, i32 %b, <16 x i32> %va, <16 x i32> %vb) { | define void @smax(i32 %a, i32 %b, <16 x i32> %va, <16 x i32> %vb) { | ||||
; THRU-LABEL: 'smax' | ; THRU-LABEL: 'smax' | ||||
; THRU-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s = call i32 @llvm.smax.i32(i32 %a, i32 %b) | ; THRU-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s = call i32 @llvm.smax.i32(i32 %a, i32 %b) | ||||
; THRU-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb) | ; THRU-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb) | ||||
; THRU-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void | ; THRU-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void | ||||
; | ; | ||||
; LATE-LABEL: 'smax' | ; LATE-LABEL: 'smax' | ||||
; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s = call i32 @llvm.smax.i32(i32 %a, i32 %b) | ; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s = call i32 @llvm.smax.i32(i32 %a, i32 %b) | ||||
; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb) | ; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb) | ||||
; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ||||
; | ; | ||||
; SIZE-LABEL: 'smax' | ; SIZE-LABEL: 'smax' | ||||
; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s = call i32 @llvm.smax.i32(i32 %a, i32 %b) | ; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s = call i32 @llvm.smax.i32(i32 %a, i32 %b) | ||||
; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb) | ; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb) | ||||
; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ||||
; | ; | ||||
; SIZE_LATE-LABEL: 'smax' | ; SIZE_LATE-LABEL: 'smax' | ||||
; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s = call i32 @llvm.smax.i32(i32 %a, i32 %b) | ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s = call i32 @llvm.smax.i32(i32 %a, i32 %b) | ||||
; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb) | ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb) | ||||
; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ||||
; | ; | ||||
%s = call i32 @llvm.smax.i32(i32 %a, i32 %b) | %s = call i32 @llvm.smax.i32(i32 %a, i32 %b) | ||||
%v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb) | %v = call <16 x i32> @llvm.smax.v16i32(<16 x i32> %va, <16 x i32> %vb) | ||||
ret void | ret void | ||||
} | } | ||||
define void @fmuladd(float %a, float %b, float %c, <16 x float> %va, <16 x float> %vb, <16 x float> %vc) { | define void @fmuladd(float %a, float %b, float %c, <16 x float> %va, <16 x float> %vb, <16 x float> %vc) { | ||||
; THRU-LABEL: 'fmuladd' | ; THRU-LABEL: 'fmuladd' | ||||
; THRU-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %s = call float @llvm.fmuladd.f32(float %a, float %b, float %c) | ; THRU-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %s = call float @llvm.fmuladd.f32(float %a, float %b, float %c) | ||||
; THRU-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc) | ; THRU-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc) | ||||
; THRU-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void | ; THRU-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void | ||||
; | ; | ||||
; LATE-LABEL: 'fmuladd' | ; LATE-LABEL: 'fmuladd' | ||||
; LATE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %s = call float @llvm.fmuladd.f32(float %a, float %b, float %c) | ; LATE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %s = call float @llvm.fmuladd.f32(float %a, float %b, float %c) | ||||
; LATE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc) | ; LATE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc) | ||||
; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ||||
; | ; | ||||
; SIZE-LABEL: 'fmuladd' | ; SIZE-LABEL: 'fmuladd' | ||||
; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s = call float @llvm.fmuladd.f32(float %a, float %b, float %c) | ; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s = call float @llvm.fmuladd.f32(float %a, float %b, float %c) | ||||
; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc) | ; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc) | ||||
; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ||||
; | ; | ||||
; SIZE_LATE-LABEL: 'fmuladd' | ; SIZE_LATE-LABEL: 'fmuladd' | ||||
; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %s = call float @llvm.fmuladd.f32(float %a, float %b, float %c) | ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %s = call float @llvm.fmuladd.f32(float %a, float %b, float %c) | ||||
; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc) | ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc) | ||||
; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret void | ||||
; | ; | ||||
%s = call float @llvm.fmuladd.f32(float %a, float %b, float %c) | %s = call float @llvm.fmuladd.f32(float %a, float %b, float %c) | ||||
%v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc) | %v = call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x float> %vc) | ||||
ret void | ret void | ||||
} | } | ||||
define void @cttz(i32 %a, <16 x i32> %va) { | define void @cttz(i32 %a, <16 x i32> %va) { | ||||
▲ Show 20 Lines • Show All 202 Lines • Show Last 20 Lines |
Why no diffs in latency?