[llvm-dev] Problem with Aarch64 ?

Somenath Chakraborty via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 7 10:32:02 PDT 2016


Hello,

I am facing an issue with a small test where there is a chance that
sign-extension is not introduced as expected -

#include <stdio.h>

void func( long x )
{
    printf(" %ld \n", x);
}

int main()
{
    char c = -1;
    func ( c );  // c is zero extended to x
    return 0;
}

generated IR -

define i32 @main() #0 {
 ........
  store i8 -1, i8* %c, align 1
  %2 = load i8, i8* %c, align 1
*  %3 = zext i8 %2 to i64*
  call void @func(i64 %3)
}

The value to the formal argument is zero-extended, different from x86_64.
Is this a known issue ? Am I missing anything ?

Thanks,
Somenath
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160907/a0bd78ac/attachment.html>


More information about the llvm-dev mailing list