[PATCH] When canonicalizing gep indices, prefer zext when possible
listmail at philipreames.com
Thu Jan 29 08:21:12 PST 2015
Hi baldrick, craig.topper, sunfish, echristo, tstellarAMD,
We eagerly canonicalize gep indices to the width of a machine register (i64 on x86_64). To do so, we insert sign extensions (sext) to promote smaller types. This change substitutes zero extensions where we know the value being extended is positive. This is motivated by the fact that zero extensions are generally cheaper on x86.
Q for reviewer: Should this be behind a target hook? If so, which and how?
On a broader topic, I don't really get why we're canonicalizing this way at all. Does anyone have a strong reason why this is right approach?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 6376 bytes
Desc: not available
More information about the llvm-commits