[PATCH] D29088: Do not create ctlz/cttz(X, false) when the target do not support zero defined ctlz/cttz.

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 24 13:09:54 PST 2017


deadalnix added a comment.

@andreadb it hides the branch many of the subsequent optimization passes, resulting in bad codegen. I stumbled on bad codegen from cttz/ctlz several time recently. Thing that I noticed are : doing the 0 case check several time, failure to constant fold the 0 case when there is one, etc...

It doesn't make sense to re-implement all of this in CodeGenprepare nor does it to special case it in the whole pipeline. Canonicalisation should help subsequent passes, not hide information to them, which is what this is doing.


https://reviews.llvm.org/D29088





More information about the llvm-commits mailing list