Skip to content

Commit 1e5fa7c

Browse files
committed
Restore clean unroll checkpoint build
1 parent 55112e3 commit 1e5fa7c

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

tools/clang/lib/Frontend/Rewrite/RewriteObjC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ namespace {
483483
result = Context->getObjCIdType();
484484
FunctionProtoType::ExtProtoInfo fpi;
485485
fpi.Variadic = variadic;
486-
return Context->getFunctionType(result, args, fpi);
486+
return Context->getFunctionType(result, args, fpi, {});
487487
}
488488

489489
// Helper function: create a CStyleCastExpr with trivial type source info.

tools/clang/lib/SPIRV/SpirvEmitter.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8053,7 +8053,7 @@ SpirvInstruction *SpirvEmitter::createVectorSplat(const Expr *scalarExpr,
80538053
// Should find a more meaningful one.
80548054
if (auto *constVal = dyn_cast<SpirvConstant>(scalarVal)) {
80558055
llvm::SmallVector<SpirvConstant *, 4> elements(size_t(size), constVal);
8056-
const bool isSpecConst = constVal->getopcode() == spv::Op::OpSpecConstant;
8056+
const bool isSpecConst = constVal->isSpecConstant();
80578057
auto *value =
80588058
spvBuilder.getConstantComposite(vecType, elements, isSpecConst);
80598059
if (!value)
@@ -16673,9 +16673,15 @@ bool SpirvEmitter::spirvToolsLegalize(std::vector<uint32_t> *mod,
1667316673
optimizer.RegisterPass(
1667416674
spvtools::CreateInterfaceVariableScalarReplacementPass());
1667516675
}
16676-
optimizer.RegisterLegalizationPasses(spirvOptions.preserveInterface,
16677-
needsLegalizationLoopUnroll,
16678-
needsLegalizationSsaRewrite);
16676+
auto legalizationSsaRewriteMode = spvtools::SSARewriteMode::None;
16677+
if (needsLegalizationLoopUnroll) {
16678+
legalizationSsaRewriteMode = spvtools::SSARewriteMode::All;
16679+
} else if (needsLegalizationSsaRewrite) {
16680+
legalizationSsaRewriteMode = spvtools::SSARewriteMode::OpaqueOnly;
16681+
}
16682+
optimizer.RegisterLegalizationPasses(
16683+
spirvOptions.preserveInterface, needsLegalizationLoopUnroll,
16684+
legalizationSsaRewriteMode);
1667916685
// Add flattening of resources if needed.
1668016686
if (spirvOptions.flattenResourceArrays) {
1668116687
optimizer.RegisterPass(

0 commit comments

Comments
 (0)