================ @@ -0,0 +1,107 @@ +; RUN: opt -S -dxil-intrinsic-expansion < %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK +; RUN: opt -S -dxil-op-lower < %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK + +; ModuleID = 'D:\llvm-project\clang\test\CodeGenHLSL\builtins\length.hlsl' +source_filename = "D:\\llvm-project\\clang\\test\\CodeGenHLSL\\builtins\\length.hlsl" +target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64" +target triple = "dxilv1.3-pc-shadermodel6.3-library" + +; Function Attrs: convergent noinline nounwind optnone +define noundef float @"?test_length_half@@YA$halff@$halff@@Z"(float noundef %p0) #0 { +entry: + %p0.addr = alloca float, align 4 + store float %p0, ptr %p0.addr, align 4 + %0 = load float, ptr %p0.addr, align 4 + + ; EXPCHECK: call float @llvm.fabs.f32(float %{{.*}}) + ; DOPCHECK: call float @dx.op.unary.f32(i32 6, float %{{.*}}) + %1 = call float @llvm.fabs.f32(float %0) #3 + ret float %1 +} + +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare float @llvm.fabs.f32(float) #1 ---------------- farzonl wrote:
we typically organize all the declares at the end or at the top of a test case to knw what intrinsics are being invoked in the test. https://github.com/llvm/llvm-project/pull/101256 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits