[PATCH] [x86] Do not convert to cmp32 for Atom arch.

Craig Topper craig.topper at gmail.com
Wed Feb 19 00:14:21 PST 2014


Adding Chandler too. He was looking into this a while back after we
determined this wasn't the right way to fix the codegen problems it was
trying to address.


On Wed, Feb 19, 2014 at 12:08 AM, Sergey Okunev
<sergey.k.okunev at gmail.com>wrote:

> Hi grosbach,
>
> Added 'Atom' check in 'X86TargetLowering::EmitCmp' func.
>
> http://llvm-reviews.chandlerc.com/D2824
>
> Files:
>   lib/Target/X86/X86ISelLowering.cpp
>
> Index: lib/Target/X86/X86ISelLowering.cpp
> ===================================================================
> --- lib/Target/X86/X86ISelLowering.cpp
> +++ lib/Target/X86/X86ISelLowering.cpp
> @@ -9774,12 +9774,14 @@
>
>    if ((Op0.getValueType() == MVT::i8 || Op0.getValueType() == MVT::i16 ||
>         Op0.getValueType() == MVT::i32 || Op0.getValueType() == MVT::i64))
> {
> -    // Do the comparison at i32 if it's smaller. This avoids subregister
> -    // aliasing issues. Keep the smaller reference if we're optimizing for
> -    // size, however, as that'll allow better folding of memory
> operations.
> +    // Do the comparison at i32 if it's smaller, besides the Atom case.
> +    // This avoids subregister aliasing issues. Keep the smaller reference
> +    // if we're optimizing for size, however, as that'll allow better
> folding
> +    // of memory operations.
>      if (Op0.getValueType() != MVT::i32 && Op0.getValueType() != MVT::i64
> &&
>
>  !DAG.getMachineFunction().getFunction()->getAttributes().hasAttribute(
> -             AttributeSet::FunctionIndex, Attribute::MinSize)) {
> +             AttributeSet::FunctionIndex, Attribute::MinSize) &&
> +        !Subtarget->isAtom()) {
>        unsigned ExtendOp =
>            isX86CCUnsigned(X86CC) ? ISD::ZERO_EXTEND : ISD::SIGN_EXTEND;
>        Op0 = DAG.getNode(ExtendOp, dl, MVT::i32, Op0);
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>


-- 
~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140219/f1ba8646/attachment.html>


More information about the llvm-commits mailing list