[LLVMdev] Help with Instruction Expansion on Mips

Geraint Yang geraint0923 at gmail.com
Fri Jul 20 03:05:21 PDT 2012


Hi everyone,

I am a newbie to LLVM. I am trying to ban some of instructions in Mips
Instruction, for example, lh, lhu, sh, and etc.
I have tried to directly comment lh, lhu, and sh to make llvm not to choose
these instruction when compiling, however, it usually cause a 'can not
select ...' error when using 'short' data type in source code.
Then I tried to expand these instructions in EmitInstrWithCustomInserter in
file lib/Target/Mips/MipsISelLowering.cpp, just as commit in:

https://github.com/geraint0923/LLVM-ThuMips/commit/6a9ca907f3e945c2bb1f9627e0e5fdcbd7964da2

It works fine for lh and lhu, and fails for sh:
when expanding sh, there are four instruction, but in *.s generated by
modified llvm's llc, there are only two instructions which are both sb,
addiu and srl are gone.

Is there anything wrong when expanding?
And I wonder if there is another method to do the same thing.

Any help will be appreciated.


Thanks,
Yang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120720/070b15d9/attachment.html>


More information about the llvm-dev mailing list