Skip to content

Commit 3a19009

Browse files
committed
Revert NFC changes to reduce changeset size.
1 parent fa19077 commit 3a19009

File tree

5 files changed

+18
-22
lines changed

5 files changed

+18
-22
lines changed

llvm/lib/Target/DirectX/DXIL.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ class Stages<list<ShaderStage> st> : Pred {
275275
}
276276

277277
// Following class represents predicate that evaluates to the payload when
278-
// specified predicte is true.
278+
// specified predicate is true.
279279

280280
class Constraints<Pred p, list<Pred> l = []> : Pred {
281281
Pred pred = p;

llvm/lib/Target/DirectX/DXILOpBuilder.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static OverloadKind getOverloadKind(Type *Ty) {
5959
}
6060
}
6161
case Type::PointerTyID:
62-
return OverloadKind::UserDefinedType;
62+
return OverloadKind::UserDefineType;
6363
case Type::StructTyID:
6464
return OverloadKind::ObjectType;
6565
default:
@@ -69,9 +69,9 @@ static OverloadKind getOverloadKind(Type *Ty) {
6969
}
7070

7171
static std::string getTypeName(OverloadKind Kind, Type *Ty) {
72-
if (Kind < OverloadKind::UserDefinedType) {
72+
if (Kind < OverloadKind::UserDefineType) {
7373
return getOverloadTypeName(Kind);
74-
} else if (Kind == OverloadKind::UserDefinedType) {
74+
} else if (Kind == OverloadKind::UserDefineType) {
7575
StructType *ST = cast<StructType>(Ty);
7676
return ST->getStructName().str();
7777
} else if (Kind == OverloadKind::ObjectType) {
@@ -100,7 +100,7 @@ static std::string constructOverloadTypeName(OverloadKind Kind,
100100
if (Kind == OverloadKind::VOID)
101101
return TypeName.str();
102102

103-
assert(Kind < OverloadKind::UserDefinedType && "invalid overload kind");
103+
assert(Kind < OverloadKind::UserDefineType && "invalid overload kind");
104104
return (Twine(TypeName) + getOverloadTypeName(Kind)).str();
105105
}
106106

@@ -340,7 +340,7 @@ CallInst *DXILOpBuilder::createDXILOpCall(dxil::OpCode OpCode, Type *ReturnTy,
340340
return B.CreateCall(DXILFn, Args);
341341
}
342342

343-
Type *DXILOpBuilder::getOverloadType(dxil::OpCode OpCode, FunctionType *FT) {
343+
Type *DXILOpBuilder::getOverloadTy(dxil::OpCode OpCode, FunctionType *FT) {
344344

345345
const OpCodeProperty *Prop = getOpCodeProperty(OpCode);
346346
// If DXIL Op has no overload parameter, just return the

llvm/lib/Target/DirectX/DXILOpBuilder.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
#include "DXILConstants.h"
1616
#include "llvm/ADT/SmallVector.h"
17-
#include "llvm/Support/DXILABI.h"
18-
#include "llvm/Support/VersionTuple.h"
1917
namespace llvm {
2018
class Module;
2119
class IRBuilderBase;
@@ -43,7 +41,7 @@ class DXILOpBuilder {
4341
CallInst *createDXILOpCall(dxil::OpCode OpCode, Type *ReturnTy,
4442
Type *OverloadTy, SmallVector<Value *> Args);
4543

46-
Type *getOverloadType(dxil::OpCode OpCode, FunctionType *FT);
44+
Type *getOverloadTy(dxil::OpCode OpCode, FunctionType *FT);
4745
static const char *getOpCodeName(dxil::OpCode DXILOp);
4846

4947
private:

llvm/lib/Target/DirectX/DXILOpLowering.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222
#include "llvm/IR/IntrinsicsDirectX.h"
2323
#include "llvm/IR/Module.h"
2424
#include "llvm/IR/PassManager.h"
25-
#include "llvm/MC/TargetRegistry.h"
2625
#include "llvm/Pass.h"
2726
#include "llvm/Support/ErrorHandling.h"
28-
#include <string>
2927

3028
#define DEBUG_TYPE "dxil-op-lower"
3129

@@ -77,7 +75,7 @@ static SmallVector<Value *> argVectorFlatten(CallInst *Orig,
7775
static void lowerIntrinsic(dxil::OpCode DXILOp, Function &F, Module &M) {
7876
IRBuilder<> B(M.getContext());
7977
DXILOpBuilder DXILB(M, B);
80-
Type *OverloadTy = DXILB.getOverloadType(DXILOp, F.getFunctionType());
78+
Type *OverloadTy = DXILB.getOverloadTy(DXILOp, F.getFunctionType());
8179
for (User *U : make_early_inc_range(F.users())) {
8280
CallInst *CI = dyn_cast<CallInst>(U);
8381
if (!CI)

llvm/utils/TableGen/DXILEmitter.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "llvm/TableGen/Record.h"
2626
#include "llvm/TableGen/TableGenBackend.h"
2727

28+
#include <cstddef>
2829
#include <string>
2930
#include <vector>
3031

@@ -108,7 +109,7 @@ DXILOperationDesc::DXILOperationDesc(const Record *R) {
108109
for (auto Ty : ArgTys) {
109110
ParamTypeRecs.push_back(Ty);
110111
}
111-
unsigned ParamTypeRecsSize = ParamTypeRecs.size();
112+
size_t ParamTypeRecsSize = ParamTypeRecs.size();
112113
// Populate OpTypes with return type and parameter types
113114

114115
// Parameter indices of overloaded parameters.
@@ -120,23 +121,23 @@ DXILOperationDesc::DXILOperationDesc(const Record *R) {
120121
for (unsigned I = 0; I < ParamTypeRecsSize; I++) {
121122
auto TR = ParamTypeRecs[I];
122123
// Track operation parameter indices of any overload types
123-
auto IsAny = TR->getValueAsInt("isAny");
124-
if (IsAny == 1) {
125-
// TODO: At present it is expected that all overload types in a DXIL Op
124+
auto isAny = TR->getValueAsInt("isAny");
125+
if (isAny == 1) {
126+
// It is expected that all overload types in a DXIL Op
126127
// are of the same type. Hence, OverloadParamIndices will have only one
127128
// element. This implies we do not need a vector. However, until more
128129
// (all?) DXIL Ops are added in DXIL.td, a vector is being used to flag
129130
// cases this assumption would not hold.
130131
if (!OverloadParamIndices.empty()) {
131-
bool KnownType = true;
132+
bool knownType = true;
132133
// Ensure that the same overload type registered earlier is being used
133134
for (auto Idx : OverloadParamIndices) {
134135
if (TR != ParamTypeRecs[Idx]) {
135-
KnownType = false;
136+
knownType = false;
136137
break;
137138
}
138139
}
139-
assert(KnownType && "Specification of multiple differing overload "
140+
assert(knownType && "Specification of multiple differing overload "
140141
"parameter types not yet supported");
141142
} else {
142143
OverloadParamIndices.push_back(I);
@@ -506,7 +507,6 @@ static void emitDXILOperationTable(std::vector<DXILOperationDesc> &Ops,
506507
<< Op.OverloadParamIndex << ", " << Op.OpTypes.size() - 1 << ", "
507508
<< Parameters.get(ParameterMap[Op.OpClass]) << " }";
508509
Prefix = ",\n";
509-
// OS << "\n// " << getConstraintString(Op.Constraints) << "\n";
510510
}
511511
OS << " };\n";
512512

@@ -599,7 +599,7 @@ static void emitDXILOperationTableDataStructs(RecordKeeper &Records,
599599
// Emit enum OverloadKind with valid overload types.
600600
const SmallVector<std::string> OverloadKindList = {
601601
"VOID", "HALF", "FLOAT", "DOUBLE", "I1", "I8",
602-
"I16", "I32", "I64", "UserDefinedType", "ObjectType"};
602+
"I16", "I32", "I64", "UserDefineType", "ObjectType"};
603603
// Choose the type of enum OverloadKind based on the number of valid types in
604604
// OverloadKindList. This gives the flexibility to just add new supported
605605
// types to the list above, if needed, with no need to change this backend
@@ -667,7 +667,7 @@ static void emitDXILOperationTableDataStructs(RecordKeeper &Records,
667667
case OverloadKind::UNDEFINED: \n \
668668
return \"void\"; \n \
669669
case OverloadKind::ObjectType: \n \
670-
case OverloadKind::UserDefinedType: \n \
670+
case OverloadKind::UserDefineType: \n \
671671
break; \n \
672672
} \n \
673673
llvm_unreachable(\"invalid overload type for name\"); \n \

0 commit comments

Comments
 (0)