[PATCH] D86738: AMDGPU/GlobalISel: Implement computeKnownBits for groupstaticsize

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 02:43:00 PDT 2020


uabelho added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h:81
   unsigned MaxWavesPerEU;
-  int LocalMemorySize;
+  unsigned LocalMemorySize;
   char WavefrontSizeLog2;
----------------
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?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86738/new/

https://reviews.llvm.org/D86738



More information about the llvm-commits mailing list