Skip to content

Commit

Permalink
AMDGPU/GlobalISel: Fix legalize failure on i65 ctpop
Browse files Browse the repository at this point in the history
  • Loading branch information
arsenm committed Jan 19, 2022
1 parent 63eea41 commit adab717
Show file tree
Hide file tree
Showing 2 changed files with 620 additions and 2 deletions.
5 changes: 3 additions & 2 deletions llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -929,10 +929,11 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST_,
getActionDefinitionsBuilder(G_CTPOP)
.legalFor({{S32, S32}, {S32, S64}})
.clampScalar(0, S32, S32)
.widenScalarToNextPow2(1, 32)
.clampScalar(1, S32, S64)
.scalarize(0)
.widenScalarToNextPow2(0, 32)
.widenScalarToNextPow2(1, 32);
.widenScalarToNextPow2(0, 32);


// The hardware instructions return a different result on 0 than the generic
// instructions expect. The hardware produces -1, but these produce the
Expand Down
Loading

0 comments on commit adab717

Please sign in to comment.