@@ -4394,8 +4394,6 @@ enum class TypeClass { VECTOR_OF_TWO, SCALAR, NONE_OF_LISTED };
4394
4394
4395
4395
static TypeClass isVectorOfTwoOrScalar (const MachineOperand *Op,
4396
4396
const MachineRegisterInfo &MRI) {
4397
- if (!Op->isReg () || Op->getReg ().isPhysical ())
4398
- return TypeClass::NONE_OF_LISTED;
4399
4397
LLT OpTy = MRI.getType (Op->getReg ());
4400
4398
if (OpTy.isScalar ())
4401
4399
return TypeClass::SCALAR;
@@ -4419,7 +4417,8 @@ static SrcStatus getNegStatus(const MachineOperand *Op, SrcStatus S,
4419
4417
// [CurrHi, CurrLo] = [-OpHi, -OpLo](2 x Type)
4420
4418
// [SrcHi, SrcLo] = [-OpHi, -OpLo]
4421
4419
return SrcStatus::IS_BOTH_NEG;
4422
- } else if (NegType == TypeClass::SCALAR) {
4420
+ }
4421
+ if (NegType == TypeClass::SCALAR) {
4423
4422
// Scalar:
4424
4423
// [SrcHi, SrcLo] = [CurrHi, CurrLo]
4425
4424
// [CurrHi, CurrLo] = neg [OpHi, OpLo](Type)
@@ -4436,7 +4435,8 @@ static SrcStatus getNegStatus(const MachineOperand *Op, SrcStatus S,
4436
4435
// [CurrHi, CurrLo] = [-OpHi, -OpLo](2 x Type)
4437
4436
// [SrcHi, SrcLo] = [-(-OpHi), -OpLo] = [OpHi, -OpLo]
4438
4437
return SrcStatus::IS_LO_NEG;
4439
- } else if (NegType == TypeClass::SCALAR) {
4438
+ }
4439
+ if (NegType == TypeClass::SCALAR) {
4440
4440
// Scalar:
4441
4441
// [SrcHi, SrcLo] = [-CurrHi, CurrLo]
4442
4442
// [CurrHi, CurrLo] = neg [OpHi, OpLo](Type)
@@ -4453,7 +4453,8 @@ static SrcStatus getNegStatus(const MachineOperand *Op, SrcStatus S,
4453
4453
// [CurrHi, CurrLo] = [-OpHi, -OpLo](2 x Type)
4454
4454
// [SrcHi, SrcLo] = [-OpHi, -(-OpLo)] = [-OpHi, OpLo]
4455
4455
return SrcStatus::IS_HI_NEG;
4456
- } else if (NegType == TypeClass::SCALAR) {
4456
+ }
4457
+ if (NegType == TypeClass::SCALAR) {
4457
4458
// Scalar:
4458
4459
// [SrcHi, SrcLo] = [CurrHi, -CurrLo]
4459
4460
// [CurrHi, CurrLo] = fneg [OpHi, OpLo](Type)
@@ -4470,7 +4471,8 @@ static SrcStatus getNegStatus(const MachineOperand *Op, SrcStatus S,
4470
4471
// [CurrHi, CurrLo] = [-OpHi, -OpLo](2 x Type)
4471
4472
// [SrcHi, SrcLo] = [OpHi, OpLo]
4472
4473
return SrcStatus::IS_SAME;
4473
- } else if (NegType == TypeClass::SCALAR) {
4474
+ }
4475
+ if (NegType == TypeClass::SCALAR) {
4474
4476
// Scalar:
4475
4477
// [SrcHi, SrcLo] = [-CurrHi, -CurrLo]
4476
4478
// [CurrHi, CurrLo] = fneg [OpHi, OpLo](Type)
@@ -4503,7 +4505,8 @@ static SrcStatus getNegStatus(const MachineOperand *Op, SrcStatus S,
4503
4505
// [CurrUpper, CurrLower] = [-OpUpper, -OpLower](2 x Type)
4504
4506
// Src = -OpLower
4505
4507
return SrcStatus::IS_LOWER_HALF_NEG;
4506
- } else if (NegType == TypeClass::SCALAR) {
4508
+ }
4509
+ if (NegType == TypeClass::SCALAR) {
4507
4510
// Scalar:
4508
4511
// Src = CurrLower
4509
4512
// Curr = [CurrUpper, CurrLower]
@@ -4537,7 +4540,8 @@ static SrcStatus getNegStatus(const MachineOperand *Op, SrcStatus S,
4537
4540
// [CurrUpper, CurrLower] = [-OpUpper, -OpLower](2 x Type)
4538
4541
// Src = -(-OpLower) = OpLower
4539
4542
return SrcStatus::IS_LOWER_HALF;
4540
- } else if (NegType == TypeClass::SCALAR) {
4543
+ }
4544
+ if (NegType == TypeClass::SCALAR) {
4541
4545
// Scalar:
4542
4546
// Src = -CurrLower
4543
4547
// Curr = [CurrUpper, CurrLower]
@@ -4566,9 +4570,10 @@ calcNextStatus(std::pair<const MachineOperand *, SrcStatus> Curr,
4566
4570
4567
4571
// Handle general Opc cases.
4568
4572
switch (Opc) {
4569
- case AMDGPU::G_BITCAST:
4570
4573
case AMDGPU::G_CONSTANT:
4571
4574
case AMDGPU::G_FCONSTANT:
4575
+ return retOpStat (&MI->getOperand (1 ), Curr.second , Curr);
4576
+ case AMDGPU::G_BITCAST:
4572
4577
case AMDGPU::COPY:
4573
4578
return retOpStat (&MI->getOperand (1 ), Curr.second , Curr);
4574
4579
case AMDGPU::G_FNEG:
0 commit comments