Skip to content

Commit eccd27a

Browse files
committed
Fix after-merge bugs.
1 parent 3792464 commit eccd27a

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1994,6 +1994,18 @@ static void collectReqs(const Module &M, SPIRV::ModuleAnalysisInfo &MAI,
19941994
}
19951995
break;
19961996
}
1997+
case SPIRV::ExecutionMode::ContractionOff:
1998+
case SPIRV::ExecutionMode::SignedZeroInfNanPreserve:
1999+
if (HasKHRFloatControls2) {
2000+
RequireKHRFloatControls2 = true;
2001+
MAI.Reqs.getAndAddRequirements(
2002+
SPIRV::OperandCategory::ExecutionModeOperand,
2003+
SPIRV::ExecutionMode::FPFastMathDefault, ST);
2004+
} else {
2005+
MAI.Reqs.getAndAddRequirements(
2006+
SPIRV::OperandCategory::ExecutionModeOperand, EM, ST);
2007+
}
2008+
break;
19972009
default:
19982010
MAI.Reqs.getAndAddRequirements(
19992011
SPIRV::OperandCategory::ExecutionModeOperand, EM, ST);
@@ -2163,7 +2175,8 @@ static void handleMIFlagDecoration(
21632175
for (SPIRV::FPFastMathDefaultInfo &Elem : FPFastMathDefaultInfoVec) {
21642176
if (Ty == Elem.Ty) {
21652177
FMFlags = Elem.FastMathFlags;
2166-
Emit = Elem.ContractionOff || Elem.SignedZeroInfNanPreserve || Elem.FPFastMathDefault;
2178+
Emit = Elem.ContractionOff || Elem.SignedZeroInfNanPreserve ||
2179+
Elem.FPFastMathDefault;
21672180
break;
21682181
}
21692182
}

llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,6 @@ defm Subgroup2DBlockTransformINTEL : CapabilityOperand<6229, 0, 0, [SPV_INTEL_2d
529529
defm Subgroup2DBlockTransposeINTEL : CapabilityOperand<6230, 0, 0, [SPV_INTEL_2d_block_io], [Subgroup2DBlockIOINTEL]>;
530530
defm Int4TypeINTEL : CapabilityOperand<5112, 0, 0, [SPV_INTEL_int4], []>;
531531
defm Int4CooperativeMatrixINTEL : CapabilityOperand<5114, 0, 0, [SPV_INTEL_int4], [Int4TypeINTEL, CooperativeMatrixKHR]>;
532-
defm FloatControls2 : CapabilityOperand<6029, 0, 0, [SPV_KHR_float_controls2], []>;
533532

534533
//===----------------------------------------------------------------------===//
535534
// Multiclass used to define SourceLanguage enum values and at the same time

llvm/test/CodeGen/SPIRV/capability-FloatControl2.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
; CHECK-EXT: OpCapability FloatControls2
1010
; CHECK-EXT: OpExtension "SPV_KHR_float_controls2"
11-
; CHECK-EXT: OpDecorate {{%[0-9]+}} FPFastMathMode NotNaN|NotInf|NSZ|AllowRecip|Fast
11+
; CHECK-EXT: OpDecorate {{%[0-9]+}} FPFastMathMode NotNaN|NotInf|NSZ|AllowRecip|AllowContract|AllowReassoc|AllowTransform
1212

1313
define hidden spir_func float @foo(float %0) local_unnamed_addr {
1414
%2 = fmul reassoc nnan ninf nsz arcp afn float %0, 2.000000e+00

0 commit comments

Comments
 (0)