LLVM 23.0.0git
DirectXTargetTransformInfo.cpp
Go to the documentation of this file.
1//===- DirectXTargetTransformInfo.cpp - DirectX TTI ---------------*- C++
2//-*-===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9///
10//===----------------------------------------------------------------------===//
11
13#include "llvm/IR/Intrinsics.h"
14#include "llvm/IR/IntrinsicsDirectX.h"
15
16using namespace llvm;
17
19 Intrinsic::ID ID, unsigned ScalarOpdIdx) const {
20 switch (ID) {
21 case Intrinsic::dx_wave_readlane:
22 return ScalarOpdIdx == 1;
23 default:
24 return false;
25 }
26}
27
29 int OpdIdx) const {
30 switch (ID) {
31 case Intrinsic::dx_asdouble:
32 case Intrinsic::dx_firstbitlow:
33 case Intrinsic::dx_firstbitshigh:
34 case Intrinsic::dx_firstbituhigh:
35 case Intrinsic::dx_isinf:
36 case Intrinsic::dx_isnan:
37 case Intrinsic::dx_legacyf16tof32:
38 case Intrinsic::dx_legacyf32tof16:
39 case Intrinsic::dx_wave_all_equal:
40 return OpdIdx == 0;
41 default:
42 // All DX intrinsics are overloaded on return type unless specified
43 // otherwise
44 return OpdIdx == -1;
45 }
46}
bool isTargetIntrinsicWithScalarOpAtArg(Intrinsic::ID ID, unsigned ScalarOpdIdx) const override
bool isTargetIntrinsicWithOverloadTypeAtArg(Intrinsic::ID ID, int OpdIdx) const override
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24
This is an optimization pass for GlobalISel generic memory operations.