[llvm-dev] Subject: How to define vector element type bool in builtin function

liuyu11@ict.ac.cn via llvm-dev llvm-dev at lists.llvm.org
Sat Apr 21 19:47:03 PDT 2018


Subject: How to define vector element type  bool  in builtin function
hello everyone,I have defined  intrinsic function like this:
def int_mips_add_32 : GCCBuiltin<"__builtin_dongxin_add_32">, Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,llvm_v8i1_ty]>;

Then I write a test code :
typedef int v4i32  __attribute__ ((vector_size(16)));
typedef bool v8i1  __attribute__ ((vector_size(1)));

void foo() {
  v4i32 v4i32_r1,v4i32_r2,v4i32_r3;
  v8i1 vm_1;
  v4i32_r1 = __builtin_dongxin_add_32(v4i32_r2,v4i32_r2,vm_1);
}
          
but when I compile :  clang -cc1  -triple mipsel-unknown-linux-gnu -emit-llvm  intrinstest.c -o test.ll
I got the error:
intrinstest.c:4:9: error: unknown type name 'bool'
typedef bool v8i1  __attribute__ ((vector_size(1)));
        ^
intrinstest.c:4:36: error: vector size not an integral multiple of component size
typedef bool v8i1  __attribute__ ((vector_size(1)));
                                   ^           ~
intrinstest.c:9:57: error: passing 'v8i1' (aka 'int') to parameter of incompatible type '__attribute__((__vector_size__(8 * sizeof(_Bool)))) _Bool' (vector of 8 '_Bool' values)
  v4i32_r1 = __builtin_dongxin_add_32(v4i32_r2,v4i32_r2,vm_1);

I really do not know how to define a vector type whose element type is bool  .Appreciate for your help


liuyu11 at ict.ac.cn
 
From: via llvm-dev
Date: 2018-04-22 03:00
To: llvm-dev
Subject: llvm-dev Digest, Vol 166, Issue 63
Send llvm-dev mailing list submissions to
llvm-dev at lists.llvm.org
 
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
or, via email, send a message with subject or body 'help' to
llvm-dev-request at lists.llvm.org
 
You can reach the person managing the list at
llvm-dev-owner at lists.llvm.org
 
When replying, please edit your Subject line so it is more specific
than "Re: Contents of llvm-dev digest..."
 
 
Today's Topics:
 
   1. Re: [RFC] Turn the MachineOutliner on by default in AArch64
      under -Oz (Jon Chesterfield via llvm-dev)
   2. How to add/use parameter attributes? Troubles with "byval"
      (edA-qa mort-ora-y via llvm-dev)
   3. Re: [Release-testers] LLVM 5.0.2-rc2 has been tagged
      (Sylvestre Ledru via llvm-dev)
 
 
----------------------------------------------------------------------
 
Message: 1
Date: Sat, 21 Apr 2018 03:33:29 +0100
From: Jon Chesterfield via llvm-dev <llvm-dev at lists.llvm.org>
To: llvm-dev <llvm-dev at lists.llvm.org>,
llvm-dev-request at lists.llvm.org
Subject: Re: [llvm-dev] [RFC] Turn the MachineOutliner on by default
in AArch64 under -Oz
Message-ID:
<CAOUYtQB1zR-5m_7fnJf7diyZoZJby1kkhwYmtGVOwT52ttEwUQ at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
 
Teaching the back end about size optimization sounds great, even without
the exciting work on MachineOutliner. It would strip some nasty hacks from
an out of tree back end that cares about code size :)
 
Thank you
 
 
> The first patch is one that teaches the backend about size optimization
> levels. This is comparable to what's done in the inliner. Today, the only
> way to tell if something is optimizing for size is by looking at function
> attributes. This is fine for function passes, but insufficient for module
> passes like the MachineOutliner. The function attribute approach forces the
> outliner to iterate over every function in the module before deciding to
> take action. If -Oz isn't passed in, then the outliner will not find any
> functions worth outlining from. This would incur unnecessary compile-time
> overhead. Thus, we decided the best course of action is to teach the
> backend about size options.
>
> The second patch teaches llc to handle -Oz and -Os.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180421/bdb8b423/attachment-0001.html>
 
------------------------------
 
Message: 2
Date: Sat, 21 Apr 2018 19:01:15 +0200
From: edA-qa mort-ora-y via llvm-dev <llvm-dev at lists.llvm.org>
To: LLVM Developers Mailing List <llvm-dev at lists.llvm.org>
Subject: [llvm-dev] How to add/use parameter attributes? Troubles with
"byval"
Message-ID: <4643e384-6ce5-5095-2ebd-fa6244e0d7be at disemia.com>
Content-Type: text/plain; charset=utf-8
 
I'm unable to figure out how IR attributes can be added via the C++ API.
I need to create a function like this:
 
    %1 = call i64 @abi_call_test_tuple_2p(%struct.abi_tuple_2p* byval
align 8 %v)
 
Where a structure is being passed by value. I need to add the `byval`
attribute somewhere (I'm not clear if this is on the function arguments
or the type).
 
I'm also uncertain of why that results in a different calling convention
than just:
 
    %1 = call i64 @abi_call_test_tuple_2p(%":abi_tuple_2" %0)
 
Does this not also pass the same structure by-value to the function? 
(It doesn't yield the same results it appears).
 
-- 
edA-qa mort-ora-y  
http://mortoray.com/
 
Creator of the Leaf language
http://leaflang.org/
 
Streaming algorithms, AI, and design on Twitch
https://www.twitch.tv/mortoray
 
Twitter
edaqa
 
 
 
------------------------------
 
Message: 3
Date: Sat, 21 Apr 2018 09:28:53 +0200
From: Sylvestre Ledru via llvm-dev <llvm-dev at lists.llvm.org>
To: tstellar at redhat.com, Release-testers
<release-testers at lists.llvm.org>, llvm-dev <llvm-dev at lists.llvm.org>,
cfe-dev <cfe-dev at lists.llvm.org>
Subject: Re: [llvm-dev] [Release-testers] LLVM 5.0.2-rc2 has been
tagged
Message-ID: <296964ac-bef0-7e3d-0650-abcbbfa75d77 at debian.org>
Content-Type: text/plain; charset=utf-8
 
 
Le 20/04/2018 à 18:29, Tom Stellard via Release-testers a écrit :
> On 03/29/2018 08:09 PM, Tom Stellard via Release-testers wrote:
>> Hi,
>>
>> I've fixed the version numbering and tagged 5.0.2-rc2.  Testers can
>> begin testing.
>>
> So far, I've only received 5.0.2-rc2 binaries from 2 testers.  I am
> guessing this is due to the mix up with -rc1 and the fact that we don't
> normally do X.Y.2 releases.
 
I uploaded rc1 immediately (with the version fix) and didn't find any issue!
 
Cheers,
Sylvestre
 
 
 
 
------------------------------
 
Subject: Digest Footer
 
_______________________________________________
llvm-dev mailing list
llvm-dev at lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
 
 
------------------------------
 
End of llvm-dev Digest, Vol 166, Issue 63
*****************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180422/aea37179/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bg.jpg
Type: image/jpeg
Size: 25008 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180422/aea37179/attachment.jpg>


More information about the llvm-dev mailing list