@@ -16832,7 +16832,7 @@ static void knownBitsForWorkitemID(const GCNSubtarget &ST,
16832
16832
16833
16833
static void knownBitsForSBFE(const MachineInstr &MI, GISelValueTracking &VT,
16834
16834
KnownBits &Known, const APInt &DemandedElts,
16835
- unsigned BFEWidth, bool SExt) {
16835
+ unsigned BFEWidth, bool SExt, unsigned Depth ) {
16836
16836
const MachineRegisterInfo &MRI = VT.getMachineFunction().getRegInfo();
16837
16837
const MachineOperand &Src1 = MI.getOperand(2);
16838
16838
@@ -16854,7 +16854,8 @@ static void knownBitsForSBFE(const MachineInstr &MI, GISelValueTracking &VT,
16854
16854
Src1Cst & maskTrailingOnes<unsigned>((BFEWidth == 32) ? 5 : 6);
16855
16855
const unsigned Width = (Src1Cst >> 16) & maskTrailingOnes<unsigned>(6);
16856
16856
16857
- VT.computeKnownBitsImpl(MI.getOperand(1).getReg(), Known, DemandedElts);
16857
+ VT.computeKnownBitsImpl(MI.getOperand(1).getReg(), Known, DemandedElts,
16858
+ Depth + 1);
16858
16859
16859
16860
Known.Zero = Known.Zero.lshr(Offset);
16860
16861
Known.One = Known.One.lshr(Offset);
@@ -16876,16 +16877,16 @@ void SITargetLowering::computeKnownBitsForTargetInstr(
16876
16877
switch (MI->getOpcode()) {
16877
16878
case AMDGPU::S_BFE_I32:
16878
16879
return knownBitsForSBFE(*MI, VT, Known, DemandedElts, /*Width=*/32,
16879
- /*SExt=*/true);
16880
+ /*SExt=*/true, Depth );
16880
16881
case AMDGPU::S_BFE_U32:
16881
16882
return knownBitsForSBFE(*MI, VT, Known, DemandedElts, /*Width=*/32,
16882
- /*SExt=*/false);
16883
+ /*SExt=*/false, Depth );
16883
16884
case AMDGPU::S_BFE_I64:
16884
16885
return knownBitsForSBFE(*MI, VT, Known, DemandedElts, /*Width=*/64,
16885
- /*SExt=*/true);
16886
+ /*SExt=*/true, Depth );
16886
16887
case AMDGPU::S_BFE_U64:
16887
16888
return knownBitsForSBFE(*MI, VT, Known, DemandedElts, /*Width=*/64,
16888
- /*SExt=*/false);
16889
+ /*SExt=*/false, Depth );
16889
16890
case AMDGPU::G_INTRINSIC:
16890
16891
case AMDGPU::G_INTRINSIC_CONVERGENT: {
16891
16892
Intrinsic::ID IID = cast<GIntrinsic>(MI)->getIntrinsicID();
0 commit comments