[llvm-dev] Back end with special loop instructions

Alex Susu via llvm-dev llvm-dev at lists.llvm.org
Mon May 30 15:09:37 PDT 2016

     I'm writing a back end for my research SIMD processor that has an assembly language 
that is blocked structured, with one-level loops. An example program with my assembly 
         R0 = LS[offset_A];

     The LLVM code somewhat equivalent to the above ASM program is:
         %index = phi i64 [ %index.unr, %vector.body.preheader.split.split ], [ 
%index.next.3, %vector.body ]
         %20 = getelementptr inbounds i32, i32* %A, i64 %index
         %21 = bitcast i32* %20 to <16 x i32>*
         %wide.load = load <16 x i32>, <16 x i32>* %21, align 4
         br i1 %48, label %middle.block.unr-lcssa, label %vector.body, !llvm.loop !3

     How do you suggest to attack this problem?
     I guess I need to provide custom matching code in the Select() function of the back 
end prior to the SelectCode() invocation in order to translate the label vector.body in 
LLVM/Machine Instr(DAG) before selection to a REPEAT_X_TIMES(...) instruction - are you 
aware if anybody else has done such a thing? Also, the br LLVM instruction will be 
translated to an END_REPEAT.

   Thank you,

More information about the llvm-dev mailing list