[LLVMdev] Alias in LLVM 3.0

Relph, Richard Richard.Relph at amd.com
Tue Feb 28 09:13:29 PST 2012

The calls are in a separate module from the definition and alias, and both modules pass the verifier separately.
When they are linked together, the linker (in the case we're discussing here) seems to insert type conversions to get the 2xfloat to match the 2xi32 going in, and then conversions from the 2xi32 coming back to the 2xfloat expected.
These conversions used to be bitcasts (probably implicit, maybe magical ;-).


-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Duncan Sands
Sent: Tuesday, February 28, 2012 2:45 AM
To: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] Alias in LLVM 3.0

Hi Richard,

> In LLVM 2.9 and LLVM 3.0, our front-end generates:
> @__shuffle_2f32_2u32 = alias weak <2 x i32> (<2 x i32>, <2 x i32>)* @4
> And the calls, before linking, look like:
> %call9 = call <2 x float> @__shuffle_2f32_2u32(<2 x float> %tmp7, <2 x 
> i32>
> %tmp8) nounwind

I don't see how this is possible - it should be rejected by the verifier.
Given the above definition of @__shuffle_2f32_2u32, its type is
<2 x i32> (<2 x i32>, <2 x i32>)*.  It should therefore not be possible to call it with <2 x float> arguments since that represents a type mismatch.

Does your IR pass the verifier?

Ciao, Duncan.
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu

More information about the llvm-dev mailing list