Shore
Shore

Reputation: 1033

How to use LLVM framework to make a compiler that targeting to different architecture

say I have a piece of code like following

int func1(int a, int b, int c)
{
    int ret = 0;
    for(int i = 0; i < r1; ++i) {
        for(int j = 0; j < c2; ++j) {
            for(int k = 0; k < c1; ++k) {
                ...
            }
        }
    }
    return ret;
}

I would like a compiler to compile the for loop into a special architecture on a slave chip, and all others on master chip's architecture.

I'm new to llvm and do not know how to do it. Thus I would like to ask what is the correct way of doing this with LLVM??

Thanks a lot!!

Upvotes: 0

Views: 25

Answers (0)

Related Questions