[PATCH] D50222: [CodeGen] [SelectionDAG] More efficient code for X % C == 0

Dmytro Shynkevych via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 2 21:08:23 PDT 2018


hermord added inline comments.


================
Comment at: test/CodeGen/Hexagon/swp-const-tc2.ll:9
 ; CHECK-NOT: loop0
-; CHECK: = mpy
-; CHECK-NOT: = mpy
+; CHECK: = memw
+; CHECK-NOT: = memw
----------------
hermord wrote:
> To the best of my understanding, it is valid to not perform the multiplication at all, since its can never be used because of the infinite loop at `b3`. This is the output I get:
> 
> 
> ```
> // %bb.0:                               // %b0
> 	{
> 		r0 = ##-1431655765
> 	}
> 	{
> 		r0 = #0
> 	}
> 	{
> 		r0 = memw(r0+#0)
> 	}
> 	.p2align	4
> .LBB0_1:                                // %b3
>                                         // =>This Inner Loop Header: Depth=1
> 	{
> 		jump .LBB0_1
> 	}
> ```
*its result can never be used


Repository:
  rL LLVM

https://reviews.llvm.org/D50222





More information about the llvm-commits mailing list