From e00cbad78de86ac8e736f35db35632c83ef64c1d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 6 Dec 2007 07:44:31 +0000 Subject: [PATCH] Actually, disable this code for now. More analysis and improvements to the X86 backend are needed before this should be enabled by default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44657 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 6 ++++++ test/CodeGen/X86/shift-combine.ll | 1 + 2 files changed, 7 insertions(+) diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 918db383530..ba3c0ac33dc 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -2134,6 +2134,12 @@ SDOperand DAGCombiner::visitXOR(SDNode *N) { /// visitShiftByConstant - Handle transforms common to the three shifts, when /// the shift amount is a constant. SDOperand DAGCombiner::visitShiftByConstant(SDNode *N, unsigned Amt) { + // FIXME: disable this for now. This pessimizes some common cases like: + // + //void foo(int *X, int i) { X[i & 1235] = 1; } + //int bar(int *X, int i) { return X[i & 255]; } + return SDOperand(); + SDNode *LHS = N->getOperand(0).Val; if (!LHS->hasOneUse()) return SDOperand(); diff --git a/test/CodeGen/X86/shift-combine.ll b/test/CodeGen/X86/shift-combine.ll index 543bb223787..c8df5b02080 100644 --- a/test/CodeGen/X86/shift-combine.ll +++ b/test/CodeGen/X86/shift-combine.ll @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llc | not grep shrl +; XFAIL: * target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i686-apple-darwin8" -- 2.34.1