Revert r147945 which disabled an addressing mode transformation. I had
authorChandler Carruth <chandlerc@gmail.com>
Wed, 11 Jan 2012 18:36:12 +0000 (18:36 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 11 Jan 2012 18:36:12 +0000 (18:36 +0000)
hoped this would revive one of the llvm-gcc selfhost build bots, but it
didn't so it doesn't appear that my transform is the culprit.

If anyone else is seeing failures, please let me know!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147957 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelDAGToDAG.cpp
test/CodeGen/X86/fold-and-shift.ll

index b155f742d649f6a6aebf18c4c82658043198e468..441267a2a4df0b532fe217b72e404e238f0648fa 100644 (file)
@@ -847,10 +847,6 @@ static bool FoldMaskAndShiftToScale(SelectionDAG &DAG, SDValue N,
                                     uint64_t Mask,
                                     SDValue Shift, SDValue X,
                                     X86ISelAddressMode &AM) {
-  // FIXME!! Hack to disable this and see if it is responsible for a miscompile
-  // on llvm-gcc's selfhost.
-  return true;
-
   if (Shift.getOpcode() != ISD::SRL || !Shift.hasOneUse() ||
       !isa<ConstantSDNode>(Shift.getOperand(1)))
     return true;
index 816ab97e31b28c2c8bbee17b864b9074a210841e..93baa0e0eee0ba636858da5af144b0ebd78a11e6 100644 (file)
@@ -39,11 +39,11 @@ define i32 @t3(i16* %i.ptr, i32* %arr) {
 ; To make matters worse, because of the two-phase zext of %i and their reuse in
 ; the function, the DAG can get confusing trying to re-use both of them and
 ; prevent easy analysis of the mask in order to match this.
-; BROKEN: t3:
-; BROKEN-NOT: and
-; BROKEN: shrl
-; BROKEN: addl (%{{...}},%{{...}},4),
-; BROKEN: ret
+; CHECK: t3:
+; CHECK-NOT: and
+; CHECK: shrl
+; CHECK: addl (%{{...}},%{{...}},4),
+; CHECK: ret
 
 entry:
   %i = load i16* %i.ptr
@@ -58,11 +58,11 @@ entry:
 define i32 @t4(i16* %i.ptr, i32* %arr) {
 ; A version of @t3 that has more zero extends and more re-use of intermediate
 ; values. This exercise slightly different bits of canonicalization.
-; BROKEN: t4:
-; BROKEN-NOT: and
-; BROKEN: shrl
-; BROKEN: addl (%{{...}},%{{...}},4),
-; BROKEN: ret
+; CHECK: t4:
+; CHECK-NOT: and
+; CHECK: shrl
+; CHECK: addl (%{{...}},%{{...}},4),
+; CHECK: ret
 
 entry:
   %i = load i16* %i.ptr