<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi,</div><div class=""><br class=""></div>This commit caused a number of code-size and compile-time degradations. Any chance to recover them?<div class=""><br class=""><div class=""><table class="table-striped table table-condensed table-hover" style="max-width: 100%; border-collapse: collapse; border-spacing: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 9pt;"><thead class=""><tr class=""><th style="padding: 4px 5px; line-height: 20px; text-align: center; vertical-align: bottom; border-top-width: 0px; width: 500px;" class="">Performance Regressions - code_size</th><th style="padding: 4px 5px; line-height: 20px; text-align: center; vertical-align: bottom; border-top-width: 0px;" class="">Δ </th><th style="padding: 4px 5px; line-height: 20px; text-align: center; vertical-align: bottom; border-top-width: 0px;" class="">Previous</th><th style="padding: 4px 5px; line-height: 20px; text-align: center; vertical-align: bottom; border-top-width: 0px;" class="">Current</th><th style="padding: 4px 5px; line-height: 20px; text-align: center; vertical-align: bottom; border-top-width: 0px;" class="">σ </th><th style="padding: 4px 5px; line-height: 20px; text-align: center; vertical-align: bottom; border-top-width: 0px;" class="">Δ (B)</th><th style="padding: 4px 5px; line-height: 20px; text-align: center; vertical-align: bottom; border-top-width: 0px;" class="">σ (B)</th></tr></thead><tbody class="searchable"><tr class=""><td class="benchmark-name" style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);"><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605737=8" style="color: rgb(0, 136, 204); text-decoration: none;" class="">CTMark/sqlite3/sqlite3</a></td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 101, 101);" class="">15.43%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">503892.0000</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">581656.0000</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">-</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 112, 112);" class="">12.92%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">-</td></tr><tr class=""><td class="benchmark-name" style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);"><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605732=8" style="color: rgb(0, 136, 204); text-decoration: none;" class="">CTMark/lencod/lencod</a></td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 171, 171);" class="">3.92%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">636696.0000</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">661652.0000</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">-</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 65, 65);" class="">26.59%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">-</td></tr><tr class=""><td class="benchmark-name" style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);"><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605723=8" style="color: rgb(0, 136, 204); text-decoration: none;" class="">CTMark/mafft/pairlocalalign</a></td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 177, 177);" class="">3.34%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">151352.0000</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">156404.0000</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">-</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 111, 111);" class="">13.15%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">-</td></tr></tbody></table><div style="margin: 0px 0px 10px; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px;" class=""><br class="webkit-block-placeholder"></div><table class="table-striped table table-condensed table-hover" style="max-width: 100%; border-collapse: collapse; border-spacing: 0px; margin-bottom: 20px; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 9pt;"><thead class=""><tr class=""><th style="padding: 4px 5px; line-height: 20px; text-align: center; vertical-align: bottom; border-top-width: 0px; width: 500px;" class="">Performance Regressions - Compile Time</th><th style="padding: 4px 5px; line-height: 20px; text-align: center; vertical-align: bottom; border-top-width: 0px;" class="">Δ </th><th style="padding: 4px 5px; line-height: 20px; text-align: center; vertical-align: bottom; border-top-width: 0px;" class="">Previous</th><th style="padding: 4px 5px; line-height: 20px; text-align: center; vertical-align: bottom; border-top-width: 0px;" class="">Current</th><th style="padding: 4px 5px; line-height: 20px; text-align: center; vertical-align: bottom; border-top-width: 0px;" class="">σ </th><th style="padding: 4px 5px; line-height: 20px; text-align: center; vertical-align: bottom; border-top-width: 0px;" class="">Δ (B)</th><th style="padding: 4px 5px; line-height: 20px; text-align: center; vertical-align: bottom; border-top-width: 0px;" class="">σ (B)</th></tr></thead><tbody class="searchable"><tr class=""><td class="benchmark-name" style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);"><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605736=2" style="color: rgb(0, 136, 204); text-decoration: none;" class="">CTMark/sqlite3/sqlite3-link</a></td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 93, 93);" class="">17.62%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">7.1298</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">8.3859</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">-</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 171, 171);" class="">3.90%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">-</td></tr><tr class=""><td class="benchmark-name" style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);"><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605737=2" style="color: rgb(0, 136, 204); text-decoration: none;" class="">CTMark/sqlite3/sqlite3</a></td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 113, 113);" class="">12.75%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">7.5996</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">8.5685</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">-</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 177, 177);" class="">3.34%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">-</td></tr><tr class=""><td class="benchmark-name" style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);"><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605740=2" style="color: rgb(0, 136, 204); text-decoration: none;" class="">CTMark/mafft/pairlocalalign-link</a></td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 143, 143);" class="">7.33%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">2.7199</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">2.9194</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">-</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(107, 255, 107);" class="">-14.12%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">-</td></tr><tr class=""><td class="benchmark-name" style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);"><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605738=2" style="color: rgb(0, 136, 204); text-decoration: none;" class="">CTMark/lencod/lencod-link</a></td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 166, 166);" class="">4.42%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">11.9191</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">12.4459</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">-</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 180, 180);" class="">3.07%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">-</td></tr><tr class=""><td class="benchmark-name" style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);"><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605723=2" style="color: rgb(0, 136, 204); text-decoration: none;" class="">CTMark/mafft/pairlocalalign</a></td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 179, 179);" class="">3.15%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">5.1741</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">5.3370</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">-</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(95, 255, 95);" class="">-16.96%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">-</td></tr><tr class=""><td class="benchmark-name" style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);"><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605732=2" style="color: rgb(0, 136, 204); text-decoration: none;" class="">CTMark/lencod/lencod</a></td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 190, 190);" class="">2.25%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">10.6467</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">10.8867</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">-</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(235, 255, 235);" class="">-0.17%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221);" class="">-</td></tr><tr class=""><td class="benchmark-name" style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);"><a href="http://104.154.54.203/db_default/v4/nts/59530/graph?test.1605724=2" style="color: rgb(0, 136, 204); text-decoration: none;" class="">CTMark/7zip/7zip-benchmark</a></td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 207, 207);" class="">1.18%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">35.7458</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">36.1689</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">-</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(255, 167, 167);" class="">4.27%</td><td style="padding: 4px 5px; line-height: 20px; vertical-align: top; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(221, 221, 221); background-color: rgb(249, 249, 249);" class="">-<br class=""><br class=""></td></tr></tbody></table></div><div class="">Details on green dragon:</div><div class=""><a href="http://104.154.54.203/db_default/v4/nts/59530" class="">http://104.154.54.203/db_default/v4/nts/59530</a></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Michael</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 15, 2017, at 6:12 AM, Haicheng Wu via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Author: haicheng<br class="">Date: Fri Jul 14 19:12:16 2017<br class="">New Revision: 308076<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=308076&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=308076&view=rev</a><br class="">Log:<br class="">[TTI] Refine the cost of EXT in getUserCost()<br class=""><br class="">Now, getUserCost() only checks the src and dst types of EXT to decide it is free<br class="">or not. This change first checks the types, then calls isExtFreeImpl(), and<br class="">check if EXT can form ExtLoad at last. Currently, only AArch64 has customized<br class="">implementation of isExtFreeImpl() to check if EXT can be folded into its use.<br class=""><br class="">Differential Revision: <a href="https://reviews.llvm.org/D34458" class="">https://reviews.llvm.org/D34458</a><br class=""><br class="">Added:<br class="">    llvm/trunk/test/Transforms/Inline/AArch64/ext.ll<br class="">    llvm/trunk/test/Transforms/Inline/PowerPC/<br class="">    llvm/trunk/test/Transforms/Inline/PowerPC/ext.ll<br class="">    llvm/trunk/test/Transforms/Inline/PowerPC/lit.local.cfg<br class="">    llvm/trunk/test/Transforms/Inline/X86/ext.ll<br class="">Modified:<br class="">    llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h<br class="">    llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h<br class="">    llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h<br class="">    llvm/trunk/include/llvm/Target/TargetLowering.h<br class="">    llvm/trunk/lib/Analysis/TargetTransformInfo.cpp<br class="">    llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp<br class=""><br class="">Modified: llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h?rev=308076&r1=308075&r2=308076&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h?rev=308076&r1=308075&r2=308076&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h (original)<br class="">+++ llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h Fri Jul 14 19:12:16 2017<br class="">@@ -155,6 +155,13 @@ public:<br class="">   int getGEPCost(Type *PointeeType, const Value *Ptr,<br class="">                  ArrayRef<const Value *> Operands) const;<br class=""><br class="">+  /// \brief Estimate the cost of a EXT operation when lowered.<br class="">+  ///<br class="">+  /// The contract for this function is the same as \c getOperationCost except<br class="">+  /// that it supports an interface that provides extra information specific to<br class="">+  /// the EXT operation.<br class="">+  int getExtCost(const Instruction *I, const Value *Src) const;<br class="">+<br class="">   /// \brief Estimate the cost of a function call when lowered.<br class="">   ///<br class="">   /// The contract for this is the same as \c getOperationCost except that it<br class="">@@ -849,6 +856,7 @@ public:<br class="">   virtual int getOperationCost(unsigned Opcode, Type *Ty, Type *OpTy) = 0;<br class="">   virtual int getGEPCost(Type *PointeeType, const Value *Ptr,<br class="">                          ArrayRef<const Value *> Operands) = 0;<br class="">+  virtual int getExtCost(const Instruction *I, const Value *Src) = 0;<br class="">   virtual int getCallCost(FunctionType *FTy, int NumArgs) = 0;<br class="">   virtual int getCallCost(const Function *F, int NumArgs) = 0;<br class="">   virtual int getCallCost(const Function *F,<br class="">@@ -1022,6 +1030,9 @@ public:<br class="">                  ArrayRef<const Value *> Operands) override {<br class="">     return Impl.getGEPCost(PointeeType, Ptr, Operands);<br class="">   }<br class="">+  int getExtCost(const Instruction *I, const Value *Src) override {<br class="">+    return Impl.getExtCost(I, Src);<br class="">+  }<br class="">   int getCallCost(FunctionType *FTy, int NumArgs) override {<br class="">     return Impl.getCallCost(FTy, NumArgs);<br class="">   }<br class=""><br class="">Modified: llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h?rev=308076&r1=308075&r2=308076&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h?rev=308076&r1=308075&r2=308076&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h (original)<br class="">+++ llvm/trunk/include/llvm/Analysis/TargetTransformInfoImpl.h Fri Jul 14 19:12:16 2017<br class="">@@ -120,6 +120,10 @@ public:<br class="">     return SI.getNumCases();<br class="">   }<br class=""><br class="">+  int getExtCost(const Instruction *I, const Value *Src) {<br class="">+    return TTI::TCC_Basic;<br class="">+  }<br class="">+<br class="">   unsigned getCallCost(FunctionType *FTy, int NumArgs) {<br class="">     assert(FTy && "FunctionType must be provided to this routine.");<br class=""><br class="">@@ -728,6 +732,8 @@ public:<br class="">       // nop on most sane targets.<br class="">       if (isa<CmpInst>(CI->getOperand(0)))<br class="">         return TTI::TCC_Free;<br class="">+      if (isa<SExtInst>(CI) || isa<ZExtInst>(CI) || isa<FPExtInst>(CI))<br class="">+        return static_cast<T *>(this)->getExtCost(CI, Operands.back());<br class="">     }<br class=""><br class="">     return static_cast<T *>(this)->getOperationCost(<br class=""><br class="">Modified: llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h?rev=308076&r1=308075&r2=308076&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h?rev=308076&r1=308075&r2=308076&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h (original)<br class="">+++ llvm/trunk/include/llvm/CodeGen/BasicTTIImpl.h Fri Jul 14 19:12:16 2017<br class="">@@ -155,6 +155,18 @@ public:<br class="">     return BaseT::getGEPCost(PointeeType, Ptr, Operands);<br class="">   }<br class=""><br class="">+  int getExtCost(const Instruction *I, const Value *Src) {<br class="">+    if (getTLI()->isExtFree(I))<br class="">+      return TargetTransformInfo::TCC_Free;<br class="">+<br class="">+    if (isa<ZExtInst>(I) || isa<SExtInst>(I))<br class="">+      if (const LoadInst *LI = dyn_cast<LoadInst>(Src))<br class="">+        if (getTLI()->isExtLoad(LI, I, DL))<br class="">+          return TargetTransformInfo::TCC_Free;<br class="">+<br class="">+    return TargetTransformInfo::TCC_Basic;<br class="">+  }<br class="">+<br class="">   unsigned getIntrinsicCost(Intrinsic::ID IID, Type *RetTy,<br class="">                             ArrayRef<const Value *> Arguments) {<br class="">     return BaseT::getIntrinsicCost(IID, RetTy, Arguments);<br class=""><br class="">Modified: llvm/trunk/include/llvm/Target/TargetLowering.h<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=308076&r1=308075&r2=308076&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=308076&r1=308075&r2=308076&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/include/llvm/Target/TargetLowering.h (original)<br class="">+++ llvm/trunk/include/llvm/Target/TargetLowering.h Fri Jul 14 19:12:16 2017<br class="">@@ -2012,6 +2012,35 @@ public:<br class="">     return isExtFreeImpl(I);<br class="">   }<br class=""><br class="">+  /// Return true if \p Load and \p Ext can form an ExtLoad.<br class="">+  /// For example, in AArch64<br class="">+  ///   %L = load i8, i8* %ptr<br class="">+  ///   %E = zext i8 %L to i32<br class="">+  /// can be lowered into one load instruction<br class="">+  ///   ldrb w0, [x0]<br class="">+  bool isExtLoad(const LoadInst *Load, const Instruction *Ext,<br class="">+                 const DataLayout &DL) const {<br class="">+    EVT VT = getValueType(DL, Ext->getType());<br class="">+    EVT LoadVT = getValueType(DL, Load->getType());<br class="">+<br class="">+    // If the load has other users and the truncate is not free, the ext<br class="">+    // probably isn't free.<br class="">+    if (!Load->hasOneUse() && (isTypeLegal(LoadVT) || !isTypeLegal(VT)) &&<br class="">+        !isTruncateFree(Ext->getType(), Load->getType()))<br class="">+      return false;<br class="">+<br class="">+    // Check whether the target supports casts folded into loads.<br class="">+    unsigned LType;<br class="">+    if (isa<ZExtInst>(Ext))<br class="">+      LType = ISD::ZEXTLOAD;<br class="">+    else {<br class="">+      assert(isa<SExtInst>(Ext) && "Unexpected ext type!");<br class="">+      LType = ISD::SEXTLOAD;<br class="">+    }<br class="">+<br class="">+    return isLoadExtLegal(LType, VT, LoadVT);<br class="">+  }<br class="">+<br class="">   /// Return true if any actual instruction that defines a value of type FromTy<br class="">   /// implicitly zero-extends the value to ToTy in the result register.<br class="">   ///<br class=""><br class="">Modified: llvm/trunk/lib/Analysis/TargetTransformInfo.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetTransformInfo.cpp?rev=308076&r1=308075&r2=308076&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetTransformInfo.cpp?rev=308076&r1=308075&r2=308076&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Analysis/TargetTransformInfo.cpp (original)<br class="">+++ llvm/trunk/lib/Analysis/TargetTransformInfo.cpp Fri Jul 14 19:12:16 2017<br class="">@@ -82,6 +82,11 @@ int TargetTransformInfo::getGEPCost(Type<br class="">   return TTIImpl->getGEPCost(PointeeType, Ptr, Operands);<br class=""> }<br class=""><br class="">+int TargetTransformInfo::getExtCost(const Instruction *I,<br class="">+                                    const Value *Src) const {<br class="">+  return TTIImpl->getExtCost(I, Src);<br class="">+}<br class="">+<br class=""> int TargetTransformInfo::getIntrinsicCost(<br class="">     Intrinsic::ID IID, Type *RetTy, ArrayRef<const Value *> Arguments) const {<br class="">   int Cost = TTIImpl->getIntrinsicCost(IID, RetTy, Arguments);<br class=""><br class="">Modified: llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp?rev=308076&r1=308075&r2=308076&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp?rev=308076&r1=308075&r2=308076&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp (original)<br class="">+++ llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp Fri Jul 14 19:12:16 2017<br class="">@@ -4847,25 +4847,7 @@ bool CodeGenPrepare::canFormExtLd(<br class="">   if (!HasPromoted && LI->getParent() == Inst->getParent())<br class="">     return false;<br class=""><br class="">-  EVT VT = TLI->getValueType(*DL, Inst->getType());<br class="">-  EVT LoadVT = TLI->getValueType(*DL, LI->getType());<br class="">-<br class="">-  // If the load has other users and the truncate is not free, this probably<br class="">-  // isn't worthwhile.<br class="">-  if (!LI->hasOneUse() && (TLI->isTypeLegal(LoadVT) || !TLI->isTypeLegal(VT)) &&<br class="">-      !TLI->isTruncateFree(Inst->getType(), LI->getType()))<br class="">-    return false;<br class="">-<br class="">-  // Check whether the target supports casts folded into loads.<br class="">-  unsigned LType;<br class="">-  if (isa<ZExtInst>(Inst))<br class="">-    LType = ISD::ZEXTLOAD;<br class="">-  else {<br class="">-    assert(isa<SExtInst>(Inst) && "Unexpected ext type!");<br class="">-    LType = ISD::SEXTLOAD;<br class="">-  }<br class="">-<br class="">-  return TLI->isLoadExtLegal(LType, VT, LoadVT);<br class="">+  return TLI->isExtLoad(LI, Inst, *DL);<br class=""> }<br class=""><br class=""> /// Move a zext or sext fed by a load into the same basic block as the load,<br class=""><br class="">Added: llvm/trunk/test/Transforms/Inline/AArch64/ext.ll<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/AArch64/ext.ll?rev=308076&view=auto" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/AArch64/ext.ll?rev=308076&view=auto</a><br class="">==============================================================================<br class="">--- llvm/trunk/test/Transforms/Inline/AArch64/ext.ll (added)<br class="">+++ llvm/trunk/test/Transforms/Inline/AArch64/ext.ll Fri Jul 14 19:12:16 2017<br class="">@@ -0,0 +1,249 @@<br class="">+; REQUIRES: asserts<br class="">+; RUN: opt -inline -mtriple=aarch64--linux-gnu -S -debug-only=inline-cost < %s 2>&1 | FileCheck %s<br class="">+<br class="">+target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"<br class="">+target triple = "aarch64--linux-gnu"<br class="">+<br class="">+define i32 @outer1(i32* %ptr, i32 %i) {<br class="">+  %C = call i32 @inner1(i32* %ptr, i32 %i)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; sext can be folded into gep.<br class="">+; CHECK: Analyzing call of inner1<br class="">+; CHECK: NumInstructionsSimplified: 3<br class="">+; CHECK: NumInstructions: 4<br class="">+define i32 @inner1(i32* %ptr, i32 %i) {<br class="">+  %E = sext i32 %i to i64<br class="">+  %G = getelementptr inbounds i32, i32* %ptr, i64 %E<br class="">+  %L = load i32, i32* %G<br class="">+  ret i32 %L<br class="">+}<br class="">+<br class="">+define i32 @outer2(i32* %ptr, i32 %i) {<br class="">+  %C = call i32 @inner2(i32* %ptr, i32 %i)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; zext from i32 to i64 is free.<br class="">+; CHECK: Analyzing call of inner2<br class="">+; CHECK: NumInstructionsSimplified: 3<br class="">+; CHECK: NumInstructions: 4<br class="">+define i32 @inner2(i32* %ptr, i32 %i) {<br class="">+  %E = zext i32 %i to i64<br class="">+  %G = getelementptr inbounds i32, i32* %ptr, i64 %E<br class="">+  %L = load i32, i32* %G<br class="">+  ret i32 %L<br class="">+}<br class="">+<br class="">+define i32 @outer3(i32* %ptr, i16 %i) {<br class="">+  %C = call i32 @inner3(i32* %ptr, i16 %i)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; zext can be folded into gep.<br class="">+; CHECK: Analyzing call of inner3<br class="">+; CHECK: NumInstructionsSimplified: 3<br class="">+; CHECK: NumInstructions: 4<br class="">+define i32 @inner3(i32* %ptr, i16 %i) {<br class="">+  %E = zext i16 %i to i64<br class="">+  %G = getelementptr inbounds i32, i32* %ptr, i64 %E<br class="">+  %L = load i32, i32* %G<br class="">+  ret i32 %L<br class="">+}<br class="">+<br class="">+define i16 @outer4(i8* %ptr) {<br class="">+  %C = call i16 @inner4(i8* %ptr)<br class="">+  ret i16 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner4<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i16 @inner4(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = zext i8 %L to i16<br class="">+  ret i16 %E<br class="">+}<br class="">+<br class="">+define i16 @outer5(i8* %ptr) {<br class="">+  %C = call i16 @inner5(i8* %ptr)<br class="">+  ret i16 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner5<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i16 @inner5(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = sext i8 %L to i16<br class="">+  ret i16 %E<br class="">+}<br class="">+<br class="">+define i32 @outer6(i8* %ptr) {<br class="">+  %C = call i32 @inner6(i8* %ptr)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner6<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i32 @inner6(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = zext i8 %L to i32<br class="">+  ret i32 %E<br class="">+}<br class="">+<br class="">+define i32 @outer7(i8* %ptr) {<br class="">+  %C = call i32 @inner7(i8* %ptr)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner7<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i32 @inner7(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = sext i8 %L to i32<br class="">+  ret i32 %E<br class="">+}<br class="">+<br class="">+define i32 @outer8(i16* %ptr) {<br class="">+  %C = call i32 @inner8(i16* %ptr)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner8<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i32 @inner8(i16* %ptr) {<br class="">+  %L = load i16, i16* %ptr<br class="">+  %E = zext i16 %L to i32<br class="">+  ret i32 %E<br class="">+}<br class="">+<br class="">+define i32 @outer9(i16* %ptr) {<br class="">+  %C = call i32 @inner9(i16* %ptr)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner9<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i32 @inner9(i16* %ptr) {<br class="">+  %L = load i16, i16* %ptr<br class="">+  %E = sext i16 %L to i32<br class="">+  ret i32 %E<br class="">+}<br class="">+<br class="">+define i64 @outer10(i8* %ptr) {<br class="">+  %C = call i64 @inner10(i8* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner10<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner10(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = zext i8 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer11(i8* %ptr) {<br class="">+  %C = call i64 @inner11(i8* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner11<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner11(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = sext i8 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer12(i16* %ptr) {<br class="">+  %C = call i64 @inner12(i16* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner12<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner12(i16* %ptr) {<br class="">+  %L = load i16, i16* %ptr<br class="">+  %E = zext i16 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer13(i16* %ptr) {<br class="">+  %C = call i64 @inner13(i16* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner13<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner13(i16* %ptr) {<br class="">+  %L = load i16, i16* %ptr<br class="">+  %E = sext i16 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer14(i32* %ptr) {<br class="">+  %C = call i64 @inner14(i32* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner14<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner14(i32* %ptr) {<br class="">+  %L = load i32, i32* %ptr<br class="">+  %E = zext i32 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer15(i32* %ptr) {<br class="">+  %C = call i64 @inner15(i32* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner15<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner15(i32* %ptr) {<br class="">+  %L = load i32, i32* %ptr<br class="">+  %E = sext i32 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer16(i32 %V1, i64 %V2) {<br class="">+  %C = call i64 @inner16(i32 %V1, i64 %V2)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; sext can be folded into shl.<br class="">+; CHECK: Analyzing call of inner16<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 4<br class="">+define i64 @inner16(i32 %V1, i64 %V2) {<br class="">+  %E = sext i32 %V1 to i64<br class="">+  %S = shl i64 %E, 3<br class="">+  %A = add i64 %V2, %S<br class="">+  ret i64 %A<br class="">+}<br class=""><br class="">Added: llvm/trunk/test/Transforms/Inline/PowerPC/ext.ll<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/PowerPC/ext.ll?rev=308076&view=auto" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/PowerPC/ext.ll?rev=308076&view=auto</a><br class="">==============================================================================<br class="">--- llvm/trunk/test/Transforms/Inline/PowerPC/ext.ll (added)<br class="">+++ llvm/trunk/test/Transforms/Inline/PowerPC/ext.ll Fri Jul 14 19:12:16 2017<br class="">@@ -0,0 +1,140 @@<br class="">+; REQUIRES: asserts<br class="">+; RUN: opt -inline -S -debug-only=inline-cost < %s 2>&1 | FileCheck %s<br class="">+<br class="">+target datalayout = "E-m:e-i64:64-n32:64"<br class="">+target triple = "powerpc64le-ibm-linux-gnu"<br class="">+<br class="">+define i16 @outer1(i8* %ptr) {<br class="">+  %C = call i16 @inner1(i8* %ptr)<br class="">+  ret i16 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner1<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i16 @inner1(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = zext i8 %L to i16<br class="">+  ret i16 %E<br class="">+}<br class="">+<br class="">+define i32 @outer2(i8* %ptr) {<br class="">+  %C = call i32 @inner2(i8* %ptr)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner2<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i32 @inner2(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = zext i8 %L to i32<br class="">+  ret i32 %E<br class="">+}<br class="">+<br class="">+define i32 @outer3(i16* %ptr) {<br class="">+  %C = call i32 @inner3(i16* %ptr)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner3<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i32 @inner3(i16* %ptr) {<br class="">+  %L = load i16, i16* %ptr<br class="">+  %E = zext i16 %L to i32<br class="">+  ret i32 %E<br class="">+}<br class="">+<br class="">+define i32 @outer4(i16* %ptr) {<br class="">+  %C = call i32 @inner4(i16* %ptr)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner4<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i32 @inner4(i16* %ptr) {<br class="">+  %L = load i16, i16* %ptr<br class="">+  %E = sext i16 %L to i32<br class="">+  ret i32 %E<br class="">+}<br class="">+<br class="">+define i64 @outer5(i8* %ptr) {<br class="">+  %C = call i64 @inner5(i8* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner5<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner5(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = zext i8 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer6(i16* %ptr) {<br class="">+  %C = call i64 @inner6(i16* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner6<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner6(i16* %ptr) {<br class="">+  %L = load i16, i16* %ptr<br class="">+  %E = zext i16 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer7(i16* %ptr) {<br class="">+  %C = call i64 @inner7(i16* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner7<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner7(i16* %ptr) {<br class="">+  %L = load i16, i16* %ptr<br class="">+  %E = sext i16 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer8(i32* %ptr) {<br class="">+  %C = call i64 @inner8(i32* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner8<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner8(i32* %ptr) {<br class="">+  %L = load i32, i32* %ptr<br class="">+  %E = zext i32 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer9(i32* %ptr) {<br class="">+  %C = call i64 @inner9(i32* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner9<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner9(i32* %ptr) {<br class="">+  %L = load i32, i32* %ptr<br class="">+  %E = sext i32 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class=""><br class="">Added: llvm/trunk/test/Transforms/Inline/PowerPC/lit.local.cfg<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/PowerPC/lit.local.cfg?rev=308076&view=auto" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/PowerPC/lit.local.cfg?rev=308076&view=auto</a><br class="">==============================================================================<br class="">--- llvm/trunk/test/Transforms/Inline/PowerPC/lit.local.cfg (added)<br class="">+++ llvm/trunk/test/Transforms/Inline/PowerPC/lit.local.cfg Fri Jul 14 19:12:16 2017<br class="">@@ -0,0 +1,3 @@<br class="">+if not 'PowerPC' in config.root.targets:<br class="">+    config.unsupported = True<br class="">+<br class=""><br class="">Added: llvm/trunk/test/Transforms/Inline/X86/ext.ll<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/X86/ext.ll?rev=308076&view=auto" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/X86/ext.ll?rev=308076&view=auto</a><br class="">==============================================================================<br class="">--- llvm/trunk/test/Transforms/Inline/X86/ext.ll (added)<br class="">+++ llvm/trunk/test/Transforms/Inline/X86/ext.ll Fri Jul 14 19:12:16 2017<br class="">@@ -0,0 +1,201 @@<br class="">+; REQUIRES: asserts<br class="">+; RUN: opt -inline -mtriple=x86_64-unknown-unknown -S -debug-only=inline-cost < %s 2>&1 | FileCheck %s<br class="">+<br class="">+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"<br class="">+target triple = "x86_64-unknown-unknown"<br class="">+<br class="">+define i32 @outer1(i32* %ptr, i32 %i) {<br class="">+  %C = call i32 @inner1(i32* %ptr, i32 %i)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; zext from i32 to i64 is free.<br class="">+; CHECK: Analyzing call of inner1<br class="">+; CHECK: NumInstructionsSimplified: 3<br class="">+; CHECK: NumInstructions: 4<br class="">+define i32 @inner1(i32* %ptr, i32 %i) {<br class="">+  %E = zext i32 %i to i64<br class="">+  %G = getelementptr inbounds i32, i32* %ptr, i64 %E<br class="">+  %L = load i32, i32* %G<br class="">+  ret i32 %L<br class="">+}<br class="">+<br class="">+define i16 @outer2(i8* %ptr) {<br class="">+  %C = call i16 @inner2(i8* %ptr)<br class="">+  ret i16 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner2<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i16 @inner2(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = zext i8 %L to i16<br class="">+  ret i16 %E<br class="">+}<br class="">+<br class="">+define i16 @outer3(i8* %ptr) {<br class="">+  %C = call i16 @inner3(i8* %ptr)<br class="">+  ret i16 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner3<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i16 @inner3(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = sext i8 %L to i16<br class="">+  ret i16 %E<br class="">+}<br class="">+<br class="">+define i32 @outer4(i8* %ptr) {<br class="">+  %C = call i32 @inner4(i8* %ptr)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner4<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i32 @inner4(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = zext i8 %L to i32<br class="">+  ret i32 %E<br class="">+}<br class="">+<br class="">+define i32 @outer5(i8* %ptr) {<br class="">+  %C = call i32 @inner5(i8* %ptr)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner5<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i32 @inner5(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = sext i8 %L to i32<br class="">+  ret i32 %E<br class="">+}<br class="">+<br class="">+define i32 @outer6(i16* %ptr) {<br class="">+  %C = call i32 @inner6(i16* %ptr)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner6<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i32 @inner6(i16* %ptr) {<br class="">+  %L = load i16, i16* %ptr<br class="">+  %E = zext i16 %L to i32<br class="">+  ret i32 %E<br class="">+}<br class="">+<br class="">+define i32 @outer7(i16* %ptr) {<br class="">+  %C = call i32 @inner7(i16* %ptr)<br class="">+  ret i32 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner7<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i32 @inner7(i16* %ptr) {<br class="">+  %L = load i16, i16* %ptr<br class="">+  %E = sext i16 %L to i32<br class="">+  ret i32 %E<br class="">+}<br class="">+<br class="">+define i64 @outer8(i8* %ptr) {<br class="">+  %C = call i64 @inner8(i8* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner8<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner8(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = zext i8 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer9(i8* %ptr) {<br class="">+  %C = call i64 @inner9(i8* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner9<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner9(i8* %ptr) {<br class="">+  %L = load i8, i8* %ptr<br class="">+  %E = sext i8 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer10(i16* %ptr) {<br class="">+  %C = call i64 @inner10(i16* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner10<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner10(i16* %ptr) {<br class="">+  %L = load i16, i16* %ptr<br class="">+  %E = zext i16 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer11(i16* %ptr) {<br class="">+  %C = call i64 @inner11(i16* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner11<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner11(i16* %ptr) {<br class="">+  %L = load i16, i16* %ptr<br class="">+  %E = sext i16 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer12(i32* %ptr) {<br class="">+  %C = call i64 @inner12(i32* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner12<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner12(i32* %ptr) {<br class="">+  %L = load i32, i32* %ptr<br class="">+  %E = zext i32 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class="">+<br class="">+define i64 @outer13(i32* %ptr) {<br class="">+  %C = call i64 @inner13(i32* %ptr)<br class="">+  ret i64 %C<br class="">+}<br class="">+<br class="">+; It is an ExtLoad.<br class="">+; CHECK: Analyzing call of inner13<br class="">+; CHECK: NumInstructionsSimplified: 2<br class="">+; CHECK: NumInstructions: 3<br class="">+define i64 @inner13(i32* %ptr) {<br class="">+  %L = load i32, i32* %ptr<br class="">+  %E = sext i32 %L to i64<br class="">+  ret i64 %E<br class="">+}<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></div></div></blockquote></div><br class=""></div></div></body></html>