[ 
https://issues.apache.org/jira/browse/ARROW-15678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17613909#comment-17613909
 ] 

Kouhei Sutou commented on ARROW-15678:
--------------------------------------

Summary of this problem:

Problem:

* Parquet module is crashed with {{-DCMAKE_BUILD_TYPE=MinSizeRel}}

Why the problem is happened:

* We compile the same code ({{level_conversion_inc.h}}) multiple times with 
different optimization flags such as {{-msse4.2}} and {{-mavx2}}
* The code calls the same function 
({{arrow::internal::FirstTimeBitmapWriter::AppendWord()}}) that is defined in 
header file
* The called function isn't inlined with {{-DCMAKE_BUILD_TYPE=MinSizeRel}}
* It generates multiple definitions for the called (not-inlined) function 
({{arrow::internal::FirstTimeBitmapWriter::AppendWord()}})

Proposed solutions so far:

# Force to inline functions that are called from the code that are compiled 
with SIMD related optimization flags
# Restrict SIMD related optimization area to only the target function

For 1., we have two approaches for it:
* Use template:
** 
https://issues.apache.org/jira/browse/ARROW-15678?focusedCommentId=17524280&#comment-17524280
 : It's used in our compute module
** 
https://issues.apache.org/jira/browse/ARROW-15678?focusedCommentId=17539142&#comment-17539142
 : A patch for this case
* Use {{\_\_attribute\_\_((always\_inline))}}
** https://github.com/apache/arrow/pull/12928#issuecomment-1104621952

This approach seems ad-hoc. We need to apply this approach to called functions 
when we find this problem in other codes.

For 2., we have one approach for it:
* Use {{target}} attribute:
** 
https://issues.apache.org/jira/browse/ARROW-15678?focusedCommentId=17526053#comment-17526053
 : A sample code that shows this approach

(I'm not sure that this approach is portable. For example, can we use this 
approach with MSVC?) 

> [C++][CI] a crossbow job with MinRelSize enabled
> ------------------------------------------------
>
>                 Key: ARROW-15678
>                 URL: https://issues.apache.org/jira/browse/ARROW-15678
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++, Continuous Integration
>            Reporter: Jonathan Keane
>            Assignee: Kouhei Sutou
>            Priority: Blocker
>              Labels: pull-request-available
>             Fix For: 10.0.0
>
>          Time Spent: 13.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to