Skip to content

Commit 2bb5fed

Browse files
authored
[CI] Explicitly set clang-format binary (KhronosGroup#2123)
Ensure the correct clang-format binary is picked up, as `clang-format-diff.py` currently seems to look for clang-format-17 while we install clang-format-18.
1 parent 3239d1e commit 2bb5fed

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

.github/workflows/check-code-style.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ jobs:
8282
if: ${{ steps.gather-list-of-changes.outputs.HAS_CHANGES }}
8383
id: run-clang-format
8484
run: |
85-
cat diff-to-inspect.txt | /usr/share/clang/clang-format-${{ env.LLVM_VERSION }}/clang-format-diff.py -p1 > clang-format.patch
85+
cat diff-to-inspect.txt | /usr/share/clang/clang-format-${{ env.LLVM_VERSION }}/clang-format-diff.py \
86+
-p1 -binary clang-format-${{ env.LLVM_VERSION }} > clang-format.patch
8687
if [ -s clang-format.patch ]; then
8788
echo "clang-format found incorrectly formatted code:"
8889
cat clang-format.patch;

lib/SPIRV/SPIRVReader.cpp

+11-8
Original file line numberDiff line numberDiff line change
@@ -1609,8 +1609,8 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
16091609
if (BVar->isBuiltin(&BVKind))
16101610
BV->setName(prefixSPIRVName(SPIRVBuiltInNameMap::map(BVKind)));
16111611
auto *LVar = new GlobalVariable(*M, Ty, IsConst, LinkageTy,
1612-
/*Initializer=*/nullptr, BV->getName(), 0,
1613-
GlobalVariable::NotThreadLocal, AddrSpace);
1612+
/*Initializer=*/nullptr, BV->getName(), 0,
1613+
GlobalVariable::NotThreadLocal, AddrSpace);
16141614
auto *Res = mapValue(BV, LVar);
16151615
if (Init)
16161616
Initializer = dyn_cast<Constant>(transValue(Init, F, BB, false));
@@ -1907,7 +1907,8 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
19071907
auto *Vector = transValue(VTS->getVector(), F, BB);
19081908
auto *VecTy = cast<FixedVectorType>(Vector->getType());
19091909
unsigned VecSize = VecTy->getNumElements();
1910-
auto *NewVec = Builder.CreateVectorSplat(VecSize, Scalar, Scalar->getName());
1910+
auto *NewVec =
1911+
Builder.CreateVectorSplat(VecSize, Scalar, Scalar->getName());
19111912
NewVec->takeName(Scalar);
19121913
auto *Scale = Builder.CreateFMul(Vector, NewVec, "scale");
19131914
return mapValue(BV, Scale);
@@ -1963,7 +1964,8 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
19631964
uint64_t ColNum = Matrix->getType()->getArrayNumElements();
19641965
auto *ColType = cast<ArrayType>(Matrix->getType())->getElementType();
19651966
auto VecSize = cast<FixedVectorType>(ColType)->getNumElements();
1966-
auto *NewVec = Builder.CreateVectorSplat(VecSize, Scalar, Scalar->getName());
1967+
auto *NewVec =
1968+
Builder.CreateVectorSplat(VecSize, Scalar, Scalar->getName());
19671969
NewVec->takeName(Scalar);
19681970

19691971
Value *V = UndefValue::get(Matrix->getType());
@@ -2338,8 +2340,8 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
23382340
case OpFunctionCall: {
23392341
SPIRVFunctionCall *BC = static_cast<SPIRVFunctionCall *>(BV);
23402342
auto *Call = CallInst::Create(transFunction(BC->getFunction()),
2341-
transValue(BC->getArgumentValues(), F, BB),
2342-
BC->getName(), BB);
2343+
transValue(BC->getArgumentValues(), F, BB),
2344+
BC->getName(), BB);
23432345
setCallingConv(Call);
23442346
setAttrByCalledFunc(Call);
23452347
return mapValue(BV, Call);
@@ -2457,7 +2459,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
24572459
case OpFNegate: {
24582460
SPIRVUnary *BC = static_cast<SPIRVUnary *>(BV);
24592461
auto *Neg = UnaryOperator::CreateFNeg(transValue(BC->getOperand(0), F, BB),
2460-
BV->getName(), BB);
2462+
BV->getName(), BB);
24612463
applyFPFastMathModeDecorations(BV, Neg);
24622464
return mapValue(BV, Neg);
24632465
}
@@ -4089,7 +4091,8 @@ bool SPIRVToLLVM::transMetadata() {
40894091
}
40904092
// Generate metadata for intel_reqd_sub_group_size
40914093
if (auto *EM = BF->getExecutionMode(ExecutionModeSubgroupSize)) {
4092-
auto *SizeMD = ConstantAsMetadata::get(getUInt32(M, EM->getLiterals()[0]));
4094+
auto *SizeMD =
4095+
ConstantAsMetadata::get(getUInt32(M, EM->getLiterals()[0]));
40934096
F->setMetadata(kSPIR2MD::SubgroupSize, MDNode::get(*Context, SizeMD));
40944097
}
40954098
// Generate metadata for max_work_group_size

0 commit comments

Comments
 (0)