[PATCH] D11370: Improved the interface of methods commuting operands, improved X86-FMA3 mem-folding&coalescing.

Vyacheslav Klochkov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 17:04:36 PDT 2015


v_klochkov added a comment.

Please see my answer regarding the new assert in AMDGPU version of commuteInstructionImpl() method.
Thanks,
Slava


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:796
@@ -786,2 +795,3 @@
                                            AMDGPU::OpName::src1);
-  if (Src1Idx == -1)
+  assert(Src1Idx != -1 && "Should always have src1 operand");
+
----------------
qcolombet wrote:
> I still don't get why we need to turn this if into an assert.
(Src1Idx == -1) is impossible here as this place is reachable only after findCommutedOpIndices() call which filters out such situations.
This assert for Src1Idx is semantically and stylistically equivalent to the assert at the line 788 (assert for Src0Idx).


http://reviews.llvm.org/D11370





More information about the llvm-commits mailing list