[PATCH] D55909: [ARM] Set Defs = [CPSR] for COPY_STRUCT_BYVAL, as it clobbers CPSR.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 20 18:20:03 PST 2018


fhahn marked an inline comment as done.
fhahn added inline comments.


================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:9009
+    exitMBB->addLiveIn(ARM::CPSR);
+  }
+
----------------
efriedma wrote:
> fhahn wrote:
> > efriedma wrote:
> > > Hang on... doesn't the loop clobber CPSR?  I think rather than add the live-in marking like this, we need to mark COPY_STRUCT_BYVAL_I32 with "Defs = [CPSR]".
> > Yes, at least when not in Thumb1, we define CPSR in the loop. I guess something could still potentially use CPSR after the COPY_STRUCT_BYVAL, then we would still need it in the live-ins. Not sure if that would make sense though.
> Presumably nothing is ever going to use the CPSR def of a COPY_STRUCT_BYVAL... we would have to add explicit logic for that, and the loop sets CPSR to a fixed value which isn't generally useful.
Right thanks, so for now I guess we can just mark it with Defs = [CPSR].


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55909/new/

https://reviews.llvm.org/D55909





More information about the llvm-commits mailing list