[llvm-commits] CVS: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
Reid Spencer
rspencer at reidspencer.com
Sun Oct 22 14:50:00 PDT 2006
Nick,
...
On Sun, 2006-10-22 at 16:38 -0500, Nick Lewycky wrote:
>
> Changes in directory llvm/lib/Transforms/Scalar:
>
> PredicateSimplifier.cpp updated: 1.22 -> 1.23
> ---
> Log message:
>
> Whoops! Add missing NULL check.
>
>
> ---
> Diffs of the changes: (+1 -0)
>
> PredicateSimplifier.cpp | 1 +
> 1 files changed, 1 insertion(+)
>
>
> Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
> diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.22 llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.23
> --- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.22 Sun Oct 22 16:36:41 2006
> +++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp Sun Oct 22 16:38:24 2006
> @@ -350,6 +350,7 @@
> } break;
> case Instruction::Xor: {
> ConstantIntegral *CI = dyn_cast<ConstantIntegral>(V1);
> + if (!CI) break;
The idiom we use throughout LLVM is ..
if (ConstantIntegral *CI = dyn_cast<ConstantIntegral>(V1))
if (CI->isAllOnesValue()) {
...
}
break;
Which is equivalent to what you wrote but a little cleaner.
> if (CI->isAllOnesValue()) {
> if (BO->getOperand(0) == V1)
> add(Opcode, ConstantBool::getFalse(), BO->getOperand(1), false);
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list