[AMDGPU][GlobalISel] Legalize G_MUL for non-standard types
authorMirko Brkusanin <Mirko.Brkusanin@amd.com>
Tue, 7 Sep 2021 14:25:04 +0000 (16:25 +0200)
committerMirko Brkusanin <Mirko.Brkusanin@amd.com>
Tue, 7 Sep 2021 14:33:24 +0000 (16:33 +0200)
commit6c4b634da6191b2fa10e833a9393115b83e768d1
treef9f952c1fe88fe06cdcfd9ef4eba70b8c9bffc30
parent5263bf583a26f3f99c2ac34843e89d210bb4fe26
[AMDGPU][GlobalISel] Legalize G_MUL for non-standard types

Legalizing G_MUL for non-standard types (like i33) generated an error. Putting
minScalar and maxScalar instead of clampScalar. Also using new rule, instead
of widening to the next power of 2, widen to the next multiple of the passed
argument (32 in this case), so instead of widening i65 to i128, we widen it to
i96.

Patch by: Mateja Marjanovic

Differential Revision: https://reviews.llvm.org/D109228
llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp
llvm/lib/CodeGen/GlobalISel/LegalizeMutations.cpp
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-mul.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/mul.ll