[llvm] 61bd33e - [BPF] explicit warning of not supporting dynamic stack allocation

Yonghong Song via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 08:28:59 PST 2020



On 2/12/20 9:10 PM, Tom Stellard wrote:
> On 02/12/2020 08:44 PM, Yonghong Song via llvm-commits wrote:
>>
>> Author: Yonghong Song
>> Date: 2020-02-12T20:43:06-08:00
>> New Revision: 61bd33e37b1d4f3feda50162ec196e5e14759686
>>
>> URL: https://github.com/llvm/llvm-project/commit/61bd33e37b1d4f3feda50162ec196e5e14759686
>> DIFF: https://github.com/llvm/llvm-project/commit/61bd33e37b1d4f3feda50162ec196e5e14759686.diff
>>
>> LOG: [BPF] explicit warning of not supporting dynamic stack allocation
>>
> 
> Is this a candidate for LLVM 10?

Thanks for asking. I think we can skip this one. Most people actually 
knows BPF do not support variable length array...

> 
> -Tom
>> Currently, BPF does not support dynamic static allocation.
>> For a program like below:
>>    extern void bar(int *);
>>    void foo(int n) {
>>      int a[n];
>>      bar(a);
>>    }
>>
>> The current error message looks like:
>>    unimplemented operand
>>    UNREACHABLE executed at /.../llvm/lib/Target/BPF/BPFISelLowering.cpp:199!
>>
>> Let us make error message explicit so it will be clear to the user
>> what is the problem. With this patch, the error message looks like:
>>    fatal error: error in backend: Unsupported dynamic stack allocation
>>    ...
>>
>> Differential Revision: https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D74521&d=DwICaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=DA8e1B5r073vIqRrFz7MRA&m=XGz311zsfgDqUNERgbKW1Jkrl-G0mRh7t0VX1Sfa4cE&s=VJ-1vSEGFcINqsFTKLWICuBbhdWyk7_03m9maVC7Kis&e=
>>
>> Added:
>>      
>>
>> Modified:
>>      llvm/lib/Target/BPF/BPFISelLowering.cpp
>>
>> Removed:
>>      
>>
>>
>> ################################################################################
>> diff  --git a/llvm/lib/Target/BPF/BPFISelLowering.cpp b/llvm/lib/Target/BPF/BPFISelLowering.cpp
>> index 799a60c6cc92..cc8a48677538 100644
>> --- a/llvm/lib/Target/BPF/BPFISelLowering.cpp
>> +++ b/llvm/lib/Target/BPF/BPFISelLowering.cpp
>> @@ -227,6 +227,8 @@ SDValue BPFTargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const {
>>       return LowerGlobalAddress(Op, DAG);
>>     case ISD::SELECT_CC:
>>       return LowerSELECT_CC(Op, DAG);
>> +  case ISD::DYNAMIC_STACKALLOC:
>> +    report_fatal_error("Unsupported dynamic stack allocation");
>>     default:
>>       llvm_unreachable("unimplemented operand");
>>     }
>>
>>
>>          
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=DwICaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=DA8e1B5r073vIqRrFz7MRA&m=XGz311zsfgDqUNERgbKW1Jkrl-G0mRh7t0VX1Sfa4cE&s=5EDXgLY-QK2NLR7lCOeBYLTUn0uqdvPk4GuB-joQOZ0&e=
>>
> 


More information about the llvm-commits mailing list