[PATCH] D19255: [ppc64] fix bug in prologue that mfocrf's cr operand should be explict state instead of implicit

Kit Barton via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 08:41:37 PDT 2016


kbarton accepted this revision.
kbarton added a comment.
This revision is now accepted and ready to land.

LGTM.


================
Comment at: lib/Target/PowerPC/PPCFrameLowering.cpp:846
@@ -845,2 +845,3 @@
     unsigned MfcrOpcode = PPC::MFCR8;
-    if (isELFv2ABI && MustSaveCRs.size() == 1)
+    unsigned CrState = RegState::ImplicitKill;
+    if (isELFv2ABI && MustSaveCRs.size() == 1) {
----------------
cycheng wrote:
> kbarton wrote:
> > Why does this need to be put into a variable? I only see it used once below - can you not just put RegState::ImplicitKill directly in the MIB.addReg call below?
> Do you mean:
> 
> 
> ```
> MIB.addReg(MustSaveCRs[i], MfcrOpcode == PPC::MFCR8 ? RegState::ImplicitKill : RegState::Kill);
> ```
Sorry, for some reason I missed the initialization. This is fine as is. 


http://reviews.llvm.org/D19255





More information about the llvm-commits mailing list