[PATCH] Fixing inst-combine not to drops nsw when combining adds into mul (PR19263)

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Tue Jun 17 14:07:55 PDT 2014


Still reading the code, just wanted to post the easy bits first.

================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:398
@@ -397,1 +397,3 @@
 
+/// getIdentityValue - This function returns identity value for given opcode,
+/// which can be used to factor patterns like
----------------
Nit: don't duplicate the function name in the comment.

================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:418
@@ +417,3 @@
+
+/// getBinOpsForFactorization - This function factors binary ops which can be
+/// combined using distributive laws. This also factor SHL as MUL
----------------
same

================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:442
@@ +441,3 @@
+
+/// tryFactorization - This tries to simplify binary operations by factorizing
+/// out common terms (eg "(A*B)+(A*C)" -> "A*(B+C)").
----------------
here too.

http://reviews.llvm.org/D3799






More information about the llvm-commits mailing list