[llvm-dev] Canonical way to handle zero registers?

Sean Silva via llvm-dev llvm-dev at lists.llvm.org
Thu Dec 21 21:22:27 PST 2017


I looked around the codebase and didn't see anything that obviously looked
like the natural place to turn constant zero immediates into zero-registers
(i.e. registers that always return zero when read). Right now we are
expanding them in ISelLowering::LowerOperation but that seems too early.

The specific issue I'm hitting is that we have a register that reads as -1
and so when we replace -1 too early with this register, the standard "not"
pattern (xor x, -1) will fail to match to "not".

Thanks,
Sean Silva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171221/975b1c10/attachment.html>


More information about the llvm-dev mailing list