Dan Gohman
2012-Aug-14 21:22 UTC
[LLVMdev] Load serialisation during selection DAG building
On Aug 14, 2012, at 2:05 PM, Steve Montgomery <stephen.montgomery3 at btinternet.com> wrote:> Further to my earlier question, I'm perhaps a bit confused about memory serialisation. The following example, compiled using clang for the MSP430: > > target datalayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:16:32-n8:16" > target triple = "msp430-??-??" > > @y = common global i16 0, align 2 > @x = common global i16 0, align 2 > > define void @f() nounwind { > entry: > %0 = load i16* @y, align 2, !tbaa !0 > %1 = load volatile i16* @x, align 2, !tbaa !0 > %add = add i16 %1, %0 > store i16 %add, i16* @y, align 2, !tbaa !0 > ret void > } > > has a chain store->load volatile->load. I thought this meant that the load volatile had to occur _after_ the load but the MSP430 backend selects the ADD16mm instruction for which I suspect the order of operand access isn't specified. So, does the chain mean "no earlier than" rather than "later than"?No, a chain is supposed to mean "later than". It sounds like MSP430 is bending the rules here. Dan
Anton Korobeynikov
2012-Aug-14 23:03 UTC
[LLVMdev] Load serialisation during selection DAG building
> No, a chain is supposed to mean "later than". It sounds like MSP430 is bending > the rules here.The instruction selector for ADD16mm is autogenerated, so, this is not MSP430 bug alone :) This is just the single target in the tree which has mem-mem instructions. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Steve Montgomery
2012-Aug-15 07:40 UTC
[LLVMdev] Load serialisation during selection DAG building
OK, I guess the problem is in HandleMergeInputChains() or maybe SelectCodeCommon() so should I file a bug report against SelectionDAGISel.cpp? On 15 Aug 2012, at 00:03, Anton Korobeynikov wrote:>> No, a chain is supposed to mean "later than". It sounds like MSP430 is bending >> the rules here. > The instruction selector for ADD16mm is autogenerated, so, this is not > MSP430 bug alone :) > This is just the single target in the tree which has mem-mem instructions. > > -- > With best regards, Anton Korobeynikov > Faculty of Mathematics and Mechanics, Saint Petersburg State University
Apparently Analagous Threads
- [LLVMdev] Load serialisation during selection DAG building
- [LLVMdev] Load serialisation during selection DAG building
- [LLVMdev] Load serialisation during selection DAG building
- [LLVMdev] Proposed SelectionDAGBuilder patch - load serialisation
- [LLVMdev] Out of tree targets