<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Sean,</div><div><br class="Apple-interchange-newline"><blockquote type="cite"><blockquote type="cite">Can I just utilize the i1 type? Is the<br>i1 type already used for something, and thus might create a conflict?<br></blockquote><br>I think you are very confused. LLVM's types are meant to be used to<br>represent *your* program :) They can't be "already used".<br></blockquote><div><br></div>I am keeping all the types of C, and adding my new types. I thought that, for example, I can't map my new type to i32 because that's used for C integers. That's what I meant by already used. Am I missing something?</div><div><br><blockquote type="cite"><br><blockquote type="cite">2) Can I use LLVM's intrinsic functions for my gates, something like<br>@llvm.NOT(i1 %val)? Would the fact that the implementation of these external<br>functions is not defined, create a problem in translation down to IR? I have<br>used Clang's "built-ins" in the front-end and that seems to do the job at<br>the parser level.<br></blockquote><br>Again, I think you are confused. Just use the operations that are<br>built into LLVM, such as<br><<a href="http://llvm.org/docs/LangRef.html#bitwise-binary-operations">http://llvm.org/docs/LangRef.html#bitwise-binary-operations</a>>. One<br>slight point of confusion is that LLVM tries to be minimal so there is<br>no NOT instruction; `NOT X` is represented as `XOR X, -1`. You<br>probably won't need to add an intrinsic unless you are doing something<br>_very_ exotic.<br><br></blockquote><div><br></div><div>That's a good point. However simple binary operations such as XOR are not the only ones I'll be using. I have the Toffoli Gate for example which takes in 3 operands:</div><div><a href="http://en.wikipedia.org/wiki/Toffoli_gate">http://en.wikipedia.org/wiki/Toffoli_gate</a></div><div>I guess I can use intrinsics for these things? If I do, can I leave its behavior undefined? I would like it to appear just with the name toffoli in the IR.</div><div><br></div></div><div>Thanks,</div><div>Ali</div></body></html>