]> granicus.if.org Git - llvm/commitdiff
AMDGPU: Fix code size for return_to_epilog pseudo
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 27 Jul 2018 09:15:03 +0000 (09:15 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 27 Jul 2018 09:15:03 +0000 (09:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338113 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AMDGPU/SIInstrInfo.cpp
lib/Target/AMDGPU/SIInstructions.td
test/CodeGen/AMDGPU/ret.ll

index 41c029c9c785316b195f7c46c312cb722965ee8c..6c85c92454c39801f35c5ad319cc4cc4296b7d64 100644 (file)
@@ -4753,12 +4753,12 @@ unsigned SIInstrInfo::getInstSizeInBytes(const MachineInstr &MI) const {
   if (DescSize != 0 && DescSize != 4)
     return DescSize;
 
+  if (isFixedSize(MI))
+    return DescSize;
+
   // 4-byte instructions may have a 32-bit literal encoded after them. Check
   // operands that coud ever be literals.
   if (isVALU(MI) || isSALU(MI)) {
-    if (isFixedSize(MI))
-      return DescSize;
-
     int Src0Idx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::src0);
     if (Src0Idx == -1)
       return 4; // No operands.
index 2f9cdec61ed73ced294468d36352641b7ee73e88..c3f8bfb53ef4b929fe0c836f8634d6ebc48bb58a 100644 (file)
@@ -374,6 +374,7 @@ def SI_RETURN_TO_EPILOG : SPseudoInstSI <
   let isReturn = 1;
   let hasNoSchedulingInfo = 1;
   let DisableWQM = 1;
+  let FixedSize = 1;
 }
 
 // Return for returning function calls.
index deedf365d2cde2a1854bdd58a1e5bb021c1784f0..265d37e8d641601c67579e9fab4f43752dfd5b61 100644 (file)
@@ -241,6 +241,12 @@ bb:
   ret { { float, i32 }, { i32, <2 x float> } } { { float, i32 } { float 1.000000e+00, i32 2 }, { i32, <2 x float> } { i32 3, <2 x float> <float 2.000000e+00, float 4.000000e+00> } }
 }
 
+; GCN-LABEL: {{^}}ret_return_to_epilog_pseudo_size:
+; GCN: codeLenInByte = 0{{$}}
+define amdgpu_ps float @ret_return_to_epilog_pseudo_size() #0 {
+  ret float undef
+}
+
 declare void @llvm.amdgcn.exp.f32(i32, i32, float, float, float, float, i1, i1) #0
 
 attributes #0 = { nounwind }