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

Nirav Dave via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 2 12:32:49 PDT 2018


niravd added a comment.

> @niravd would it be better to just do the full manual isel instead of trying to do it this way? Selecting the negate is easy. It just the variations of the shift that kind of ugly due to legacy vs BMI2 and BMI2 allowing load folding.

Probably not; the CSE collision I can envision seems like it wouldn't happen in the wild. Also, it should manifest as an ICE/assertion. If we wanted to go the manual select route we should really do it for all uses of InsertDAGNode (both in X86 and SystemZ) which seems like a pain. I think we're happier keeping it as, and adding a note for insertDAGNode. I'll put making a fixup to insertDAGNode on my to-do list.


https://reviews.llvm.org/D48789





More information about the llvm-commits mailing list