@@ -1034,7 +1034,7 @@ bool SPIRVInstructionSelector::selectUnOp(Register ResVReg,
1034
1034
const SPIRVType *ResType,
1035
1035
MachineInstr &I,
1036
1036
unsigned Opcode) const {
1037
- if (! STI.isLogicalSPIRV () && I.getOperand (1 ).isReg ()) {
1037
+ if (STI.isPhysicalSPIRV () && I.getOperand (1 ).isReg ()) {
1038
1038
Register SrcReg = I.getOperand (1 ).getReg ();
1039
1039
bool IsGV = false ;
1040
1040
for (MachineRegisterInfo::def_instr_iterator DefIt =
@@ -2062,7 +2062,7 @@ bool SPIRVInstructionSelector::selectDot4AddPackedExpansion(
2062
2062
auto ExtractOp =
2063
2063
Signed ? SPIRV::OpBitFieldSExtract : SPIRV::OpBitFieldUExtract;
2064
2064
2065
- bool ZeroAsNull = !STI.isLogicalSPIRV ();
2065
+ bool ZeroAsNull = !STI.isShaderEnv ();
2066
2066
// Extract the i8 element, multiply and add it to the accumulator
2067
2067
for (unsigned i = 0 ; i < 4 ; i++) {
2068
2068
// A[i]
@@ -2203,7 +2203,7 @@ bool SPIRVInstructionSelector::selectWaveOpInst(Register ResVReg,
2203
2203
.addDef (ResVReg)
2204
2204
.addUse (GR.getSPIRVTypeID (ResType))
2205
2205
.addUse (GR.getOrCreateConstInt (SPIRV::Scope::Subgroup, I, IntTy, TII,
2206
- !STI.isLogicalSPIRV ()));
2206
+ !STI.isShaderEnv ()));
2207
2207
2208
2208
for (unsigned J = 2 ; J < I.getNumOperands (); J++) {
2209
2209
BMI.addUse (I.getOperand (J).getReg ());
@@ -2227,7 +2227,7 @@ bool SPIRVInstructionSelector::selectWaveActiveCountBits(
2227
2227
.addDef (ResVReg)
2228
2228
.addUse (GR.getSPIRVTypeID (ResType))
2229
2229
.addUse (GR.getOrCreateConstInt (SPIRV::Scope::Subgroup, I, IntTy,
2230
- TII, !STI.isLogicalSPIRV ()))
2230
+ TII, !STI.isShaderEnv ()))
2231
2231
.addImm (SPIRV::GroupOperation::Reduce)
2232
2232
.addUse (BallotReg)
2233
2233
.constrainAllUses (TII, TRI, RBI);
@@ -2258,7 +2258,7 @@ bool SPIRVInstructionSelector::selectWaveReduceMax(Register ResVReg,
2258
2258
.addDef (ResVReg)
2259
2259
.addUse (GR.getSPIRVTypeID (ResType))
2260
2260
.addUse (GR.getOrCreateConstInt (SPIRV::Scope::Subgroup, I, IntTy, TII,
2261
- !STI.isLogicalSPIRV ()))
2261
+ !STI.isShaderEnv ()))
2262
2262
.addImm (SPIRV::GroupOperation::Reduce)
2263
2263
.addUse (I.getOperand (2 ).getReg ())
2264
2264
.constrainAllUses (TII, TRI, RBI);
@@ -2285,7 +2285,7 @@ bool SPIRVInstructionSelector::selectWaveReduceSum(Register ResVReg,
2285
2285
.addDef (ResVReg)
2286
2286
.addUse (GR.getSPIRVTypeID (ResType))
2287
2287
.addUse (GR.getOrCreateConstInt (SPIRV::Scope::Subgroup, I, IntTy, TII,
2288
- !STI.isLogicalSPIRV ()))
2288
+ !STI.isShaderEnv ()))
2289
2289
.addImm (SPIRV::GroupOperation::Reduce)
2290
2290
.addUse (I.getOperand (2 ).getReg ());
2291
2291
}
@@ -2507,7 +2507,7 @@ bool SPIRVInstructionSelector::selectFCmp(Register ResVReg,
2507
2507
Register SPIRVInstructionSelector::buildZerosVal (const SPIRVType *ResType,
2508
2508
MachineInstr &I) const {
2509
2509
// OpenCL uses nulls for Zero. In HLSL we don't use null constants.
2510
- bool ZeroAsNull = !STI.isLogicalSPIRV ();
2510
+ bool ZeroAsNull = !STI.isShaderEnv ();
2511
2511
if (ResType->getOpcode () == SPIRV::OpTypeVector)
2512
2512
return GR.getOrCreateConstVector (0UL , I, ResType, TII, ZeroAsNull);
2513
2513
return GR.getOrCreateConstInt (0 , I, ResType, TII, ZeroAsNull);
@@ -2516,7 +2516,7 @@ Register SPIRVInstructionSelector::buildZerosVal(const SPIRVType *ResType,
2516
2516
Register SPIRVInstructionSelector::buildZerosValF (const SPIRVType *ResType,
2517
2517
MachineInstr &I) const {
2518
2518
// OpenCL uses nulls for Zero. In HLSL we don't use null constants.
2519
- bool ZeroAsNull = !STI.isLogicalSPIRV ();
2519
+ bool ZeroAsNull = !STI.isShaderEnv ();
2520
2520
APFloat VZero = getZeroFP (GR.getTypeForSPIRVType (ResType));
2521
2521
if (ResType->getOpcode () == SPIRV::OpTypeVector)
2522
2522
return GR.getOrCreateConstVector (VZero, I, ResType, TII, ZeroAsNull);
@@ -2526,7 +2526,7 @@ Register SPIRVInstructionSelector::buildZerosValF(const SPIRVType *ResType,
2526
2526
Register SPIRVInstructionSelector::buildOnesValF (const SPIRVType *ResType,
2527
2527
MachineInstr &I) const {
2528
2528
// OpenCL uses nulls for Zero. In HLSL we don't use null constants.
2529
- bool ZeroAsNull = !STI.isLogicalSPIRV ();
2529
+ bool ZeroAsNull = !STI.isShaderEnv ();
2530
2530
APFloat VOne = getOneFP (GR.getTypeForSPIRVType (ResType));
2531
2531
if (ResType->getOpcode () == SPIRV::OpTypeVector)
2532
2532
return GR.getOrCreateConstVector (VOne, I, ResType, TII, ZeroAsNull);
@@ -2714,10 +2714,10 @@ bool SPIRVInstructionSelector::selectConst(Register ResVReg,
2714
2714
Reg = GR.getOrCreateConstNullPtr (MIRBuilder, ResType);
2715
2715
} else if (Opcode == TargetOpcode::G_FCONSTANT) {
2716
2716
Reg = GR.getOrCreateConstFP (I.getOperand (1 ).getFPImm ()->getValue (), I,
2717
- ResType, TII, !STI.isLogicalSPIRV ());
2717
+ ResType, TII, !STI.isShaderEnv ());
2718
2718
} else {
2719
2719
Reg = GR.getOrCreateConstInt (I.getOperand (1 ).getCImm ()->getZExtValue (), I,
2720
- ResType, TII, !STI.isLogicalSPIRV ());
2720
+ ResType, TII, !STI.isShaderEnv ());
2721
2721
}
2722
2722
return Reg == ResVReg ? true : BuildCOPY (ResVReg, Reg, I);
2723
2723
}
@@ -3494,7 +3494,7 @@ bool SPIRVInstructionSelector::selectFirstBitSet64Overflow(
3494
3494
3495
3495
// On odd component counts we need to handle one more component
3496
3496
if (CurrentComponent != ComponentCount) {
3497
- bool ZeroAsNull = !STI.isLogicalSPIRV ();
3497
+ bool ZeroAsNull = !STI.isShaderEnv ();
3498
3498
Register FinalElemReg = MRI->createVirtualRegister (GR.getRegClass (I64Type));
3499
3499
Register ConstIntLastIdx = GR.getOrCreateConstInt (
3500
3500
ComponentCount - 1 , I, BaseType, TII, ZeroAsNull);
@@ -3524,7 +3524,7 @@ bool SPIRVInstructionSelector::selectFirstBitSet64(
3524
3524
Register SrcReg, unsigned BitSetOpcode, bool SwapPrimarySide) const {
3525
3525
unsigned ComponentCount = GR.getScalarOrVectorComponentCount (ResType);
3526
3526
SPIRVType *BaseType = GR.retrieveScalarOrVectorIntType (ResType);
3527
- bool ZeroAsNull = !STI.isLogicalSPIRV ();
3527
+ bool ZeroAsNull = !STI.isShaderEnv ();
3528
3528
Register ConstIntZero =
3529
3529
GR.getOrCreateConstInt (0 , I, BaseType, TII, ZeroAsNull);
3530
3530
Register ConstIntOne =
0 commit comments