[LLVMdev] Generating target dependent function calls

Tobias Grosser grosser at fim.uni-passau.de
Wed Dec 22 10:38:06 PST 2010


Hi,

raghesh and I are working in Polly on automatically generating OpenMP 
calls. This works nicely on a 64bit architecture,
however the functions we need to generate are slightly different on 
different platforms.

The reason for the difference is that e.g "long" in

 > bool GOMP_loop_runtime_next(long, long)

has a different size on different architectures.

Currently we generate the prototypes and functions ourselves:
 > declare i8 @GOMP_loop_runtime_next(i64*, i64*) nounwind

To support a 32bit architecture we would need to generate:
 > declare i8 @GOMP_loop_runtime_next(i32*, i32*) nounwind

Has anybody an idea what's a conceptually clean way to generate OpenMP 
function calls for different architectures and best even for different 
OpenMP implementations (e.g. mpc.sf.net)

Would overloaded intrinsics be a possible approach? How could we 
model/derive the right signature for our target architecture. TargetData 
does not seem to be enough for this. Is there a better approach than 
passing this information using a command line switch?

Cheers and thanks for your help

Tobi



More information about the llvm-dev mailing list