[LLVMdev] Modeling 16-bit pointer registers for an 8-bit target
eli.friedman at gmail.com
Thu Aug 7 17:14:07 PDT 2008
On Thu, Aug 7, 2008 at 9:45 AM, <Sanjiv.Gupta at microchip.com> wrote:
> Hmmm...That means we have to make i16 as a legal type (since
> GlobalAddresses are 16-bits) and custom lower all 16-bit operations to
> 8-bit operations. I was thinking to take advantage of the already
> present ExpandOp infrastructure.
You're likely to have much better luck with unusual stuff using the
LegalizeTypes infrastructure; pass -enable-legalize-types to llc to
enable it. It's not enabled yet because it still causes some
regressions, but the plan is to enable it at some point. With
LegalizeTypes, you can custom-legalize an operation in an illegal type
by just marking it custom and overriding ReplaceNodeResults in your
target; see X86TargetLowering::ExpandREADCYCLECOUNTER for an example.
More information about the llvm-dev