[PATCH] D40851: [AMDGPU] Improve verifier wrt vcc subregs

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 13:12:40 PST 2017


rampitec added inline comments.


================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:2739
         if (MO.isReg()) {
-          if (MO.getReg() != SGPRUsed)
+          if (SGPRUsed == AMDGPU::NoRegister ||
+              !RI.regsOverlap(MO.getReg(), SGPRUsed))
----------------
arsenm wrote:
> Why would noreg count as a constant bus use? I wouldn't expect to see a noreg operand ever reach here
Is we had no SGPRUsed before it is initialized with NoRegister. Now as we found a used SGPR and it is not the same as was used before we shall record it. It is in fact the same behavior as before, just NoRegister cannot be passed into regsOverlap().


================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:2740
+          if (SGPRUsed == AMDGPU::NoRegister ||
+              !RI.regsOverlap(MO.getReg(), SGPRUsed))
             ++ConstantBusCount;
----------------
arsenm wrote:
> I'm not sure this is correct. Consider:
> 
> v_cndmask_b32_e32 v0, vcc_hi, v1, <implicit vcc>
> 
> I'm not sure if this is valid or not.
I think it is valid as we are going to read the whole pair in any way.


https://reviews.llvm.org/D40851





More information about the llvm-commits mailing list