[PATCH] D16785: [AArch64] AArch64LoadStoreOptimizer: fix bug in pre-inc check iterator

Chad Rosier via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 13:31:47 PST 2016

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

LGTM once you've addressed the minor nits.

Comment at: lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp:957
@@ -956,1 +956,3 @@
     unsigned Reg = MO.getReg();
+    if (!Reg)
+      continue;
gberry wrote:
> mcrosier wrote:
> > Did you mean to delete lines 954 and 955?  Otherwise, I'm not sure why this check would be necessary.
> No, lines 954, 955 filter out non-register operands, this new check filters out register operands of register 0, which is not a real register.  These can show up in dbg_value instructions, which I removed as a special case in the loop below.
> This idiom (check for reg operand, then check for reg != 0) appears in quite a few places.
Ah, the subtle difference between !isReg and !getReg..  Thanks for the clarification.


More information about the llvm-commits mailing list