[PATCH] D18841: [InstCombine] Canonicalize icmp instructions based on dominating conditions.

Balaram Makam via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 06:11:02 PDT 2016


bmakam added a comment.

> Does this result in instructions removed at the LLVM IR or does it result in fewer instructions emitted in the backend?

> 

> If it results in fewer IR instructions, can you determine why this is the case?  If it results in the same number of IR instructions, then performing this transform might make more sense in CodeGenPrepare.


I generated the IR after LTO using -Wl,plugin-opt=emit-llvm for xalancbmk and with this patch the number of IR instructions were 1059942. Compared to the baseline without my patch the number of IR instructions were 1067179. So there was a net reduction of 7237 IR instructions which translated into 3531 fewer instructions emitted in the backend. Over 1000 add instructions, and branch instructions were removed. Most of the cases were similar to the tests I have added in this patch.


http://reviews.llvm.org/D18841





More information about the llvm-commits mailing list