[llvm] r312364 - [AMDGPU] Prevent infinite recursion in DAG.computeKnownBits()

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 1 13:51:43 PDT 2017


On Fri, Sep 1, 2017 at 1:43 PM, Stanislav Mekhanoshin via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: rampitec
> Date: Fri Sep  1 13:43:20 2017
> New Revision: 312364
>
> URL: http://llvm.org/viewvc/llvm-project?rev=312364&view=rev
> Log:
> [AMDGPU] Prevent infinite recursion in DAG.computeKnownBits()
>
> Differential Revision: https://reviews.llvm.org/D37392
>
> Modified:
>     llvm/trunk/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
>
> Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUISelLowering.cpp?rev=312364&r1=312363&r2=312364&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/AMDGPU/AMDGPUISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/AMDGPU/AMDGPUISelLowering.cpp Fri Sep  1 13:43:20 2017
> @@ -3886,8 +3886,8 @@ void AMDGPUTargetLowering::computeKnownB
>    case AMDGPUISD::MUL_U24:
>    case AMDGPUISD::MUL_I24: {
>      KnownBits LHSKnown, RHSKnown;
> -    DAG.computeKnownBits(Op.getOperand(0), LHSKnown);
> -    DAG.computeKnownBits(Op.getOperand(1), RHSKnown);
> +    DAG.computeKnownBits(Op.getOperand(0), LHSKnown, Depth + 1);
> +    DAG.computeKnownBits(Op.getOperand(1), RHSKnown, Depth + 1);
>
>      unsigned TrailZ = LHSKnown.countMinTrailingZeros() +
>                        RHSKnown.countMinTrailingZeros();
>
>

This misses a testcase. Can you please add one?

Thanks,

--
Davide


More information about the llvm-commits mailing list