[PATCH] D14803: [AArch64] Fix a corner case in BitFeild select

Weiming Zhao via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 11:50:24 PST 2015


weimingz added inline comments.

================
Comment at: lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:2070
@@ -2065,3 +2069,3 @@
       // In that case, we can eliminate the AND
       Dst = OrOpd1->getOperand(0);
     else
----------------
HI Geoff,

The NumberOfIgnoredHighBits is used here to check if we can remove the AND.
The current function
 static bool isBitfieldInsertOpFromOr(SDNode *N, unsigned &Opc, SDValue &Dst,
                                     SDValue &Src, unsigned &ImmR,
                                     unsigned &ImmS, SelectionDAG *CurDAG)
always expects a BFM op if it returns true.

I tried putting code like
 if (NumberOfIgnoredHighBits == 32) {
      Src = Dst;
    }
But it doest make much difference.
	mov	 w8, w0
	bfi	w8, w8, #8, #24
	mov	 w9, w0
	bfi	w9, w8, #8, #24
	mov	 w8, w0
	bfi	w8, w9, #8, #24
	bfi	w0, w8, #8, #24
	lsl	w0, w0, #8




http://reviews.llvm.org/D14803





More information about the llvm-commits mailing list