[llvm] r191711 - The X86FixupLEAs pass for Intel Atom must not call convertToThreeAddress

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Sep 30 16:25:49 PDT 2013


Test case?

On Monday, September 30, 2013, Preston Gurd wrote:

> Author: pgurd
> Date: Mon Sep 30 18:18:42 2013
> New Revision: 191711
>
> URL: http://llvm.org/viewvc/llvm-project?rev=191711&view=rev
> Log:
> The X86FixupLEAs pass for Intel Atom must not call convertToThreeAddress
> on ADD16rr opcodes, if src1 != src, since that would cause
> convertToThreeAddress to try to create a virtual register. This is not
> permitted after register allocation, which is when the X86FixupLEAs pass
> runs.
>
> This patch fixes PR16785.
>
>
> Modified:
>     llvm/trunk/lib/Target/X86/X86FixupLEAs.cpp
>
> Modified: llvm/trunk/lib/Target/X86/X86FixupLEAs.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FixupLEAs.cpp?rev=191711&r1=191710&r2=191711&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/X86FixupLEAs.cpp (original)
> +++ llvm/trunk/lib/Target/X86/X86FixupLEAs.cpp Mon Sep 30 18:18:42 2013
> @@ -125,6 +125,14 @@ FixupLEAPass::postRAConvertToLEA(Machine
>        // which requires isImm() to be true
>        return 0;
>      }
> +  case X86::ADD16rr:
> +  case X86::ADD16rr_DB:
> +    if (MI->getOperand(1).getReg() != MI->getOperand(2).getReg()) {
> +      // if src1 != src2, then convertToThreeAddress will
> +      // need to create a Virtual register, which we cannot do
> +      // after register allocation.
> +      return 0;
> +    }
>    }
>    return TII->convertToThreeAddress(MFI, MBBI, 0);
>  }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu <javascript:;>
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130930/cb43776c/attachment.html>


More information about the llvm-commits mailing list