[PATCH] D55402: [AMDGPU] Simplify negated condition

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 11 13:20:02 PST 2018


rampitec marked 2 inline comments as done.
rampitec added inline comments.


================
Comment at: lib/Target/AMDGPU/SIRegisterInfo.cpp:1617
+    if (!LIS->hasInterval(Reg))
+      return nullptr;
+    LiveInterval &LI = LIS->getInterval(Reg);
----------------
arsenm wrote:
> Isn’t there a get cached interval or is that only for regunits?
Right, there is getCachedRegUnit(), but not getCachedLiventerval().


================
Comment at: lib/Target/AMDGPU/SIRegisterInfo.cpp:1641
+        if (!DefIdx.isValid() ||
+            MDT.dominates(LIS->getInstructionFromIndex(DefIdx),
+                          LIS->getInstructionFromIndex(V->def)))
----------------
arsenm wrote:
> Do you actually need the dominate check? Don’t you implicitly do that when comparing the value numbers?
This is physreg. I need to find a last def. Unfortunately individual reg units get individual LiveRanges, unlike virtual registers. So if I query a def of VCC I am getting two individual VNI for VCC_LO and VCC_HI and need to compare to find a last one. This is checked by negated_cond_vop2_redef_vcc2 test, which miscompiles w/o this check.


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

https://reviews.llvm.org/D55402





More information about the llvm-commits mailing list