Detect smin / umin idiom
Detects and optimise idioms like:
#define min(x, y) ((x) <= (y)) ? (x) : (y)
unsigned int foo (unsigned int i, unsigned int x ,unsigned int y)
{
return i < (min (x, y));
}
int bar (int i, int x, int y)
{
return i < (min (x, y));
}
See https:/
In addition to the backend patch it would be good to implement something similar in tree before the vectorizer kicks in allowing such loops to be vectorized.
Blueprint information
- Status:
- Complete
- Approver:
- Michael Hope
- Priority:
- Medium
- Drafter:
- Michael Hope
- Direction:
- Approved
- Assignee:
- Christophe Lyon
- Definition:
- Approved
- Series goal:
- Accepted for 4.8
- Implementation:
- Informational
- Milestone target:
- 4.8-2013.09
- Started by
- Matthew Gretton-Dann
- Completed by
- Matthew Gretton-Dann
Related branches
Related bugs
Sprints
Whiteboard
With the patch this becomes:
- cmp r2, r1
- movcs r2, r1
cmp r2, r0
+ cmpcs r1, r0
[christophe-lyon 2013-02-11]
* After generation of suitable benchmark references (i.e. a recent 4.7 revision), there is a 96.9% score in spec2k's galgel.
* The middle-end implementation is described in this blueprint: https:/
Meta:
Headline: Improve GCC's recognition of signed/unsigned minima functions
Acceptance: Patch accepted into upstream GCC and backported to GCC Linaro.
Roadmap id: CARD-304
[2013-05-29 matthew-
Work Items
Work items:
Rebase patch on current gcc-linaro-4.7: DONE
Check rebuild and testsuite are ok in cbuild: DONE
Benchmark under cbuild: DONE
Investigate regression: TODO
Investigate possible middle-end implementation: INPROGRESS
Send patch upstream: TODO
Backport to gcc-linaro: TODO