This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Implement computeKnownBits for groupstaticsize
ClosedPublic

Authored by arsenm on Aug 27 2020, 2:28 PM.

Details

Diff Detail

Event Timeline

arsenm created this revision.Aug 27 2020, 2:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 27 2020, 2:28 PM
arsenm requested review of this revision.Aug 27 2020, 2:28 PM
rampitec accepted this revision.Aug 27 2020, 3:07 PM
This revision is now accepted and ready to land.Aug 27 2020, 3:07 PM
uabelho added a subscriber: uabelho.Sep 2 2020, 2:42 AM
uabelho added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
81

With this change the following warnings pop up from gcc:

lib/Target/AMDGPU/AMDGPUGenSubtargetInfo.inc:747:64: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
   if (Bits[AMDGPU::FeatureLocalMemorySize0] && LocalMemorySize < 0) LocalMemorySize = 0;
                                                ~~~~~~~~~~~~~~~~^~~

and

lib/Target/AMDGPU/R600GenSubtargetInfo.inc:280:62: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
   if (Bits[R600::FeatureLocalMemorySize0] && LocalMemorySize < 0) LocalMemorySize = 0;
                                              ~~~~~~~~~~~~~~~~^~~

The generated code looks like

if (Bits[AMDGPU::FeatureLocalMemorySize0] && LocalMemorySize < 0) LocalMemorySize = 0;

Any easy way to get rid of it?