
- update `VectorUtils:isVectorIntrinsicWithScalarOpAtArg` to use TTI for all uses, to allow specifiction of target specific intrinsics - add TTI to the `isVectorIntrinsicWithStructReturnOverloadAtField` api - update TTI api to provide `isTargetIntrinsicWith...` functions and consistently name them - move `isTriviallyScalarizable` to VectorUtils - update all uses of the api and provide the TTI parameter Resolves #117030
45 lines
1.6 KiB
C++
45 lines
1.6 KiB
C++
//===- DirectXTargetTransformInfo.h - DirectX TTI ---------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
///
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_DIRECTX_DIRECTXTARGETTRANSFORMINFO_H
|
|
#define LLVM_DIRECTX_DIRECTXTARGETTRANSFORMINFO_H
|
|
|
|
#include "DirectXSubtarget.h"
|
|
#include "DirectXTargetMachine.h"
|
|
#include "llvm/CodeGen/BasicTTIImpl.h"
|
|
#include "llvm/IR/Function.h"
|
|
|
|
namespace llvm {
|
|
class DirectXTTIImpl : public BasicTTIImplBase<DirectXTTIImpl> {
|
|
using BaseT = BasicTTIImplBase<DirectXTTIImpl>;
|
|
using TTI = TargetTransformInfo;
|
|
|
|
friend BaseT;
|
|
|
|
const DirectXSubtarget *ST;
|
|
const DirectXTargetLowering *TLI;
|
|
|
|
const DirectXSubtarget *getST() const { return ST; }
|
|
const DirectXTargetLowering *getTLI() const { return TLI; }
|
|
|
|
public:
|
|
explicit DirectXTTIImpl(const DirectXTargetMachine *TM, const Function &F)
|
|
: BaseT(TM, F.getDataLayout()), ST(TM->getSubtargetImpl(F)),
|
|
TLI(ST->getTargetLowering()) {}
|
|
unsigned getMinVectorRegisterBitWidth() const { return 32; }
|
|
bool isTargetIntrinsicTriviallyScalarizable(Intrinsic::ID ID) const;
|
|
bool isTargetIntrinsicWithScalarOpAtArg(Intrinsic::ID ID,
|
|
unsigned ScalarOpdIdx);
|
|
bool isTargetIntrinsicWithOverloadTypeAtArg(Intrinsic::ID ID, int OpdIdx);
|
|
};
|
|
} // namespace llvm
|
|
|
|
#endif // LLVM_DIRECTX_DIRECTXTARGETTRANSFORMINFO_H
|