Files
clang-p2996/llvm/test/CodeGen/DirectX/floor.ll
Justin Bogner 81ee38551f [DirectX] Register a few DXIL passes with the new PM
This wires up dxil-op-lower, dxil-intrinsic-expansion, dxil-translate-metadata,
and dxil-pretty-printer to the new pass manager, both as a matter of future
proofing the backend and so that they can be used more flexibly in tests.

A few arbitrary tests are updated in order to test the new PM path, and we drop
the "print-dxil-resource-md" pass since it's redundant with the pretty printer.

Pull Request: https://github.com/llvm/llvm-project/pull/104250
2024-08-20 16:33:25 -07:00

21 lines
648 B
LLVM

; RUN: opt -S -passes=dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
; Make sure dxil operation function calls for floor are generated for float and half.
define noundef float @floor_float(float noundef %a) #0 {
entry:
; CHECK:call float @dx.op.unary.f32(i32 27, float %{{.*}})
%elt.floor = call float @llvm.floor.f32(float %a)
ret float %elt.floor
}
define noundef half @floor_half(half noundef %a) #0 {
entry:
; CHECK:call half @dx.op.unary.f16(i32 27, half %{{.*}})
%elt.floor = call half @llvm.floor.f16(half %a)
ret half %elt.floor
}
declare half @llvm.floor.f16(half)
declare float @llvm.floor.f32(float)