@@ -16504,7 +16504,7 @@ static void knownBitsForWorkitemID(const GCNSubtarget &ST,
16504
16504
16505
16505
static void knownBitsForSBFE(const MachineInstr &MI, GISelValueTracking &VT,
16506
16506
KnownBits &Known, const APInt &DemandedElts,
16507
- unsigned BFEWidth, bool SExt) {
16507
+ unsigned BFEWidth, bool SExt, unsigned Depth ) {
16508
16508
const MachineRegisterInfo &MRI = VT.getMachineFunction().getRegInfo();
16509
16509
const MachineOperand &Src1 = MI.getOperand(2);
16510
16510
@@ -16526,7 +16526,8 @@ static void knownBitsForSBFE(const MachineInstr &MI, GISelValueTracking &VT,
16526
16526
Src1Cst & maskTrailingOnes<unsigned>((BFEWidth == 32) ? 5 : 6);
16527
16527
const unsigned Width = (Src1Cst >> 16) & maskTrailingOnes<unsigned>(6);
16528
16528
16529
- VT.computeKnownBitsImpl(MI.getOperand(1).getReg(), Known, DemandedElts);
16529
+ VT.computeKnownBitsImpl(MI.getOperand(1).getReg(), Known, DemandedElts,
16530
+ Depth + 1);
16530
16531
16531
16532
Known.Zero = Known.Zero.lshr(Offset);
16532
16533
Known.One = Known.One.lshr(Offset);
@@ -16548,16 +16549,16 @@ void SITargetLowering::computeKnownBitsForTargetInstr(
16548
16549
switch (MI->getOpcode()) {
16549
16550
case AMDGPU::S_BFE_I32:
16550
16551
return knownBitsForSBFE(*MI, VT, Known, DemandedElts, /*Width=*/32,
16551
- /*SExt=*/true);
16552
+ /*SExt=*/true, Depth );
16552
16553
case AMDGPU::S_BFE_U32:
16553
16554
return knownBitsForSBFE(*MI, VT, Known, DemandedElts, /*Width=*/32,
16554
- /*SExt=*/false);
16555
+ /*SExt=*/false, Depth );
16555
16556
case AMDGPU::S_BFE_I64:
16556
16557
return knownBitsForSBFE(*MI, VT, Known, DemandedElts, /*Width=*/64,
16557
- /*SExt=*/true);
16558
+ /*SExt=*/true, Depth );
16558
16559
case AMDGPU::S_BFE_U64:
16559
16560
return knownBitsForSBFE(*MI, VT, Known, DemandedElts, /*Width=*/64,
16560
- /*SExt=*/false);
16561
+ /*SExt=*/false, Depth );
16561
16562
case AMDGPU::G_INTRINSIC:
16562
16563
case AMDGPU::G_INTRINSIC_CONVERGENT: {
16563
16564
Intrinsic::ID IID = cast<GIntrinsic>(MI)->getIntrinsicID();
0 commit comments