[PATCH] D54882: [AMDGPU] Add sdwa support for ADD|SUB U64 decomposed Pseudos

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 2 09:34:33 PST 2018


rampitec added inline comments.


================
Comment at: lib/Target/AMDGPU/SIPeepholeSDWA.cpp:915
+  for (MachineBasicBlock::const_iterator I = MI; I != MISucc;
+       I = std::next(I)) {
+    if (I->modifiesRegister(AMDGPU::VCC, TRI))
----------------
ronlieb wrote:
> rampitec wrote:
> > I mean you do not have to check MI itself. ++I was OK:
> > 
> > 
> > ```
> > MachineBasicBlock::const_iterator I = std::next(MI);
> > ```
> i could not use std::next(MI) in the initializer, it caused bus errors for consective  MI,MISucc.
> 
> This works 
> +  // Check if VCC is referenced in range of (MI,MISucc].
> +  MachineBasicBlock::const_iterator I = MI;
> +  for (++I; I != MISucc; ++I) {
> 
Take the iterator.


================
Comment at: test/CodeGen/AMDGPU/sdwa-ops.mir:386
+    $vcc = COPY %30
+    %31:vreg_64 = COPY $vcc
+    %64:vgpr_32, %66:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, %65, implicit $exec
----------------
killed $vcc


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

https://reviews.llvm.org/D54882





More information about the llvm-commits mailing list