[PATCH] D13085: AMDGPU: Simplify VOP2 operand legalization

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 12:41:02 PDT 2015


tstellarAMD added inline comments.

================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:802-805
@@ +801,6 @@
+
+  if (isVOP2(MI->getOpcode())) {
+    const MCInstrDesc &InstrDesc = get(MI->getOpcode());
+    // For VOP2 instructions, any operand type is valid to use for src0.  Make
+    // sure we can use the src1 as src0.
+    //
----------------
This isn't true for instructions with implicit defs/uses of VCC. 

I prefer the explicit operand checking for legalization rather than make assumptions based on the instruction type, because there are usually one or two corner cases for each instruction type.


http://reviews.llvm.org/D13085





More information about the llvm-commits mailing list