[PATCH] D25500: AMDGPU: Workaround for instruction size with literals

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 14 09:52:13 PDT 2016


arsenm updated this revision to Diff 74707.
arsenm added a comment.

Attach right patch


https://reviews.llvm.org/D25500

Files:
  lib/Target/AMDGPU/SIInstrInfo.cpp


Index: lib/Target/AMDGPU/SIInstrInfo.cpp
===================================================================
--- lib/Target/AMDGPU/SIInstrInfo.cpp
+++ lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -3449,7 +3449,10 @@
 
   // If we have a definitive size, we can use it. Otherwise we need to inspect
   // the operands to know the size.
-  if (DescSize != 0)
+  //
+  // FIXME: Instructions that have a base 32-bit encoding report their size as
+  // 4, even though they are really 8 bytes if they have a literal operand.
+  if (DescSize != 0 && DescSize != 4)
     return DescSize;
 
   // 4-byte instructions may have a 32-bit literal encoded after them. Check
@@ -3472,6 +3475,9 @@
     return 4;
   }
 
+  if (DescSize == 4)
+    return 4;
+
   switch (Opc) {
   case TargetOpcode::IMPLICIT_DEF:
   case TargetOpcode::KILL:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25500.74707.patch
Type: text/x-patch
Size: 818 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161014/8d23bd55/attachment.bin>


More information about the llvm-commits mailing list