LLVM 20.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 unsigned ScalarOpdIdx) {
20 switch (ID) {
21 case Intrinsic::dx_wave_readlane:
22 return ScalarOpdIdx == 1;
23 default:
24 return false;
25 }
26}
27
29 int OpdIdx) {
30 switch (ID) {
31 case Intrinsic::dx_asdouble:
32 return OpdIdx == 0;
33 default:
34 return OpdIdx == -1;
35 }
36}
37
39 Intrinsic::ID ID) const {
40 switch (ID) {
41 case Intrinsic::dx_frac:
42 case Intrinsic::dx_rsqrt:
43 case Intrinsic::dx_wave_readlane:
44 case Intrinsic::dx_asdouble:
45 case Intrinsic::dx_splitdouble:
46 case Intrinsic::dx_firstbituhigh:
47 case Intrinsic::dx_firstbitshigh:
48 return true;
49 default:
50 return false;
51 }
52}
bool isTargetIntrinsicWithScalarOpAtArg(Intrinsic::ID ID, unsigned ScalarOpdIdx)
bool isTargetIntrinsicTriviallyScalarizable(Intrinsic::ID ID) const
bool isTargetIntrinsicWithOverloadTypeAtArg(Intrinsic::ID ID, int OpdIdx)
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18