[PATCH] [x86] Do not convert to cmp32 for Atom arch.
Jim Grosbach
grosbach at apple.com
Fri Feb 21 02:59:45 PST 2014
This LGTM, but please also add a test-case.
On Feb 19, 2014, at 9: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);
> <D2824.1.patch>
More information about the llvm-commits
mailing list