// Structured ExecutionShape generator inputs: a finite set of exact Structured // Program references (imported llvm.func callables), each either free of any // unresolved execution-shape choice or carrying unresolved, exactly // representable llvm.intr.fmuladd operations in its own callable ownership. start: {new NFUN = random.randint(1, 3); new F = 0} funcs; funcs: (F < NFUN) function {F += 1} funcs | (F == NFUN) ''; function: {new TY = random.choice(['f32', 'f64', 'vector<4xf32>']); new NOPS = random.randint(0, 2); new I = 0; new LAST = '%arg2'; new RESIDUAL = random.choice([0, 1])} 'llvm.func @' fname '(%arg0: ' tyx ', %arg1: ' tyx ', %arg2: ' tyx ') -> ' tyx ' {\n' residual body ' llvm.return ' lastx ' : ' tyx '\n' '}\n'; fname: ['f' + str(F)]; tyx: [TY]; lastx: [LAST]; idx: [str(I)]; // A residual InstructionCore operation the ExecutionShape generator must not // rewrite: it states no unresolved execution-shape choice. residual: (RESIDUAL == 1) ' %residual = llvm.fmul %arg0, %arg1 : ' tyx '\n' | (RESIDUAL == 0) ''; body: (I < NOPS) fmuladd_op {I += 1} body | (I == NOPS) ''; fmuladd_op: {new FM = random.choice(['', ' {fastmathFlags = #llvm.fastmath}', ' {fastmathFlags = #llvm.fastmath}', ' {fastmathFlags = #llvm.fastmath}'])} ' %v' idx ' = llvm.intr.fmuladd(%arg0, %arg1, ' lastx ')' fmx ' : (' tyx ', ' tyx ', ' tyx ') -> ' tyx '\n' {LAST = '%v' + str(I)}; fmx: [FM];