[PATCH] D49966: [X86] Performing DAG pruning before selection of LEA instructions.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 23:42:41 PDT 2018


lebedev.ri added inline comments.


================
Comment at: lib/Target/X86/X86ISelDAGToDAG.cpp:725-728
+      // Following transformation is being done
+      // %1 = SHL X , 2       ->   %1 = SUB 0 , Y
+      // %2 = SUB %1 , Y           %2 = SHL X , 2
+      //                           %3 = ADD %2 , %1
----------------
This turned out hard to read. Can you replace it with
```
%o0 = shl i8 %x, C   ->  %n0 = sub i8 0, %y
%r = sub i8 %o0, %y      %n1 = shl i8 %x, C
                         %r = add i8 %n1, %n0
```



================
Comment at: lib/Target/X86/X86ISelDAGToDAG.cpp:734-737
+      // Following transformation is being done
+      //  %1 = SHL X , CONST  ->    %1 = SUB 0 , X
+      //  %2 = SUB Y , %1           %2 = SHL %1 , CONST
+      //                            %3 = ADD Y , %2
----------------
```
%o0 = shl i8 %x, C   ->  %n0 = sub i8 0, %x
%r = sub i8 %y, %o0      %n1 = shl i8 %n0, C
                         %r = add i8 %y, %n1
```


Repository:
  rL LLVM

https://reviews.llvm.org/D49966





More information about the llvm-commits mailing list