Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbbHEHLY (ORCPT ); Wed, 5 Aug 2015 03:11:24 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:36289 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751818AbbHEHLW (ORCPT ); Wed, 5 Aug 2015 03:11:22 -0400 Subject: Re: [LLVMdev] Cc llvmdev: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event To: "Wangnan (F)" , He Kuang , pi3orama References: <1436522587-136825-1-git-send-email-hekuang@huawei.com> <1436522587-136825-4-git-send-email-hekuang@huawei.com> <55A042DC.6030809@plumgrid.com> <55A3404B.6020904@huawei.com> <20150713135223.GB9917@danjae.kornet> <4D441676-21A7-46EE-AAB0-EB529D408082@163.com> <20150713140915.GD9917@danjae.kornet> <55A46928.9090708@plumgrid.com> <55A4F869.1020705@huawei.com> <55A88085.8090407@plumgrid.com> <55A88137.7020609@huawei.com> <55A88449.3030008@plumgrid.com> <55B0D5FC.6050406@huawei.com> <55B1535E.8090406@plumgrid.com> <55B1AEE9.1080207@plumgrid.com> <55B1BC03.9020708@huawei.com> <55B35F42.70803@huawei.com> <55B6E685.30905@plumgrid.com> <55B89F04.5030304@huawei.com> <55B909B2.2080606@plumgrid.com> <55BB4B8A.5000207@huawei.com> <55BFC4A0.9060100@plumgrid.com> <55C07F5B.6030107@huawei.com> <55C16DC7.70408@huawei.com> <55C16F53.3070604@huawei.com> <55C1B254.5030801@huawei.com> Cc: llvm-dev@lists.llvm.org, "linux-kernel@vger.kernel.org" From: Alexei Starovoitov Message-ID: <55C1B717.60501@plumgrid.com> Date: Wed, 5 Aug 2015 00:11:19 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55C1B254.5030801@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1198 Lines: 39 On 8/4/15 11:51 PM, Wangnan (F) wrote: > void bpf_store_half(void *skb, int off, int val) > asm("llvm.bpf.store.half"); > int func() > { > bpf_store_half(0, 0, 0); > return 0; > } > > Compiled with: > > $ clang -g -target bpf -O2 -S -c test.c > > And get this: > > .text > .globl func > .align 8 > func: # @func > # BB#0: # %entry > mov r1, 0 > mov r2, 0 > mov r3, 0 > call llvm.bpf.store.half it didn't work because number and types of args were incompatible. Every samples/bpf/sockex[0-9]_kern.c is using llvm.bpf.load.* intrinsics. the typeid changing ids with order is surprising. I think the assertion in ExtractTypeInfo() is not hard. Just there were no such use cases. May be we can do something similar to what LowerIntrinsicCall() does and lower it differently in the backend. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/