Skip to content
Snippets Groups Projects
Commit c38385dd authored by Jivan Hakobyan's avatar Jivan Hakobyan Committed by Jeff Law
Browse files

[RISC-V] Avoid unnecessary extensions when value is already extended

This is a minor patch from Jivan from roughly a year ago.  The basic
idea here is similar to what we do when extending values for the sake of
comparisons.  Specifically if the value is already known to be properly
extended, then an extension is just a copy.

The original idea was to use a similar patch, but which aborted to
identify cases where these unnecessary promotions where emitted.  All
that showed up when doing a testsuite run with that abort was the
promotions created by the arithmetic with overflow patterns such as addv.

Things like addv aren't *that* common so this never got high on my todo
list, even after a minor issue in this space was raised in bugzilla.

But with stage1 closing soon and no good reason not to go forward, I'm
submitting this into the pre-commit tester now.  My tester has been
using it since roughly Feb :-)  Plan would be to commit after the
pre-commit tester renders its verdict.

	* config/riscv/riscv.md (zero_extendsidi2): If RHS is already
	zero extended, then this is just a copy.
	(extendsidi2): Similarly, but for sign extension.
parent f08af081
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment