Index arrays must be unsigned ints (instead of signed)
- Dominant language
- Python
- Stars
- 34
- Forks
- 25
- Avg merge
- 3h 37m
- Merged PRs (30d)
- 2
Description
Generated code typically involves integer modulo operations on them and loopy would end up performing them using:
```c
#define LOOPY_DEFINE_MOD_POS_B(SUFFIX, TYPE) \
static inline TYPE loopy_mod_pos_b_##SUFFIX(TYPE a, TYPE b) \
{ \
TYPE result = a%b; \
if (result < 0) \
result += b; \
return result; \
}
LOOPY_CALL_WITH_INTEGER_TYPES(LOOPY_DEFINE_MOD_POS_B)
```
if loopy knew "a" was unsigned it would optimize this away and simply generate "a % b".
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the code that generates index arrays and the integer-type handling behind the generated modulo operations shown in the issue. Verify that generated C treats these indices as unsigned and avoids the signed-modulo correction, then add or update coverage for the generated behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100