[llvm-commits] [llvm] r119964 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp lib/Target/README.txt test/CodeGen/X86/switch-or.ll

Benjamin Kramer benny.kra at googlemail.com
Mon Nov 22 02:18:28 PST 2010


On 22.11.2010, at 10:51, Duncan Sands wrote:

> Hi Benjamin,
> 
>> Implement the "if (X == 6 || X == 4)" ->  "if ((X|2) == 6)" optimization.
> 
> wouldn't it be better to do this in the IR optimizers?

Well, the TODO comment was already there ;)

I think doing it in CodeGen can also optimize stuff when it decides to lower a big switch as
several smaller switches in a binary tree. We don't optimize those cases at the moment though
because I'm lazy :(



More information about the llvm-commits mailing list