Remove Unnecessary Zero/Sign Extensions

Registered by Matthew Gretton-Dann

Investigate and develop a new pass for GCC which removes unnecessary zero/sign extensions.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Medium
Drafter:
Matthew Gretton-Dann
Direction:
Needs approval
Assignee:
Kugan Vivekanandarajah
Definition:
Discussion
Series goal:
Accepted for 4.7
Implementation:
Informational Informational
Milestone target:
milestone icon backlog

Related branches

Sprints

Whiteboard

The aim of this blueprint is to investigate and develop removal of unecessary sign/zero extensions. We have come across several instances of this recently (bswap generation and https://wiki.linaro.org/MichaelHope/Sandbox/CRC16). Phases doing this have been proposed upstream (see http://gcc.gnu.org/ml/gcc/2012-10/msg00021.html)

Some initial investigation seems to suggest there are several areas of work that could be beneficial:
 * Using ree.c (or a rewritten version) and extending it to recognise code sequences that are 'equivalent' to zero/sign extensions.
 * Stop handling promotion mode in the target backend (see https://code.launchpad.net/~ramana/gcc-linaro/47-nobble-promote-mode/+merge/107593)
 * Change code gen not to generate andsi3 patterns for zero extensions, but instead use the extendsiqi pattern.

[2013-05-28 matthew-gretton-dann] This is TCWG-14 and TCWG-15

(?)

Work Items

Work items:
Investigate nobble-promote-merge patch impact: TODO
Investigate & Rework RTL generation in compiler of andsi patterns and translate them to extendsiqi patterns: TODO
Investigate updates required to ree phase: TODO
Update REE phase: TODO
Test: TODO
Document: TODO

This blueprint contains Public information 
Everyone can see this information.