source: icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.cpp @ 4942

Last change on this file since 4942 was 4942, checked in by lindanl, 3 years ago

Remove simd-lib. Print register implemented in LLVM IR.

File size: 20.7 KB
Line 
1/*
2 *  Copyright (c) 2014-15 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#include <pablo/pablo_compiler.h>
8#include <pablo/codegenstate.h>
9#include <pablo/carry_data.h>
10#include <pablo/carry_manager.h>
11#include <pablo/printer_pablos.h>
12#include <pablo/function.h>
13#include <re/re_name.h>
14#include <stdexcept>
15#include <sstream>
16#include <IDISA/idisa_builder.h>
17#include <IDISA/idisa_avx_builder.h>
18#include <llvm/Pass.h>
19#include <llvm/PassManager.h>
20#include <llvm/ADT/SmallVector.h>
21#include <llvm/Analysis/Passes.h>
22#include <llvm/IR/BasicBlock.h>
23#include <llvm/IR/CallingConv.h>
24#include <llvm/IR/DataLayout.h>
25#include <llvm/IR/DerivedTypes.h>
26#include <llvm/IR/Function.h>
27#include <llvm/IR/GlobalVariable.h>
28#include <llvm/IR/InlineAsm.h>
29#include <llvm/IR/Instructions.h>
30#include <llvm/IR/LLVMContext.h>
31#include <llvm/IR/Module.h>
32#include <llvm/Support/FormattedStream.h>
33#include <llvm/Support/MathExtras.h>
34#include <llvm/Support/Casting.h>
35#include <llvm/Support/Compiler.h>
36#include <llvm/Support/Debug.h>
37#include <llvm/Support/TargetSelect.h>
38#include <llvm/Support/Host.h>
39#include <llvm/Transforms/Scalar.h>
40#include <llvm/IRReader/IRReader.h>
41#include <llvm/Bitcode/ReaderWriter.h>
42#include <llvm/Support/MemoryBuffer.h>
43#include <llvm/IR/IRBuilder.h>
44#include <llvm/Support/CommandLine.h>
45#include <llvm/ADT/Twine.h>
46#include <iostream>
47#include <llvm/Support/raw_ostream.h>
48#include <llvm/Support/FileSystem.h>
49#ifndef NDEBUG
50#include <llvm/IR/Verifier.h>
51#endif
52
53//#include <llvm/PassManager.h>
54//#include <llvm/Transforms/IPO/PassManagerBuilder.h>
55
56#include <hrtime.h>
57
58static cl::OptionCategory eIRDumpOptions("LLVM IR Dump Options", "These options control dumping of LLVM IR.");
59static cl::opt<bool> DumpGeneratedIR("dump-generated-IR", cl::init(false), cl::desc("Print LLVM IR generated by Pablo Compiler."), cl::cat(eIRDumpOptions));
60static cl::opt<std::string> IROutputFilename("dump-generated-IR-output", cl::init(""), cl::desc("output IR filename"), cl::cat(eIRDumpOptions));
61
62
63static cl::OptionCategory fTracingOptions("Run-time Tracing Options", "These options control execution traces.");
64static cl::opt<bool> DumpTrace("dump-trace", cl::init(false), cl::desc("Generate dynamic traces of executed assignments."), cl::cat(fTracingOptions));
65
66namespace pablo {
67
68PabloCompiler::PabloCompiler(Module * m, IDISA::IDISA_Builder * b)
69: mMod(m)
70, iBuilder(b)
71, mBitBlockType(b->getBitBlockType())
72, mCarryManager(nullptr)
73, mInputType(nullptr)
74, mKBuilder(nullptr)
75, mWhileDepth(0)
76, mIfDepth(0)
77, mFunction(nullptr)
78, mInputAddressPtr(nullptr)
79, mOutputAddressPtr(nullptr)
80, mMaxWhileDepth(0)
81, mFilePosIdx(2) {
82   
83}
84
85PabloCompiler::~PabloCompiler() {
86}
87 
88void PabloCompiler::setKernel(KernelBuilder * kBuilder){
89    mKBuilder = kBuilder;   
90} 
91
92llvm::Function * PabloCompiler::compile(PabloFunction * function) {
93
94    #ifdef PRINT_TIMING_INFORMATION
95    const timestamp_t pablo_compilation_start = read_cycle_counter();
96    #endif
97 
98    PabloBlock * const mainScope = function->getEntryBlock();
99
100    mainScope->enumerateScopes(0);
101   
102    Examine(*function);
103
104    mCarryManager = new CarryManager(iBuilder);
105
106    GenerateKernel(mainScope, function);
107       
108    delete mCarryManager;
109    mCarryManager = nullptr;
110   
111    #ifdef PRINT_TIMING_INFORMATION
112    const timestamp_t pablo_compilation_end = read_cycle_counter();
113    std::cerr << "PABLO COMPILATION TIME: " << (pablo_compilation_end - pablo_compilation_start) << std::endl;
114    #endif
115
116
117    if (LLVM_UNLIKELY(DumpGeneratedIR)) {
118
119        if (IROutputFilename.empty()) {
120            mMod->dump();
121        } else {
122            std::error_code error;
123            llvm::raw_fd_ostream out(IROutputFilename, error, sys::fs::OpenFlags::F_None);
124            mMod->print(out, nullptr);
125        }
126    }
127
128    #ifndef NDEBUG
129    raw_os_ostream err(std::cerr);
130    verifyModule(*mMod, &err);
131    #endif
132
133    return mFunction;
134}
135
136inline void PabloCompiler::GenerateKernel(PabloBlock * mainScope, PabloFunction * function) {
137 
138    for(int i=0; i<8; i++){
139        mKBuilder->addKernelInputStream(1, "basis_bits");
140    }
141    mKBuilder->addKernelOutputStream(1);
142    mKBuilder->addKernelOutputStream(1);
143
144    mCarryManager->initialize(mainScope, mKBuilder);
145 
146    int segBlocks = mKBuilder->getSegmentBlocks();
147    mKBuilder->PrepareDoBlockFunction();
148    struct Inputs inputs = mKBuilder->openDoBlock();
149    struct Outputs outputs;
150    mFunction = mKBuilder->getDoBlockFunction();
151
152    mCarryManager->initialize_setPtrs(mKBuilder);
153
154    valptr results[segBlocks][2];
155    for(int j=0; j<segBlocks; j++){     
156        for(int i=0; i<inputs.streams[j].size(); i++){
157            mMarkerMap[function->getParameter(i)] = inputs.streams[j][i];
158        }
159
160        compileBlock(mainScope);
161
162        Value * filePos = iBuilder->CreateAdd(mKBuilder->getKernelInternalState(mFilePosIdx), iBuilder->getInt64(iBuilder->getBitBlockWidth()));
163        mKBuilder->changeKernelInternalState(mFilePosIdx, filePos);
164
165        mCarryManager->set_BlockNo(mKBuilder);
166
167        results[j][0] = mMarkerMap[function->getResult(0)];
168        results[j][1] = mMarkerMap[function->getResult(1)];
169        outputs.streams.push_back(results[j]);
170    }   
171
172    mKBuilder->closeDoBlock(outputs);
173    mKBuilder->finalizeMethods();
174}
175
176inline void PabloCompiler::GenerateFunction(PabloFunction & function) {
177    mInputType = PointerType::get(StructType::get(mMod->getContext(), std::vector<Type *>(function.getNumOfParameters(), mBitBlockType)), 0);
178    Type * outputType = PointerType::get(StructType::get(mMod->getContext(), std::vector<Type *>(function.getNumOfResults(), mBitBlockType)), 0);
179    FunctionType * functionType = FunctionType::get(Type::getVoidTy(mMod->getContext()), std::vector<Type *>({mInputType, outputType}), false);
180
181
182    //Starts on process_block
183    SmallVector<AttributeSet, 3> Attrs;
184    Attrs.push_back(AttributeSet::get(mMod->getContext(), ~0U, std::vector<Attribute::AttrKind>({ Attribute::NoUnwind, Attribute::UWTable })));
185    Attrs.push_back(AttributeSet::get(mMod->getContext(), 1U, std::vector<Attribute::AttrKind>({ Attribute::ReadOnly, Attribute::NoCapture })));
186    Attrs.push_back(AttributeSet::get(mMod->getContext(), 2U, std::vector<Attribute::AttrKind>({ Attribute::ReadNone, Attribute::NoCapture })));
187    AttributeSet AttrSet = AttributeSet::get(mMod->getContext(), Attrs);
188
189    // Create the function that will be generated.
190    mFunction = Function::Create(functionType, GlobalValue::ExternalLinkage, function.getName()->value(), mMod);
191    mFunction->setCallingConv(CallingConv::C);
192    mFunction->setAttributes(AttrSet);
193
194    Function::arg_iterator args = mFunction->arg_begin();
195    mInputAddressPtr = args++;
196    mInputAddressPtr->setName("input");
197    mOutputAddressPtr = args++;
198    mOutputAddressPtr->setName("output");
199}
200
201inline void PabloCompiler::Examine(PabloFunction & function) {
202    mWhileDepth = 0;
203    mIfDepth = 0;
204    mMaxWhileDepth = 0;
205    Examine(function.getEntryBlock());
206    if (LLVM_UNLIKELY(mWhileDepth != 0 || mIfDepth != 0)) {
207        throw std::runtime_error("Malformed Pablo AST: Unbalanced If or While nesting depth!");
208    }
209}
210
211
212void PabloCompiler::Examine(PabloBlock * block) {
213    for (Statement * stmt : *block) {
214        if (If * ifStatement = dyn_cast<If>(stmt)) {
215            Examine(ifStatement->getBody());
216        }
217        else if (While * whileStatement = dyn_cast<While>(stmt)) {
218            mMaxWhileDepth = std::max(mMaxWhileDepth, ++mWhileDepth);
219            Examine(whileStatement->getBody());
220            --mWhileDepth;
221        }
222    }
223}
224
225void PabloCompiler::compileBlock(PabloBlock * block) {
226    mPabloBlock = block;
227    for (const Statement * statement : *block) {
228        compileStatement(statement);
229    }
230    mPabloBlock = block->getParent();
231}
232
233void PabloCompiler::compileIf(const If * ifStatement) {       
234    //
235    //  The If-ElseZero stmt:
236    //  if <predicate:expr> then <body:stmt>* elsezero <defined:var>* endif
237    //  If the value of the predicate is nonzero, then determine the values of variables
238    //  <var>* by executing the given statements.  Otherwise, the value of the
239    //  variables are all zero.  Requirements: (a) no variable that is defined within
240    //  the body of the if may be accessed outside unless it is explicitly
241    //  listed in the variable list, (b) every variable in the defined list receives
242    //  a value within the body, and (c) the logical consequence of executing
243    //  the statements in the event that the predicate is zero is that the
244    //  values of all defined variables indeed work out to be 0.
245    //
246    //  Simple Implementation with Phi nodes:  a phi node in the if exit block
247    //  is inserted for each variable in the defined variable list.  It receives
248    //  a zero value from the ifentry block and the defined value from the if
249    //  body.
250    //
251
252    BasicBlock * const ifEntryBlock = iBuilder->GetInsertBlock();
253    BasicBlock * const ifBodyBlock = BasicBlock::Create(mMod->getContext(), "if.body", mFunction, 0);
254    BasicBlock * const ifEndBlock = BasicBlock::Create(mMod->getContext(), "if.end", mFunction, 0);
255   
256    PabloBlock * ifBody = ifStatement->getBody();
257   
258    Value * const condition = compileExpression(ifStatement->getCondition());
259   
260    mCarryManager->enterScope(ifBody);
261    iBuilder->CreateCondBr(mCarryManager->generateSummaryTest(condition), ifBodyBlock, ifEndBlock);
262   
263    // Entry processing is complete, now handle the body of the if.
264    iBuilder->SetInsertPoint(ifBodyBlock);
265   
266    compileBlock(ifBody);
267    BasicBlock * ifExitBlock = iBuilder->GetInsertBlock();
268
269    if (mCarryManager->hasCarries()) {
270        mCarryManager->storeCarryOutSummary();
271    }
272    mCarryManager->addOuterSummaryToNestedSummary();
273
274    iBuilder->CreateBr(ifEndBlock);
275    //End Block
276    iBuilder->SetInsertPoint(ifEndBlock);
277    for (const PabloAST * node : ifStatement->getDefined()) {
278        const Assign * assign = cast<Assign>(node);
279        PHINode * phi = iBuilder->CreatePHI(mBitBlockType, 2, assign->getName()->value());
280        auto f = mMarkerMap.find(assign);
281        assert (f != mMarkerMap.end());
282        phi->addIncoming(iBuilder->allZeroes(), ifEntryBlock);
283        phi->addIncoming(f->second, ifExitBlock);
284        mMarkerMap[assign] = phi;
285    }
286    // Create the phi Node for the summary variable, if needed.
287    mCarryManager->buildCarryDataPhisAfterIfBody(ifEntryBlock, ifExitBlock);
288    mCarryManager->leaveScope();
289}
290
291void PabloCompiler::compileWhile(const While * whileStatement) {
292
293    PabloBlock * const whileBody = whileStatement->getBody();
294   
295    BasicBlock * whileEntryBlock = iBuilder->GetInsertBlock();
296    BasicBlock * whileBodyBlock = BasicBlock::Create(mMod->getContext(), "while.body", mFunction, 0);
297    BasicBlock * whileEndBlock = BasicBlock::Create(mMod->getContext(), "while.end", mFunction, 0);
298
299    mCarryManager->enterScope(whileBody);
300    mCarryManager->ensureCarriesLoadedRecursive();
301
302    const auto & nextNodes = whileStatement->getVariants();
303    std::vector<PHINode *> nextPhis;
304    nextPhis.reserve(nextNodes.size());
305
306    // On entry to the while structure, proceed to execute the first iteration
307    // of the loop body unconditionally.   The while condition is tested at the end of
308    // the loop.
309
310    iBuilder->CreateBr(whileBodyBlock);
311    iBuilder->SetInsertPoint(whileBodyBlock);
312
313    //
314    // There are 3 sets of Phi nodes for the while loop.
315    // (1) Carry-ins: (a) incoming carry data first iterations, (b) zero thereafter
316    // (2) Carry-out accumulators: (a) zero first iteration, (b) |= carry-out of each iteration
317    // (3) Next nodes: (a) values set up before loop, (b) modified values calculated in loop.
318
319    mCarryManager->initializeWhileEntryCarryDataPhis(whileEntryBlock);
320
321    // for any Next nodes in the loop body, initialize to (a) pre-loop value.
322    for (const Next * n : nextNodes) {
323        PHINode * phi = iBuilder->CreatePHI(mBitBlockType, 2, n->getName()->value());
324        auto f = mMarkerMap.find(n->getInitial());
325        assert (f != mMarkerMap.end());
326        phi->addIncoming(f->second, whileEntryBlock);
327        mMarkerMap[n->getInitial()] = phi;
328        nextPhis.push_back(phi);
329    }
330
331    //
332    // Now compile the loop body proper.  Carry-out accumulated values
333    // and iterated values of Next nodes will be computed.
334    ++mWhileDepth;
335    compileBlock(whileBody);
336
337    BasicBlock * whileExitBlock = iBuilder->GetInsertBlock();
338
339    if (mCarryManager->hasCarries()) {
340        mCarryManager->storeCarryOutSummary();
341    }
342    mCarryManager->finalizeWhileBlockCarryDataPhis(whileExitBlock);
343
344    // Terminate the while loop body with a conditional branch back.
345    iBuilder->CreateCondBr(iBuilder->bitblock_any(compileExpression(whileStatement->getCondition())), whileBodyBlock, whileEndBlock);
346
347    // and for any Next nodes in the loop body
348    for (unsigned i = 0; i < nextNodes.size(); i++) {
349        const Next * n = nextNodes[i];
350        auto f = mMarkerMap.find(n->getExpr());
351        if (LLVM_UNLIKELY(f == mMarkerMap.end())) {
352            throw std::runtime_error("Next node expression was not compiled!");
353        }
354        nextPhis[i]->addIncoming(f->second, whileExitBlock);
355    }
356
357    iBuilder->SetInsertPoint(whileEndBlock);
358    --mWhileDepth;
359
360    mCarryManager->ensureCarriesStoredRecursive();
361    mCarryManager->leaveScope();
362}
363
364
365void PabloCompiler::compileStatement(const Statement * stmt) {
366    Value * expr = nullptr;
367    if (const Assign * assign = dyn_cast<const Assign>(stmt)) {
368        expr = compileExpression(assign->getExpression());
369    }
370    else if (const Next * next = dyn_cast<const Next>(stmt)) {
371        expr = compileExpression(next->getExpr());
372    }
373    else if (const If * ifStatement = dyn_cast<const If>(stmt)) {
374        compileIf(ifStatement);
375        return;
376    }
377    else if (const While * whileStatement = dyn_cast<const While>(stmt)) {
378        compileWhile(whileStatement);
379        return;
380    }
381    else if (const Call* call = dyn_cast<Call>(stmt)) {
382        // Call the callee once and store the result in the marker map.
383        if (mMarkerMap.count(call)) {
384            return;
385        }
386
387        const Prototype * proto = call->getPrototype();
388        const String * callee = proto->getName();
389
390        Type * inputType = StructType::get(mMod->getContext(), std::vector<Type *>{proto->getNumOfParameters(), mBitBlockType});
391        Type * outputType = StructType::get(mMod->getContext(), std::vector<Type *>{proto->getNumOfResults(), mBitBlockType});
392        FunctionType * functionType = FunctionType::get(Type::getVoidTy(mMod->getContext()), std::vector<Type *>{PointerType::get(inputType, 0), PointerType::get(outputType, 0)}, false);
393
394        //Starts on process_block
395        SmallVector<AttributeSet, 3> Attrs;
396        Attrs.push_back(AttributeSet::get(mMod->getContext(), 1U, std::vector<Attribute::AttrKind>({ Attribute::ReadOnly, Attribute::NoCapture })));
397        Attrs.push_back(AttributeSet::get(mMod->getContext(), 2U, std::vector<Attribute::AttrKind>({ Attribute::ReadNone, Attribute::NoCapture })));
398        AttributeSet AttrSet = AttributeSet::get(mMod->getContext(), Attrs);
399
400        Function * externalFunction = cast<Function>(mMod->getOrInsertFunction(callee->value(), functionType, AttrSet));
401        if (LLVM_UNLIKELY(externalFunction == nullptr)) {
402            throw std::runtime_error("Could not create static method call for external function \"" + callee->to_string() + "\"");
403        }
404        externalFunction->setCallingConv(llvm::CallingConv::C);
405
406
407        AllocaInst * outputStruct = iBuilder->CreateAlloca(outputType);
408        iBuilder->CreateCall2(externalFunction, mInputAddressPtr, outputStruct);
409        Value * outputPtr = iBuilder->CreateGEP(outputStruct, std::vector<Value *>({ iBuilder->getInt32(0), iBuilder->getInt32(0) }));
410        expr = iBuilder->CreateAlignedLoad(outputPtr, iBuilder->getBitBlockWidth() / 8, false);
411    }
412    else if (const And * pablo_and = dyn_cast<And>(stmt)) {
413        expr = iBuilder->simd_and(compileExpression(pablo_and->getOperand(0)), compileExpression(pablo_and->getOperand(1)));
414    }
415    else if (const Or * pablo_or = dyn_cast<Or>(stmt)) {
416        expr = iBuilder->simd_or(compileExpression(pablo_or->getOperand(0)), compileExpression(pablo_or->getOperand(1)));
417    }
418    else if (const Xor * pablo_xor = dyn_cast<Xor>(stmt)) {
419        expr = iBuilder->simd_xor(compileExpression(pablo_xor->getOperand(0)), compileExpression(pablo_xor->getOperand(1)));
420    }
421    else if (const Sel * sel = dyn_cast<Sel>(stmt)) {
422        Value* ifMask = compileExpression(sel->getCondition());
423        Value* ifTrue = iBuilder->simd_and(ifMask, compileExpression(sel->getTrueExpr()));
424        Value* ifFalse = iBuilder->simd_and(iBuilder->simd_not(ifMask), compileExpression(sel->getFalseExpr()));
425        expr = iBuilder->simd_or(ifTrue, ifFalse);
426    }
427    else if (const Not * pablo_not = dyn_cast<Not>(stmt)) {
428        expr = iBuilder->simd_not(compileExpression(pablo_not->getExpr()));
429    }
430    else if (const Advance * adv = dyn_cast<Advance>(stmt)) {
431        Value * const strm_value = compileExpression(adv->getExpr());
432        expr = mCarryManager->advanceCarryInCarryOut(adv->getLocalAdvanceIndex(), adv->getAdvanceAmount(), strm_value);
433    }
434    else if (const Mod64Advance * adv = dyn_cast<Mod64Advance>(stmt)) {
435        Value * const strm_value = compileExpression(adv->getExpr());
436        expr = iBuilder->simd_slli(64, strm_value, adv->getAdvanceAmount());
437    }
438    else if (const MatchStar * mstar = dyn_cast<MatchStar>(stmt)) {
439        Value * const marker = compileExpression(mstar->getMarker());
440        Value * const cc = compileExpression(mstar->getCharClass());
441        Value * const marker_and_cc = iBuilder->simd_and(marker, cc);
442        Value * const sum = mCarryManager->addCarryInCarryOut(mstar->getLocalCarryIndex(), marker_and_cc, cc);
443        expr = iBuilder->simd_or(iBuilder->simd_xor(sum, cc), marker);
444    }
445    else if (const Mod64MatchStar * mstar = dyn_cast<Mod64MatchStar>(stmt)) {
446        Value * const marker = compileExpression(mstar->getMarker());
447        Value * const cc = compileExpression(mstar->getCharClass());
448        Value * const marker_and_cc = iBuilder->simd_and(marker, cc);
449        Value * const sum = iBuilder->simd_add(64, marker_and_cc, cc);
450        expr = iBuilder->simd_or(iBuilder->simd_xor(sum, cc), marker);
451    }
452    else if (const ScanThru * sthru = dyn_cast<ScanThru>(stmt)) {
453        Value * const  marker_expr = compileExpression(sthru->getScanFrom());
454        Value * const  cc_expr = compileExpression(sthru->getScanThru());
455        Value * const  sum = mCarryManager->addCarryInCarryOut(sthru->getLocalCarryIndex(), marker_expr, cc_expr);
456        expr = iBuilder->simd_and(sum, iBuilder->simd_not(cc_expr));
457    }
458    else if (const Mod64ScanThru * sthru = dyn_cast<Mod64ScanThru>(stmt)) {
459        Value * const marker_expr = compileExpression(sthru->getScanFrom());
460        Value * const cc_expr = compileExpression(sthru->getScanThru());
461        Value * const sum = iBuilder->simd_add(64, marker_expr, cc_expr);
462        expr = iBuilder->simd_and(sum, iBuilder->simd_not(cc_expr));
463    }
464    else if (const Count * c = dyn_cast<Count>(stmt)) {
465        Value * const to_count = compileExpression(c->getExpr());
466        expr = mCarryManager->popCount(to_count, c->getGlobalCountIndex());
467    } else {
468        std::string tmp;
469        llvm::raw_string_ostream msg(tmp);
470        msg << "Internal error: ";
471        PabloPrinter::print(stmt, msg);
472        msg << " is not a recognized statement in the Pablo compiler.";
473        throw std::runtime_error(msg.str());
474    }
475    mMarkerMap[stmt] = expr;
476    if (DumpTrace) {
477        iBuilder->genPrintRegister(stmt->getName()->to_string(), expr);
478    }
479   
480}
481
482Value * PabloCompiler::compileExpression(const PabloAST * expr) {
483    if (isa<Ones>(expr)) {
484        return iBuilder->allOnes();
485    }
486    else if (isa<Zeroes>(expr)) {
487        return iBuilder->allZeroes();
488    }
489    auto f = mMarkerMap.find(expr);
490    if (LLVM_UNLIKELY(f == mMarkerMap.end())) {
491        std::string o;
492        llvm::raw_string_ostream str(o);
493        str << "\"";
494        PabloPrinter::print(expr, str);
495        str << "\" was used before definition!";
496        throw std::runtime_error(str.str());
497    }
498    return f->second;
499}
500
501void PabloCompiler::SetOutputValue(Value * marker, const unsigned index) {
502    if (LLVM_UNLIKELY(marker == nullptr)) {
503        throw std::runtime_error("Cannot set result " + std::to_string(index) + " to Null");
504    }
505    if (LLVM_UNLIKELY(marker->getType()->isPointerTy())) {
506        marker = iBuilder->CreateAlignedLoad(marker, iBuilder->getBitBlockWidth()/8, false);
507    }
508    Value* indices[] = {iBuilder->getInt64(0), iBuilder->getInt32(index)};
509    Value* gep = iBuilder->CreateGEP(mOutputAddressPtr, indices);
510    if (marker->getType() != mBitBlockType) {
511        marker = iBuilder->CreateBitCast(marker, mBitBlockType);
512    }
513    iBuilder->CreateAlignedStore(marker, gep, iBuilder->getBitBlockWidth()/8, false);
514}
515
516}
Note: See TracBrowser for help on using the repository browser.