[PATCH] [Instcombine/InstSimplify] Move optimization from instcombine to instsimplify

Nick Lewycky nlewycky at google.com
Wed Jun 18 20:59:58 PDT 2014


I made a few adjustments:

+    ConstantInt *C1 = nullptr, *C2 = nullptr;
+    C1 = dyn_cast<ConstantInt>(C);
+    C2 = dyn_cast<ConstantInt>(D);
became
+    ConstantInt *C1 = dyn_cast<ConstantInt>(C);
+    ConstantInt *C2 = dyn_cast<ConstantInt>(D);

I removed the dead initialization of V1 and V2 to nullptr. They aren't used
unless they match succeeds.

Your test had @test1 and @test3, renamed @test3 to @test2.

Changed test to use FileCheck instead of grep. I'm aware this is what
InstCombine/apint-or{1,2}.ll does, but it's an older style and FileCheck is
preferred.

Moved the whole-file comments that apply to each function ("the first
test..." and "the second test...") next to the functions they apply to.

Committed in r211252. Thanks!

Nick

On 18 June 2014 07:18, Rahul Jain <rahul1.jain at samsung.com> wrote:

>
> Hi Nick,
>
> Thanks a lot for the review.
> Updated patch as per your comment.
> 1) Sinked variable declarations next to their usage.
> 2) Folded if statements.
> 3) Added testcase.
>
> Please help review the same.
> If it looks good to you, please commit it for me.
> Soon will ask for commit access.
>
> Thanks,
> Rahul
>
> http://reviews.llvm.org/D4100
>
> Files:
>   lib/Analysis/InstructionSimplify.cpp
>   lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
>   test/Transforms/InstSimplify/apint-or.ll
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140618/7a8ca755/attachment.html>


More information about the llvm-commits mailing list