Skip to content

Commit

Permalink
Merge commit 'e77c40ffbda1' from llvm.org/main into next
Browse files Browse the repository at this point in the history
  • Loading branch information
git apple-llvm automerger committed Sep 21, 2022
2 parents 79b60ef + e77c40f commit 506a023
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions llvm/include/llvm/Support/DXILOperationCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "llvm/ADT/StringSwitch.h"

namespace llvm {
namespace DXIL {
namespace dxil {

enum class ParameterKind : uint8_t {
INVALID = 0,
Expand Down Expand Up @@ -57,7 +57,7 @@ inline ParameterKind parameterTypeNameToKind(StringRef Name) {
.Default(ParameterKind::INVALID);
}

} // namespace DXIL
} // namespace dxil
} // namespace llvm

#endif
4 changes: 2 additions & 2 deletions llvm/lib/Target/DirectX/DXILConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
#define LLVM_LIB_TARGET_DIRECTX_DXILCONSTANTS_H

namespace llvm {
namespace DXIL {
namespace dxil {

#define DXIL_OP_ENUM
#include "DXILOperation.inc"
#undef DXIL_OP_ENUM

} // namespace DXIL
} // namespace dxil
} // namespace llvm

#endif
18 changes: 9 additions & 9 deletions llvm/lib/Target/DirectX/DXILOpBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "llvm/Support/ErrorHandling.h"

using namespace llvm;
using namespace llvm::DXIL;
using namespace llvm::dxil;

constexpr StringLiteral DXILOpNamePrefix = "dx.op.";

Expand Down Expand Up @@ -125,10 +125,10 @@ static std::string getTypeName(OverloadKind Kind, Type *Ty) {

// Static properties.
struct OpCodeProperty {
DXIL::OpCode OpCode;
dxil::OpCode OpCode;
// Offset in DXILOpCodeNameTable.
unsigned OpCodeNameOffset;
DXIL::OpCodeClass OpCodeClass;
dxil::OpCodeClass OpCodeClass;
// Offset in DXILOpCodeClassNameTable.
unsigned OpCodeClassNameOffset;
uint16_t OverloadTys;
Expand Down Expand Up @@ -234,7 +234,7 @@ static FunctionType *getDXILOpFunctionType(const OpCodeProperty *Prop,
ArgTys[0], ArrayRef<Type *>(&ArgTys[1], ArgTys.size() - 1), false);
}

static FunctionCallee getOrCreateDXILOpFunction(DXIL::OpCode DXILOp,
static FunctionCallee getOrCreateDXILOpFunction(dxil::OpCode DXILOp,
Type *OverloadTy, Module &M) {
const OpCodeProperty *Prop = getOpCodeProperty(DXILOp);

Expand All @@ -255,9 +255,9 @@ static FunctionCallee getOrCreateDXILOpFunction(DXIL::OpCode DXILOp,
}

namespace llvm {
namespace DXIL {
namespace dxil {

CallInst *DXILOpBuilder::createDXILOpCall(DXIL::OpCode OpCode, Type *OverloadTy,
CallInst *DXILOpBuilder::createDXILOpCall(dxil::OpCode OpCode, Type *OverloadTy,
llvm::iterator_range<Use *> Args) {
auto Fn = getOrCreateDXILOpFunction(OpCode, OverloadTy, M);
SmallVector<Value *> FullArgs;
Expand All @@ -266,7 +266,7 @@ CallInst *DXILOpBuilder::createDXILOpCall(DXIL::OpCode OpCode, Type *OverloadTy,
return B.CreateCall(Fn, FullArgs);
}

Type *DXILOpBuilder::getOverloadTy(DXIL::OpCode OpCode, FunctionType *FT,
Type *DXILOpBuilder::getOverloadTy(dxil::OpCode OpCode, FunctionType *FT,
bool NoOpCodeParam) {

const OpCodeProperty *Prop = getOpCodeProperty(OpCode);
Expand Down Expand Up @@ -317,8 +317,8 @@ Type *DXILOpBuilder::getOverloadTy(DXIL::OpCode OpCode, FunctionType *FT,
return OverloadType;
}

const char *DXILOpBuilder::getOpCodeName(DXIL::OpCode DXILOp) {
const char *DXILOpBuilder::getOpCodeName(dxil::OpCode DXILOp) {
return ::getOpCodeName(DXILOp);
}
} // namespace DXIL
} // namespace dxil
} // namespace llvm
10 changes: 5 additions & 5 deletions llvm/lib/Target/DirectX/DXILOpBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ class Type;
class FunctionType;
class Use;

namespace DXIL {
namespace dxil {

class DXILOpBuilder {
public:
DXILOpBuilder(Module &M, IRBuilderBase &B) : M(M), B(B) {}
CallInst *createDXILOpCall(DXIL::OpCode OpCode, Type *OverloadTy,
CallInst *createDXILOpCall(dxil::OpCode OpCode, Type *OverloadTy,
llvm::iterator_range<Use *> Args);
Type *getOverloadTy(DXIL::OpCode OpCode, FunctionType *FT,
Type *getOverloadTy(dxil::OpCode OpCode, FunctionType *FT,
bool NoOpCodeParam);
static const char *getOpCodeName(DXIL::OpCode DXILOp);
static const char *getOpCodeName(dxil::OpCode DXILOp);

private:
Module &M;
IRBuilderBase &B;
};

} // namespace DXIL
} // namespace dxil
} // namespace llvm

#endif
4 changes: 2 additions & 2 deletions llvm/lib/Target/DirectX/DXILOpLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
#define DEBUG_TYPE "dxil-op-lower"

using namespace llvm;
using namespace llvm::DXIL;
using namespace llvm::dxil;

static void lowerIntrinsic(DXIL::OpCode DXILOp, Function &F, Module &M) {
static void lowerIntrinsic(dxil::OpCode DXILOp, Function &F, Module &M) {
IRBuilder<> B(M.getContext());
Value *DXILOpArg = B.getInt32(static_cast<unsigned>(DXILOp));
DXILOpBuilder DXILB(M, B);
Expand Down
10 changes: 5 additions & 5 deletions llvm/lib/Target/DirectX/DXILStubs.td
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// DXIL doesn't actually use registers, but this gets the boilerplate code
// generated through tablegen.
let Namespace = "DXIL" in {
def DXIL : Register<"DXIL">;
def DXILClass : RegisterClass<"DXIL", [i32], 32, (add DXIL)>;
let Namespace = "dxil" in {
def DXIL : Register<"dxil">;
def DXILClass : RegisterClass<"dxil", [i32], 32, (add DXIL)>;
}

class DXILInst : Instruction {
let Namespace = "DXIL";
let DecoderNamespace = "DXIL";
let Namespace = "dxil";
let DecoderNamespace = "dxil";

dag OutOperandList = (outs);
dag InOperandList = (ins);
Expand Down
18 changes: 9 additions & 9 deletions llvm/utils/TableGen/DXILEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "llvm/TableGen/Record.h"

using namespace llvm;
using namespace llvm::DXIL;
using namespace llvm::dxil;

namespace {

Expand Down Expand Up @@ -144,7 +144,7 @@ static std::string parameterKindToString(ParameterKind Kind) {
case ParameterKind::DXIL_HANDLE:
return "DXIL_HANDLE";
}
llvm_unreachable("Unknown llvm::DXIL::ParameterKind enum");
llvm_unreachable("Unknown llvm::dxil::ParameterKind enum");
}

static void emitDXILOpEnum(DXILOperationData &DXILOp, raw_ostream &OS) {
Expand Down Expand Up @@ -238,14 +238,14 @@ static void emitDXILIntrinsicMap(std::vector<DXILOperationData> &DXILOps,
raw_ostream &OS) {
OS << "\n";
// FIXME: use array instead of SmallDenseMap.
OS << "static const SmallDenseMap<Intrinsic::ID, DXIL::OpCode> LowerMap = "
OS << "static const SmallDenseMap<Intrinsic::ID, dxil::OpCode> LowerMap = "
"{\n";
for (auto &DXILOp : DXILOps) {
if (DXILOp.Intrinsic.empty())
continue;
// {Intrinsic::sin, DXIL::OpCode::Sin},
// {Intrinsic::sin, dxil::OpCode::Sin},
OS << " { Intrinsic::" << DXILOp.Intrinsic
<< ", DXIL::OpCode::" << DXILOp.DXILOp << "},\n";
<< ", dxil::OpCode::" << DXILOp.DXILOp << "},\n";
}
OS << "};\n";
OS << "\n";
Expand Down Expand Up @@ -340,16 +340,16 @@ static void emitDXILOperationTable(std::vector<DXILOperationData> &DXILOps,
Parameters.layout();

// Emit the DXIL operation table.
//{DXIL::OpCode::Sin, OpCodeNameIndex, OpCodeClass::Unary,
//{dxil::OpCode::Sin, OpCodeNameIndex, OpCodeClass::Unary,
// OpCodeClassNameIndex,
// OverloadKind::FLOAT | OverloadKind::HALF, Attribute::AttrKind::ReadNone, 0,
// 3, ParameterTableOffset},
OS << "static const OpCodeProperty *getOpCodeProperty(DXIL::OpCode DXILOp) "
OS << "static const OpCodeProperty *getOpCodeProperty(dxil::OpCode DXILOp) "
"{\n";

OS << " static const OpCodeProperty OpCodeProps[] = {\n";
for (auto &DXILOp : DXILOps) {
OS << " { DXIL::OpCode::" << DXILOp.DXILOp << ", "
OS << " { dxil::OpCode::" << DXILOp.DXILOp << ", "
<< OpStrings.get(DXILOp.DXILOp.str())
<< ", OpCodeClass::" << DXILOp.DXILClass << ", "
<< OpClassStrings.get(getDXILOpClassName(DXILOp.DXILClass)) << ", "
Expand All @@ -375,7 +375,7 @@ static void emitDXILOperationTable(std::vector<DXILOperationData> &DXILOps,
OS << "}\n\n";

// Emit the string tables.
OS << "static const char *getOpCodeName(DXIL::OpCode DXILOp) {\n\n";
OS << "static const char *getOpCodeName(dxil::OpCode DXILOp) {\n\n";

OpStrings.emitStringLiteralDef(OS,
" static const char DXILOpCodeNameTable[]");
Expand Down

0 comments on commit 506a023

Please sign in to comment.