<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"><span></span></div><div dir="ltr"><meta http-equiv="Content-Type" content="text/html charset=utf-8">Hi Craig,<div class=""><br class=""></div><div class="">This worked. Thank you very much.</div><div class=""><br class=""></div><div class="">Is there a way to specify this by default for a particular target?. I implemented a LLVM backend and added all the required code so that Clang recognises it as a target, but I’m unsure about how to deal with this particularly. Ideally, Clang should use ‘phi-node-folding-threshold=1’ automatically when my target is specified. Any suggestions are appreciated. </div><div class=""><br class=""></div><div class="">Thanks again.</div><div class=""><br class=""></div><div class="">John</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 18 Sep 2019, at 08:34, Craig Topper <<a href="mailto:craig.topper@gmail.com" class="">craig.topper@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">You can set it on the command line by doing "clang -mllvm -phi-node-folding-threshold=1”  The -mllvm tells clang to pass the next argument through to the command line system used by IR passes.<div class=""><br clear="all" class=""><div class=""><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div><br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 17, 2019 at 11:05 PM Joan Lluch via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class="">Hi All,<div class=""><br class=""></div><div class="">For a custom backend I’m developing, where jumps are not particularly expensive, I want to reduce the <span style="font-family:Monaco;font-size:11px;background-color:rgb(255,255,255)" class="">phi-node-folding-threshold </span>attribute value from the default 2 to just 1, as it produces better code in my case.</div><div class=""><br class=""></div><div class="">I first tried to set the attribute as a clang command line option, but it does not seem to be available. ( I tried “clang  -phi-node-folding-threshold=1” but this returns an “unknown argument” error)  </div><div class=""><br class=""></div><div class="">However, it works as intended if I replace the default value by hard coding in it in SimplifyCFG.cpp and recompiling clang</div><div class=""><br class=""></div><div class=""> My question is, Is there a way to set that attribute to a different value for a specific target?. Or at least to set it on the command line?</div><div class=""><br class=""></div><div class="">Thanks in advance</div><div class=""><br class=""></div><div class="">John</div></div>_______________________________________________<br class="">
cfe-dev mailing list<br class="">
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a><br class="">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br class="">
</blockquote></div>
</div></blockquote></div><br class=""></div></div></body></html>