[PATCH] D37592: [X86] Move matching of (and (srl/sra, C), (1<<C) - 1) to BEXTR/BEXTRI instruction to custom isel
Ayman Musa via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 11 00:04:10 PDT 2017
aymanmus added inline comments.
================
Comment at: lib/Target/X86/X86ISelDAGToDAG.cpp:2129
+// See if this is an (X >> C1) & C2 that we can match to BEXTR/BEXTRI.
+bool X86DAGToDAGISel::matchBEXTRFromAnd(SDNode *Node) {
+ MVT NVT = Node->getSimpleValueType(0);
----------------
Maybe add an assert to guarantee an 'AND' Node.
================
Comment at: lib/Target/X86/X86ISelDAGToDAG.cpp:2190
+ SDValue Tmp0, Tmp1, Tmp2, Tmp3, Tmp4;
+ if (tryFoldLoad(Node, Input, Tmp0, Tmp1, Tmp2, Tmp3, Tmp4)) {
+ SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, Tmp4, New, Input.getOperand(0) };
----------------
Why do you manually handle the memory folding here instead of letting the regular mechanism take care of that?
================
Comment at: lib/Target/X86/X86ISelDAGToDAG.cpp:2272
case ISD::XOR: {
+
// For operations of the form (x << C1) op C2, check if we can use a smaller
----------------
remove extra line
https://reviews.llvm.org/D37592
More information about the llvm-commits
mailing list