[PATCH] D23172: IfConversion: Add implicit uses for live subregisters

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 10:26:10 PDT 2016


kparzysz added inline comments.

================
Comment at: lib/CodeGen/IfConversion.cpp:1456-1460
@@ -1455,2 +1455,7 @@
       MIB.addReg(Reg, RegState::Implicit);
+    else {
+      for (MCSubRegIterator S(Reg, TRI); S.isValid(); ++S)
+        if (LiveBeforeMI.count(*S))
+          MIB.addReg(*S, RegState::Implicit);
+    }
   }
----------------
MatzeB wrote:
> Would it be more reasonable to check if any subreg is alive and then only add a single implicit use for `Reg`. Otherwise I'd be concerned that we end up with a large number of implicit-use operands for deep register hierarchies.
I've been thinking about it.  What about this case?

```
Live-in: %H
if (...) {
  // Define/use super-reg.
  %H:L = ...
  ... = %H:L
}
// %H is still live here
... = %H
```

After if-conversion we would end up with something like
```
%H:L = predicated ..., %H:L<imp-use>
... = predicated %H:L
```

Wouldn't the implicit use be invalid (since %L is not defined)?


Repository:
  rL LLVM

https://reviews.llvm.org/D23172





More information about the llvm-commits mailing list