<div dir="ltr"><span style="font-size:12.8px">On </span><span style="font-size:12.8px">311141 </span><span style="font-size:12.8px">tests looks slow and </span><span style="font-size:12.8px">partial_right.cc hangs in llvm-symbolizer.</span><div><div><span style="font-size:12.8px"><br></span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 24, 2017 at 8:02 PM, Vitaly Buka <span dir="ltr"><<a href="mailto:vitalybuka@google.com" target="_blank">vitalybuka@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>So I see that on <span style="font-size:12.8px">311141 </span>tests are incredibly.</div><div>And on test partial_right.cc llvm-symbolizer hands with 100% cpu<span style="font-size:12.8px">.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Aug 24, 2017 at 6:27 PM, Geoff Berry <span dir="ltr"><<a href="mailto:gberry@codeaurora.org" target="_blank">gberry@codeaurora.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Never mind, I believe I've tracked down at least one mis-compile of llvm-symbolizer using an emulator running Android w/ SDK version 24<br>
<br>
On 8/24/2017 12:35 PM, Geoff Berry via llvm-commits wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
I let it run all night. Definitely hung. I changed my cmake setting so that lit only runs one test at a time (-j1) and the first test that hangs is interception_test.cc, which is a very small test.<br>
<br>
I did have to change the Android API version from 24 to 23 in the script since I don't have a device with that version of Android installed on it handy. Perhaps that is the cause of the hang?<br>
<br>
I'm trying to get my hands on a newer Android version device, but in the mean time would you be able to do a run at revision 311141 (which includes my original change) with -DLLVM_LIT_ARGS="-vv -j1" so we can determine exactly which lit test is hanging?<br>
<br>
On 8/23/2017 5:54 PM, Vitaly Buka wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
How long do you wait? it's OK if not output for a few minutes.<br>
<br>
On Tue, Aug 22, 2017 at 8:46 PM, Geoff Berry <<a href="mailto:gberry@codeaurora.org" target="_blank">gberry@codeaurora.org</a> <mailto:<a href="mailto:gberry@codeaurora.org" target="_blank">gberry@codeaurora.org</a>><wbr>> wrote:<br>
<br>
I've been trying to reproduce this failure, but I'm getting<br>
check-asan hangs even if I test the revision with my latest revert:<br>
<br>
Is there something I need to do to the device that isn't done by<br>
these scripts? Are there additional environment variables I need to<br>
set before running?<br>
<br>
For the record I'm running:<br>
$ BUILDBOT_CLOBBER= BUILDBOT_REVISION=311142 ./buildbot_android.sh<br>
<br>
r311142 is my latest reversion of my MachineCopyPropagation changes<br>
and the only changes I've made to the scripts are:<br>
- change the svn repo to be https:// instead of http:// to avoid svn<br>
timeouts<br>
- add -DLLVM_LIT_ARGS="-v" to the compiler-rt cmake args so running<br>
check-asan will print the tests names as they run to the log file<br>
<br>
It appears that the following tests are hanging:<br>
/data/local/tmp/Output/deep_ca<wbr>ll_stack.cc.tmp<br>
/data/local/tmp/Output/interce<wbr>ption_test.cc.tmp<br>
/data/local/tmp/Output/quarant<wbr>ine_size_mb.cc.tmp<br>
/data/local/tmp/Output/<a href="http://thread_local_quarantine_size_kb.cc.tm" rel="noreferrer" target="_blank">thread_<wbr>local_quarantine_size_kb.cc.tm</a><br>
<<a href="http://local_quarantine_size_kb.cc.tm" rel="noreferrer" target="_blank">http://local_quarantine_size_<wbr>kb.cc.tm</a>>p<br>
/data/local/tmp/Output/coverag<wbr>e-module-unloaded.cc.tmp.exe<br>
/data/local/tmp/Output/coverag<wbr>e-reset.cc.tmp<br>
/data/local/tmp/Output/coverag<wbr>e.cc.tmp<br>
/data/local/tmp/Output/start-d<wbr>eactivated.cc.tmp<br>
<br>
<br>
On 8/17/2017 9:24 PM, Vitaly Buka wrote:<br>
<br>
If you have android with arm 32bit, you probably can reproduce<br>
with running<br>
<a href="https://llvm.org/svn/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android.sh" rel="noreferrer" target="_blank">https://llvm.org/svn/llvm-proj<wbr>ect/zorg/trunk/zorg/buildbot/b<wbr>uilders/sanitizers/buildbot_an<wbr>droid.sh</a> <br>
<<a href="https://llvm.org/svn/llvm-project/zorg/trunk/zorg/buildbot/builders/sanitizers/buildbot_android.sh" rel="noreferrer" target="_blank">https://llvm.org/svn/llvm-pro<wbr>ject/zorg/trunk/zorg/buildbot/<wbr>builders/sanitizers/buildbot_a<wbr>ndroid.sh</a>> <br>
in empty directory.<br>
<br>
On Thu, Aug 17, 2017 at 6:23 PM, Vitaly Buka<br>
<<a href="mailto:vitalybuka@google.com" target="_blank">vitalybuka@google.com</a> <mailto:<a href="mailto:vitalybuka@google.com" target="_blank">vitalybuka@google.com</a>><br>
<mailto:<a href="mailto:vitalybuka@google.com" target="_blank">vitalybuka@google.com</a> <mailto:<a href="mailto:vitalybuka@google.com" target="_blank">vitalybuka@google.com</a>><wbr>>><br>
wrote:<br>
<br>
I just hangs on "Running the AddressSanitizer tests" for arm<br>
<br>
/var/lib/buildbot/sanitizer-bu<wbr>ildbot6/sanitizer-x86_64-linux<wbr>-android/build/compiler_rt_bui<wbr>ld_android_arm/lib/asan/tests/<wbr>AsanTest: <br>
1 file pus<br>
hed. 3.7 MB/s (10602792 bytes in 2.742s)<br>
+ echo @@@BUILD_STEP run asan lit tests<br>
'[arm/sailfish-userdebug/OPR1.<wbr>170621.001]@@@'<br>
@@@BUILD_STEP run asan lit tests<br>
[arm/sailfish-userdebug/OPR1.1<wbr>70621.001]@@@<br>
+ cd<br>
/var/lib/buildbot/sanitizer-bu<wbr>ildbot6/sanitizer-x86_64-linux<wbr>-android/build/compiler_rt_bui<wbr>ld_android_arm <br>
+ ninja check-asan<br>
[1/1] Running the AddressSanitizer tests<br>
<br>
<br>
But the same device passes aarch64 tests:<br>
[1/1] Running the AddressSanitizer tests<br>
-- Testing: 407 tests, 12 threads --<br>
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..<br>
Testing Time: 87.09s<br>
Expected Passes : 202<br>
Expected Failures : 27<br>
Unsupported Tests : 178<br>
+ echo @@@BUILD_STEP run sanitizer_common tests<br>
'[aarch64/sailfish-userdebug/O<wbr>PR1.170621.001]@@@'<br>
@@@BUILD_STEP run sanitizer_common tests<br>
[aarch64/sailfish-userdebug/OP<wbr>R1.170621.001]@@@<br>
<br>
<br>
<br>
On Thu, Aug 17, 2017 at 5:42 PM, Geoff Berry<br>
<<a href="mailto:gberry@codeaurora.org" target="_blank">gberry@codeaurora.org</a> <mailto:<a href="mailto:gberry@codeaurora.org" target="_blank">gberry@codeaurora.org</a>><br>
<mailto:<a href="mailto:gberry@codeaurora.org" target="_blank">gberry@codeaurora.org</a><br>
<mailto:<a href="mailto:gberry@codeaurora.org" target="_blank">gberry@codeaurora.org</a>><wbr>>> wrote:<br>
<br>
It seems like this is still happening after fixing a<br>
couple of<br>
issues with this patch. I'll revert again shortly. I'm having<br>
a hard time understanding what is failing from looking<br>
at the<br>
buildbot logs though. Do you have any way of<br>
determining what<br>
exactly is timing out?<br>
<br>
On 8/16/2017 11:13 PM, Vitaly Buka wrote:<br>
<br>
Looks like after this patch Android tests<br>
consistently hang<br>
<a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/1825" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/build<wbr>ers/sanitizer-x86_64-linux-and<wbr>roid/builds/1825</a> <br>
<<a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/1825" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/buil<wbr>ders/sanitizer-x86_64-linux-an<wbr>droid/builds/1825</a>> <br>
<<a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/1825" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/buil<wbr>ders/sanitizer-x86_64-linux-an<wbr>droid/builds/1825</a> <br>
<<a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/1825" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/buil<wbr>ders/sanitizer-x86_64-linux-an<wbr>droid/builds/1825</a>>> <br>
<br>
On Wed, Aug 16, 2017 at 1:50 PM, Geoff Berry via<br>
llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<mailto:<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llv<wbr>m.org</a>><br>
<mailto:<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llv<wbr>m.org</a><br>
<mailto:<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llv<wbr>m.org</a>>><br>
<mailto:<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llv<wbr>m.org</a><br>
<mailto:<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llv<wbr>m.org</a>><br>
<mailto:<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llv<wbr>m.org</a><br>
<mailto:<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llv<wbr>m.org</a>>>>> wrote:<br>
<br>
Author: gberry<br>
Date: Wed Aug 16 13:50:01 2017<br>
New Revision: 311038<br>
<br>
URL:<br>
<a href="http://llvm.org/viewvc/llvm-project?rev=311038&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=311038&view=rev</a><br>
<<a href="http://llvm.org/viewvc/llvm-project?rev=311038&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject?rev=311038&view=rev</a>><br>
<<a href="http://llvm.org/viewvc/llvm-project?rev=311038&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject?rev=311038&view=rev</a><br>
<<a href="http://llvm.org/viewvc/llvm-project?rev=311038&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject?rev=311038&view=rev</a>>><br>
<<a href="http://llvm.org/viewvc/llvm-project?rev=311038&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject?rev=311038&view=rev</a><br>
<<a href="http://llvm.org/viewvc/llvm-project?rev=311038&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject?rev=311038&view=rev</a>><br>
<<a href="http://llvm.org/viewvc/llvm-project?rev=311038&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject?rev=311038&view=rev</a><br>
<<a href="http://llvm.org/viewvc/llvm-project?rev=311038&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject?rev=311038&view=rev</a>>>><br>
Log:<br>
[MachineCopyPropagation] Extend pass to do<br>
COPY source<br>
forwarding<br>
<br>
This change extends MachineCopyPropagation to<br>
do COPY<br>
source forwarding.<br>
<br>
This change also extends the<br>
MachineCopyPropagation<br>
pass to be able to<br>
be run during register allocation, after physical<br>
registers have been<br>
assigned, but before the virtual registers<br>
have been<br>
re-written, which<br>
allows it to remove virtual register COPY<br>
LiveIntervals<br>
that become dead<br>
through the forwarding of all of their uses.<br>
<br>
Reviewers: qcolombet, javed.absar, MatzeB, jonpa<br>
<br>
Subscribers: jyknight, nemanjai, llvm-commits,<br>
nhaehnle, mcrosier,<br>
mgorny<br>
<br>
Differential Revision:<br>
<a href="https://reviews.llvm.org/D30751" rel="noreferrer" target="_blank">https://reviews.llvm.org/D3075<wbr>1</a> <<a href="https://reviews.llvm.org/D30751" rel="noreferrer" target="_blank">https://reviews.llvm.org/D307<wbr>51</a>><br>
<<a href="https://reviews.llvm.org/D30751" rel="noreferrer" target="_blank">https://reviews.llvm.org/D307<wbr>51</a><br>
<<a href="https://reviews.llvm.org/D30751" rel="noreferrer" target="_blank">https://reviews.llvm.org/D307<wbr>51</a>>><br>
<<a href="https://reviews.llvm.org/D30751" rel="noreferrer" target="_blank">https://reviews.llvm.org/D307<wbr>51</a><br>
<<a href="https://reviews.llvm.org/D30751" rel="noreferrer" target="_blank">https://reviews.llvm.org/D307<wbr>51</a>><br>
<<a href="https://reviews.llvm.org/D30751" rel="noreferrer" target="_blank">https://reviews.llvm.org/D307<wbr>51</a><br>
<<a href="https://reviews.llvm.org/D30751" rel="noreferrer" target="_blank">https://reviews.llvm.org/D307<wbr>51</a>>>><br>
<br>
Modified:<br>
llvm/trunk/include/llvm/CodeG<wbr>en/Passes.h<br>
llvm/trunk/include/llvm/Initi<wbr>alizePasses.h<br>
llvm/trunk/lib/CodeGen/CodeGe<wbr>n.cpp<br>
llvm/trunk/lib/CodeGen/Machin<wbr>eCopyPropagation.cpp<br>
llvm/trunk/lib/CodeGen/Target<wbr>PassConfig.cpp<br>
llvm/trunk/test/CodeGen/AArc<wbr>h64/aarch64-fold-lslfast.ll<br>
llvm/trunk/test/CodeGen/AArc<wbr>h64/arm64-AdvSIMD-Scalar.ll<br>
llvm/trunk/test/CodeGen/AArc<wbr>h64/arm64-zero-cycle-regmov.ll<br>
llvm/trunk/test/CodeGen/AArch<wbr>64/f16-instructions.ll<br>
llvm/trunk/test/CodeGen/AArch<wbr>64/flags-multiuse.ll<br>
llvm/trunk/test/CodeGen/AArc<wbr>h64/merge-store-dependency.ll<br>
llvm/trunk/test/CodeGen/AArch<wbr>64/neg-imm.ll<br>
llvm/trunk/test/CodeGen/AMDGP<wbr>U/byval-frame-setup.ll<br>
llvm/trunk/test/CodeGen/AMDGP<wbr>U/call-argument-types.ll<br>
llvm/trunk/test/CodeGen/AMDG<wbr>PU/call-preserved-registers.ll<br>
llvm/trunk/test/CodeGen/AMDG<wbr>PU/callee-special-input-sgprs.<wbr>ll<br>
llvm/trunk/test/CodeGen/AMDG<wbr>PU/callee-special-input-vgprs.<wbr>ll<br>
llvm/trunk/test/CodeGen/AMDGP<wbr>U/mubuf-offset-private.ll<br>
llvm/trunk/test/CodeGen/AMDGP<wbr>U/multilevel-break.ll<br>
llvm/trunk/test/CodeGen/AMDG<wbr>PU/private-access-no-objects.l<wbr>l<br>
llvm/trunk/test/CodeGen/AMDGP<wbr>U/ret.ll<br>
llvm/trunk/test/CodeGen/ARM/a<wbr>tomic-op.ll<br>
llvm/trunk/test/CodeGen/ARM/s<wbr>wifterror.ll<br>
llvm/trunk/test/CodeGen/Mips/<wbr>llvm-ir/sub.ll<br>
llvm/trunk/test/CodeGen/Power<wbr>PC/fma-mutate.ll<br>
llvm/trunk/test/CodeGen/Power<wbr>PC/inlineasm-i64-reg.ll<br>
llvm/trunk/test/CodeGen/Power<wbr>PC/tail-dup-layout.ll<br>
llvm/trunk/test/CodeGen/SPARC<wbr>/32abi.ll<br>
llvm/trunk/test/CodeGen/SPARC<wbr>/atomics.ll<br>
llvm/trunk/test/CodeGen/Thumb<wbr>/thumb-shrink-wrapping.ll<br>
llvm/trunk/test/CodeGen/X86/<wbr>2006-03-01-InstrSchedBug.ll<br>
llvm/trunk/test/CodeGen/X86/a<wbr>rg-copy-elide.ll<br>
llvm/trunk/test/CodeGen/X86/a<wbr>vg.ll<br>
llvm/trunk/test/CodeGen/X86/a<wbr>vx-load-store.ll<br>
llvm/trunk/test/CodeGen/X86/a<wbr>vx512-bugfix-25270.ll<br>
llvm/trunk/test/CodeGen/X86/a<wbr>vx512-calling-conv.ll<br>
llvm/trunk/test/CodeGen/X86/a<wbr>vx512-mask-op.ll<br>
llvm/trunk/test/CodeGen/X86/<wbr>avx512bw-intrinsics-upgrade.ll<br>
llvm/trunk/test/CodeGen/X86/<wbr>bitcast-int-to-vector-bool-sex<wbr>t.ll<br>
llvm/trunk/test/CodeGen/X86/<wbr>bitcast-int-to-vector-bool-zex<wbr>t.ll<br>
llvm/trunk/test/CodeGen/X86/b<wbr>uildvec-insertvec.ll<br>
llvm/trunk/test/CodeGen/X86/c<wbr>ombine-fcopysign.ll<br>
llvm/trunk/test/CodeGen/X86/c<wbr>omplex-fastmath.ll<br>
llvm/trunk/test/CodeGen/X86/d<wbr>ivide-by-constant.ll<br>
llvm/trunk/test/CodeGen/X86/f<wbr>maxnum.ll<br>
llvm/trunk/test/CodeGen/X86/f<wbr>minnum.ll<br>
llvm/trunk/test/CodeGen/X86/f<wbr>p128-i128.ll<br>
llvm/trunk/test/CodeGen/X86/h<wbr>addsub-2.ll<br>
llvm/trunk/test/CodeGen/X86/h<wbr>addsub-undef.ll<br>
llvm/trunk/test/CodeGen/X86/h<wbr>alf.ll<br>
llvm/trunk/test/CodeGen/X86/i<wbr>nline-asm-fpstack.ll<br>
llvm/trunk/test/CodeGen/X86/i<wbr>pra-local-linkage.ll<br>
llvm/trunk/test/CodeGen/X86/l<wbr>ocalescape.ll<br>
llvm/trunk/test/CodeGen/X86/m<wbr>ul-i1024.ll<br>
llvm/trunk/test/CodeGen/X86/m<wbr>ul-i512.ll<br>
llvm/trunk/test/CodeGen/X86/m<wbr>ul128.ll<br>
llvm/trunk/test/CodeGen/X86/p<wbr>mul.ll<br>
llvm/trunk/test/CodeGen/X86/p<wbr>owi.ll<br>
llvm/trunk/test/CodeGen/X86/p<wbr>r11334.ll<br>
llvm/trunk/test/CodeGen/X86/p<wbr>r29112.ll<br>
llvm/trunk/test/CodeGen/X86/p<wbr>subus.ll<br>
llvm/trunk/test/CodeGen/X86/s<wbr>elect.ll<br>
llvm/trunk/test/CodeGen/X86/s<wbr>hrink-wrap-chkstk.ll<br>
llvm/trunk/test/CodeGen/X86/s<wbr>qrt-fastmath.ll<br>
llvm/trunk/test/CodeGen/X86/s<wbr>se-scalar-fp-arith.ll<br>
llvm/trunk/test/CodeGen/X86/s<wbr>se1.ll<br>
llvm/trunk/test/CodeGen/X86/s<wbr>se3-avx-addsub-2.ll<br>
llvm/trunk/test/CodeGen/X86/s<wbr>tatepoint-live-in.ll<br>
llvm/trunk/test/CodeGen/X86/s<wbr>tatepoint-stack-usage.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>ec_fp_to_int.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>ec_int_to_fp.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>ec_minmax_sint.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>ec_shift4.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>ector-blend.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>ector-idiv-sdiv-128.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>ector-idiv-udiv-128.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>ector-rotate-128.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>ector-sext.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>ector-shift-ashr-128.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>ector-shift-lshr-128.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>ector-shift-shl-128.ll<br>
llvm/trunk/test/CodeGen/X86/<wbr>vector-shuffle-combining.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>ector-trunc-math.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>ector-zext.ll<br>
llvm/trunk/test/CodeGen/X86/v<wbr>select-minmax.ll<br>
llvm/trunk/test/CodeGen/X86/w<wbr>iden_conv-3.ll<br>
llvm/trunk/test/CodeGen/X86/w<wbr>iden_conv-4.ll<br>
llvm/trunk/test/CodeGen/X86/x<wbr>86-shrink-wrap-unwind.ll<br>
llvm/trunk/test/CodeGen/X86/x<wbr>86-shrink-wrapping.ll<br>
<br>
Modified: llvm/trunk/include/llvm/CodeGe<wbr>n/Passes.h<br>
URL:<br>
<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/include/llvm/<wbr>CodeGen/Passes.h?rev=311038&r1<wbr>=311037&r2=311038&view=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/include/llvm<wbr>/CodeGen/Passes.h?rev=311038&r<wbr>1=311037&r2=311038&view=diff</a>> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/include/llvm<wbr>/CodeGen/Passes.h?rev=311038&r<wbr>1=311037&r2=311038&view=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/include/llvm<wbr>/CodeGen/Passes.h?rev=311038&r<wbr>1=311037&r2=311038&view=diff</a>>> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/include/llvm<wbr>/CodeGen/Passes.h?rev=311038&r<wbr>1=311037&r2=311038&view=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/include/llvm<wbr>/CodeGen/Passes.h?rev=311038&r<wbr>1=311037&r2=311038&view=diff</a>> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/include/llvm<wbr>/CodeGen/Passes.h?rev=311038&r<wbr>1=311037&r2=311038&view=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/Passes.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/include/llvm<wbr>/CodeGen/Passes.h?rev=311038&r<wbr>1=311037&r2=311038&view=diff</a>>><wbr>> <br>
==============================<wbr>==============================<wbr>================== <br>
--- llvm/trunk/include/llvm/CodeGe<wbr>n/Passes.h<br>
(original)<br>
+++ llvm/trunk/include/llvm/CodeGe<wbr>n/Passes.h<br>
Wed Aug 16<br>
13:50:01 2017<br>
@@ -278,6 +278,11 @@ namespace llvm {<br>
/// MachineSinking - This pass performs<br>
sinking on<br>
machine<br>
instructions.<br>
extern char &MachineSinkingID;<br>
<br>
+ /// MachineCopyPropagationPreRegRe<wbr>write -<br>
This pass<br>
performs copy<br>
propagation<br>
+ /// on machine instructions after register<br>
allocation but before<br>
virtual<br>
+ /// register re-writing..<br>
+ extern char<br>
&MachineCopyPropagationPreRegR<wbr>ewriteID;<br>
+<br>
/// MachineCopyPropagation - This pass<br>
performs<br>
copy propagation on<br>
/// machine instructions.<br>
extern char &MachineCopyPropagationID;<br>
<br>
Modified:<br>
llvm/trunk/include/llvm/Initia<wbr>lizePasses.h<br>
URL:<br>
<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/include/llvm/<wbr>InitializePasses.h?rev=311038&<wbr>r1=311037&r2=311038&view=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/include/llvm<wbr>/InitializePasses.h?rev=311038<wbr>&r1=311037&r2=311038&view=diff</a><wbr>> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/include/llvm<wbr>/InitializePasses.h?rev=311038<wbr>&r1=311037&r2=311038&view=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/include/llvm<wbr>/InitializePasses.h?rev=311038<wbr>&r1=311037&r2=311038&view=diff</a><wbr>>> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/include/llvm<wbr>/InitializePasses.h?rev=311038<wbr>&r1=311037&r2=311038&view=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/include/llvm<wbr>/InitializePasses.h?rev=311038<wbr>&r1=311037&r2=311038&view=diff</a><wbr>> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/include/llvm<wbr>/InitializePasses.h?rev=311038<wbr>&r1=311037&r2=311038&view=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/include/llvm<wbr>/InitializePasses.h?rev=311038<wbr>&r1=311037&r2=311038&view=diff</a><wbr>>>> <br>
==============================<wbr>==============================<wbr>================== <br>
--- llvm/trunk/include/llvm/Initia<wbr>lizePasses.h<br>
(original)<br>
+++ llvm/trunk/include/llvm/Initia<wbr>lizePasses.h<br>
Wed Aug<br>
16 13:50:01 2017<br>
@@ -233,6 +233,7 @@ void<br>
initializeMachineBranchProbabi<wbr>lityI<br>
void initializeMachineCSEPass(PassR<wbr>egistry&);<br>
void<br>
initializeMachineCombinerPass(<wbr>PassRegistry&);<br>
void<br>
initializeMachineCopyPropagati<wbr>onPass(PassRegistry&);<br>
+void<br>
initializeMachineCopyPropagati<wbr>onPreRegRewritePass(PassRegist<wbr>ry&);<br>
void<br>
initializeMachineDominanceFro<wbr>ntierPass(PassRegistry&);<br>
void<br>
initializeMachineDominatorTree<wbr>Pass(PassRegistry&);<br>
void<br>
initializeMachineFunctionPrint<wbr>erPassPass(PassRegistry&);<br>
<br>
Modified: llvm/trunk/lib/CodeGen/CodeGen<wbr>.cpp<br>
URL:<br>
<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGen.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/CodeGen/C<wbr>odeGen.cpp?rev=311038&r1=31103<wbr>7&r2=311038&view=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGen.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/lib/CodeGen/<wbr>CodeGen.cpp?rev=311038&r1=3110<wbr>37&r2=311038&view=diff</a>> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGen.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/lib/CodeGen/<wbr>CodeGen.cpp?rev=311038&r1=3110<wbr>37&r2=311038&view=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGen.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/lib/CodeGen/<wbr>CodeGen.cpp?rev=311038&r1=3110<wbr>37&r2=311038&view=diff</a>>> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGen.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/lib/CodeGen/<wbr>CodeGen.cpp?rev=311038&r1=3110<wbr>37&r2=311038&view=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGen.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/lib/CodeGen/<wbr>CodeGen.cpp?rev=311038&r1=3110<wbr>37&r2=311038&view=diff</a>> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGen.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/lib/CodeGen/<wbr>CodeGen.cpp?rev=311038&r1=3110<wbr>37&r2=311038&view=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGen.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/lib/CodeGen/<wbr>CodeGen.cpp?rev=311038&r1=3110<wbr>37&r2=311038&view=diff</a>>>> <br>
==============================<wbr>==============================<wbr>================== <br>
--- llvm/trunk/lib/CodeGen/CodeGen<wbr>.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/CodeGen<wbr>.cpp Wed Aug 16<br>
13:50:01 2017<br>
@@ -54,6 +54,7 @@ void<br>
llvm::initializeCodeGen(PassRe<wbr>gistr<br>
initializeMachineCSEPass(Regis<wbr>try);<br>
initializeMachineCombinerPass(<wbr>Registry);<br>
initializeMachineCopyPropagati<wbr>onPass(Registry);<br>
+<br>
initializeMachineCopyPropagati<wbr>onPreRegRewritePass(Registry);<br>
initializeMachineDominatorTree<wbr>Pass(Registry);<br>
initializeMachineFunctionPrint<wbr>erPassPass(Registry);<br>
initializeMachineLICMPass(Regi<wbr>stry);<br>
<br>
Modified:<br>
llvm/trunk/lib/CodeGen/Machine<wbr>CopyPropagation.cpp<br>
URL:<br>
<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/llvm/trunk/lib/CodeGen/M<wbr>achineCopyPropagation.cpp?rev=<wbr>311038&r1=311037&r2=311038&vie<wbr>w=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/lib/CodeGen/<wbr>MachineCopyPropagation.cpp?rev<wbr>=311038&r1=311037&r2=311038&vi<wbr>ew=diff</a>> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/lib/CodeGen/<wbr>MachineCopyPropagation.cpp?rev<wbr>=311038&r1=311037&r2=311038&vi<wbr>ew=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/lib/CodeGen/<wbr>MachineCopyPropagation.cpp?rev<wbr>=311038&r1=311037&r2=311038&vi<wbr>ew=diff</a>>> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/lib/CodeGen/<wbr>MachineCopyPropagation.cpp?rev<wbr>=311038&r1=311037&r2=311038&vi<wbr>ew=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/lib/CodeGen/<wbr>MachineCopyPropagation.cpp?rev<wbr>=311038&r1=311037&r2=311038&vi<wbr>ew=diff</a>> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/lib/CodeGen/<wbr>MachineCopyPropagation.cpp?rev<wbr>=311038&r1=311037&r2=311038&vi<wbr>ew=diff</a> <br>
<<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp?rev=311038&r1=311037&r2=311038&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-p<wbr>roject/llvm/trunk/lib/CodeGen/<wbr>MachineCopyPropagation.cpp?rev<wbr>=311038&r1=311037&r2=311038&vi<wbr>ew=diff</a>>>> <br>
==============================<wbr>==============================<wbr>================== <br>
---<br>
llvm/trunk/lib/CodeGen/Machine<wbr>CopyPropagation.cpp<br>
(original)<br>
+++<br>
llvm/trunk/lib/CodeGen/Machine<wbr>CopyPropagation.cpp<br>
Wed Aug 16<br>
13:50:01 2017<br>
@@ -7,18 +7,62 @@<br>
//<br>
//===-------------------------<wbr>------------------------------<wbr>---------------===// <br>
//<br>
-// This is an extremely simple<br>
MachineInstr-level copy<br>
propagation<br>
pass.<br>
+// This is a simple MachineInstr-level copy<br>
forwarding<br>
pass. It<br>
may be run at<br>
+// two places in the codegen pipeline:<br>
+// - After register allocation but before<br>
virtual<br>
registers have<br>
been remapped<br>
+// to physical registers.<br>
+// - After physical register remapping.<br>
+//<br>
+// The optimizations done vary slightly based on<br>
whether virtual<br>
registers are<br>
+// still present. In both cases, this pass<br>
forwards<br>
the source of<br>
COPYs to the<br>
+// users of their destinations when doing so is<br>
legal. For example:<br>
+//<br>
+// %vreg1 = COPY %vreg0<br>
+// ...<br>
+// ... = OP %vreg1<br>
+//<br>
+// If<br>
+// - the physical register assigned to<br>
%vreg0 has<br>
not been<br>
clobbered by the<br>
+// time of the use of %vreg1<br>
+// - the register class constraints are<br>
satisfied<br>
+// - the COPY def is the only value that<br>
reaches OP<br>
+// then this pass replaces the above with:<br>
+//<br>
+// %vreg1 = COPY %vreg0<br>
+// ...<br>
+// ... = OP %vreg0<br>
+//<br>
+// and updates the relevant state required by<br>
VirtRegMap (e.g.<br>
LiveIntervals).<br>
+// COPYs whose LiveIntervals become dead as a<br>
result<br>
of this<br>
forwarding (i.e. if<br>
+// all uses of %vreg1 are changed to %vreg0)<br>
are removed.<br>
+//<br>
+// When being run with only physical<br>
registers, this<br>
pass will also<br>
remove some<br>
+// redundant COPYs. For example:<br>
+//<br>
+// %R1 = COPY %R0<br>
+// ... // No clobber of %R1<br>
+// %R0 = COPY %R1 <<< Removed<br>
+//<br>
+// or<br>
+//<br>
+// %R1 = COPY %R0<br>
+// ... // No clobber of %R0<br>
+// %R1 = COPY %R0 <<< Removed<br>
//<br>
//===-------------------------<wbr>------------------------------<wbr>---------------===// <br>
<br>
+#include "LiveDebugVariables.h"<br>
#include "llvm/ADT/DenseMap.h"<br>
#include "llvm/ADT/SetVector.h"<br>
#include "llvm/ADT/SmallVector.h"<br>
#include "llvm/ADT/Statistic.h"<br>
+#include "llvm/CodeGen/LiveRangeEdit.h"<br>
+#include "llvm/CodeGen/LiveStackAnalysi<wbr>s.h"<br>
#include "llvm/CodeGen/MachineFunction.<wbr>h"<br>
#include "llvm/CodeGen/MachineFunctionP<wbr>ass.h"<br>
#include "llvm/CodeGen/MachineRegisterI<wbr>nfo.h"<br>
#include "llvm/CodeGen/Passes.h"<br>
+#include "llvm/CodeGen/VirtRegMap.h"<br>
#include "llvm/Pass.h"<br>
#include "llvm/Support/Debug.h"<br>
#include "llvm/Support/raw_ostream.h"<br>
@@ -30,24 +74,48 @@ using namespace llvm;<br>
#define DEBUG_TYPE "machine-cp"<br>
<br>
STATISTIC(NumDeletes, "Number of dead copies<br>
deleted");<br>
+STATISTIC(NumCopyForwards, "Number of copy uses<br>
forwarded");<br>
<br>
namespace {<br>
typedef SmallVector<unsigned, 4> RegList;<br>
typedef DenseMap<unsigned, RegList> SourceMap;<br>
typedef DenseMap<unsigned, MachineInstr*><br>
Reg2MIMap;<br>
<br>
- class MachineCopyPropagation : public<br>
MachineFunctionPass {<br>
+ class MachineCopyPropagation : public<br>
MachineFunctionPass,<br>
+ private<br>
LiveRangeEdit::Delegate {<br>
const TargetRegisterInfo *TRI;<br>
const TargetInstrInfo *TII;<br>
- const MachineRegisterInfo *MRI;<br>
+ MachineRegisterInfo *MRI;<br>
+ MachineFunction *MF;<br>
+ SlotIndexes *Indexes;<br>
+ LiveIntervals *LIS;<br>
+ const VirtRegMap *VRM;<br>
+ // True if this pass being run before virtual<br>
registers are<br>
remapped to<br>
+ // physical ones.<br>
+ bool PreRegRewrite;<br>
+ bool NoSubRegLiveness;<br>
+<br>
+ protected:<br>
+ MachineCopyPropagation(char &ID, bool<br>
PreRegRewrite)<br>
+ : MachineFunctionPass(ID),<br>
PreRegRewrite(PreRegRewrite) {}<br>
<br>
public:<br>
static char ID; // Pass identification,<br>
replacement for typeid<br>
- MachineCopyPropagation() :<br>
MachineFunctionPass(ID) {<br>
+ MachineCopyPropagation() :<br>
MachineCopyPropagation(ID, false) {<br>
initializeMachineCopyPropagati<wbr>onPass(*PassRegistry::getPassR<wbr>egistry());<br>
}<br>
<br>
void getAnalysisUsage(AnalysisUsage &AU)<br>
const<br>
override {<br>
+ if (PreRegRewrite) {<br>
+ AU.addRequired<SlotIndexes>();<br>
+ AU.addPreserved<SlotIndexes>()<wbr>;<br>
+ AU.addRequired<LiveIntervals>(<wbr>);<br>
+ AU.addPreserved<LiveIntervals><wbr>();<br>
+ AU.addRequired<VirtRegMap>();<br>
+ AU.addPreserved<VirtRegMap>();<br>
+ AU.addPreserved<LiveDebugVaria<wbr>bles>();<br>
+ AU.addPreserved<LiveStacks>();<br>
+ }<br>
AU.setPreservesCFG();<br>
MachineFunctionPass::getAnalys<wbr>isUsage(AU);<br>
}<br>
@@ -55,6 +123,10 @@ namespace {<br>
bool<br>
runOnMachineFunction(MachineFu<wbr>nction &MF)<br>
override;<br>
<br>
MachineFunctionProperties<br>
getRequiredProperties()<br>
const override {<br>
+ if (PreRegRewrite)<br>
+ return MachineFunctionProperties()<br>
+ .set(MachineFunctionPropertie<wbr>s::Property::NoPHIs)<br>
+ .set(MachineFunctionPropertie<wbr>s::Property::TracksLiveness);<br>
return MachineFunctionProperties().se<wbr>t(<br>
MachineFunctionProperties::Pro<wbr>perty::NoVRegs);<br>
}<br>
@@ -64,6 +136,28 @@ namespace {<br>
void ReadRegister(unsigned Reg);<br>
void<br>
CopyPropagateBlock(MachineBasi<wbr>cBlock &MBB);<br>
bool eraseIfRedundant(MachineInstr &Copy,<br>
unsigned Src,<br>
unsigned Def);<br>
+ unsigned getPhysReg(unsigned Reg,<br>
unsigned SubReg);<br>
+ unsigned getPhysReg(const MachineOperand<br>
&Opnd) {<br>
+ return getPhysReg(Opnd.getReg(),<br>
Opnd.getSubReg());<br>
+ }<br>
+ unsigned getFullPhysReg(const<br>
MachineOperand &Opnd) {<br>
+ return getPhysReg(Opnd.getReg(), 0);<br>
+ }<br>
+ void forwardUses(MachineInstr &MI);<br>
+ bool isForwardableRegClassCopy(cons<wbr>t<br>
MachineInstr<br>
&Copy,<br>
+ const<br>
MachineInstr<br>
&UseI);<br>
+ std::tuple<unsigned, unsigned, bool><br>
+ checkUseSubReg(const MachineOperand<br>
&CopySrc, const<br>
MachineOperand &MOUse);<br>
+ bool hasImplicitOverlap(const<br>
MachineInstr &MI, const<br>
MachineOperand &Use);<br>
+ void narrowRegClass(const MachineInstr<br>
&MI, const<br>
MachineOperand &MOUse,<br>
+ unsigned NewUseReg,<br>
unsigned<br>
NewUseSubReg);<br>
+ void updateForwardedCopyLiveInterva<wbr>l(const<br>
MachineInstr &Copy,<br>
+ const<br>
MachineInstr &UseMI,<br>
+ unsigned<br>
OrigUseReg,<br>
+ unsigned<br>
NewUseReg,<br>
+ unsigned<br>
NewUseSubReg);<br>
+ /// LiveRangeEdit callback for<br>
eliminateDeadDefs().<br>
+ void<br>
LRE_WillEraseInstruction(Machi<wbr>neInstr *MI)<br>
override;<br>
<br>
/// Candidates for deletion.<br>
SmallSetVector<MachineInstr*, 8><br>
MaybeDeadCopies;<br>
@@ -75,6 +169,15 @@ namespace {<br>
SourceMap SrcMap;<br>
bool Changed;<br>
};<br>
+<br>
+ class MachineCopyPropagationPreRegRe<wbr>write :<br>
public<br>
MachineCopyPropagation {<br>
+ public:<br>
+ static char ID; // Pass identification,<br>
replacement for typeid<br>
+ MachineCopyPropagationPreRegRe<wbr>write()<br>
+ : MachineCopyPropagation(ID, true) {<br></div></div><span class="">
+ initializeMachineCopyPropagat<wbr>ionPreRegRewritePass(*PassRegi<wbr>stry::getPassRegistry()); <br>
+ }<br>
+ };<br>
}<br>
char MachineCopyPropagation::ID = 0;<br>
char &llvm::MachineCopyPropagationI<wbr>D =<br>
MachineCopyPropagation::ID;<br>
@@ -82,6 +185,29 @@ char</span></blockquote></blockquote>
</blockquote></div><br></div>
</blockquote></div><br></div>