[LLVMdev] What does LLVM ERROR: Cannot select.. mean?

Krzysztof Parzyszek kparzysz at codeaurora.org
Tue Dec 4 11:28:55 PST 2012


On 12/4/2012 12:59 PM, Roman Kennke wrote:
>
> Thanks for the information. I found out that this is because of this
> little restriction for atomic load/store:
>
> "The type of the pointee must be an integer type whose bit width is a
> power of two greater than or equal to eight and less than or equal to a
> target-specific size limit"
> [...]
> Another little (potential) issue relating to the above restriction: how
> can I find out (programmatically) what is the "target-specific size
> limit" ? In particular, I am worried about some platforms not supporting
> 64bit atomics. Any ideas? I'd like to avoid tons of #ifdef PLATFORM
> specific code if possible.


I believe this refers to the maximum native integer size for a given 
machine.  That is specified in the data layout string, and can be 
programatically obtained by querying analysis "DataLayout".
E.g. something like

DataLayout *DL = getAnalysis<DataLayout>();
if (!DL->isLegalInteger(64/*bits*/))
   handle_integer_that_is_too_large();

-Krzysztof



-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation



More information about the llvm-dev mailing list