[LLVMdev] ReduceLoadWidth, DAGCombiner and non 8bit loads/extloads question.

Ahmed Bougacha ahmed.bougacha at gmail.com
Wed Mar 4 11:20:52 PST 2015


On Wed, Mar 4, 2015 at 10:49 AM, Ahmed Bougacha
<ahmed.bougacha at gmail.com> wrote:
> On Wed, Mar 4, 2015 at 10:26 AM, Ryan Taylor <ryta1203 at gmail.com> wrote:
>>  Yes, it is breaking during the legalize phase, depending on which
>> TargetLowering callback method we use. For example, Custom will let it
>> through to instructions selection, which it breaks at the that phase,
>> otherwise I believe it breaks during legalization. If we use Expand instead,
>> the assert during Legalize is: "EXTLOAD should always be supported". I don't
>> really understand that message :)
>
> Keep in mind "EXTLOAD" usually means "load, possibly followed by an
> extension".  So, the "EXT" part is probably irrelevant here, if that's
> what's bugging you ;)

Nevermind, grepping around shows this is specifically about
ISD::EXTLOAD, in LegalizeLoadOps (LegalizeDAG.cpp).

There's some code above, with an "isTypeLegal(SrcVT)" check, that
tries to turn an EXTLOAD into LOAD+[SZ]EXT.  I'm guessing that on your
target, both the EXTLOAD from i8 and the i8 type are illegal?

In that case, again, I don't know how one could legalize this.

-Ahmed



More information about the llvm-dev mailing list