[llvm-dev] Unaligned atomic load/store

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Sat Aug 26 05:52:51 PDT 2017


On Sat, Aug 26, 2017 at 08:31:30PM +0800, Dr. ERDI Gergo via llvm-dev wrote:
> This trips up the following assertion in CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:
> 
>   if (I.getAlignment() < VT.getSizeInBits() / 8)
>     report_fatal_error("Cannot generate unaligned atomic load");
> 
> 
> I've tried commenting out the check and llc finishes, generating
> not-obviously-wrong machine code, so there doesn't seem to be anything
> further downstream breaking because of this.
> 
> So my questions are:
> 
> * What is the purpose of this assertion?

Existing targets so far simply don't support unaliged atomic ops. That's
why it hasn't been refactored into a target information hook.

Joerg


More information about the llvm-dev mailing list