[PATCH] D48789: [X86] Replace (32/64 - n) shift amounts with (neg n) since the shift amount is masked in hardware

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 8 10:37:05 PDT 2018


craig.topper added a comment.

Without an And the target independent node wouldn't allow this. I thought about trying to insert an And into the DAG during DAG combine which would make simplify demanded bits trigger. But it breaks recognizition of (x << (32 - n)) >> (32 - n)) for bzhi. It would become (x << (-n & 0x1f)) >> (-n & 0x1f) and now we don't know if 'n' is safe to feed directly to bzhi.


https://reviews.llvm.org/D48789





More information about the llvm-commits mailing list