[LLVMdev] hard values in SequentialType::indexValid () method

Alireza.Moshtaghi at microchip.com Alireza.Moshtaghi at microchip.com
Tue Aug 19 16:14:14 PDT 2008

> Two options: 1) change LLVM IR to allow it, or 2) just insert sign/
> zero extension instructions.
> Does this actually affect the code being generated in practice?

Inserting sign/zero extension instructions actually do tend to increase
the generated code pretty dramatically on our target. So I prefer option

Does this change have dramatic affect on LLVM IR?

Currently (in our local code repository) we have modified the
indexValid() method to also allow i16 and so far our test cases are
going through. 
I also tried :

float *p1;
float *p3;
short i;
p1 = p2 + i;

to generate your example:

%tmp = sext i16 %idx to i32
%tmp2 = getelementptr float* %P, i32 %tmp

On x86; but the sign extension does not get eliminated while lowering
the GEP.
Maybe I understand better if you could give me a C code that shows the


More information about the llvm-dev mailing list