[llvm] [SelectionDAG][WebAssembly] Tidy up around endianess and isConstantSplat (PR #68212)

Björn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 07:32:39 PDT 2023


bjope wrote:

> @bjope LGTM, but it scares me that the isBigEndian argument still defaults to little endian. I think this to minimize changes when it was pulled from x86, but something so generic really shouldn't be making this assumption any more.

@RKSimon, my first idea was to change so that the argument wouldn't be a default argument any longer. Then I realized that in many situations the endianness does not even matter. For awhile I also played around with adding a special version of the helper for such usage (to make it even more clear when or when endianness should be taken into account). It still got a bit messy, so in the end I went for this smaller step to at least document/cleanup the target agnostic use cases a bit.

There are both old/new FIXME:s in isConstantSplat, plus this thing with getting rid of default arguments (and "how to know if endianness matters or not"). In other words, still room for improvements. I can see if I find some time to make another attempt while having this fresh in mind. 

https://github.com/llvm/llvm-project/pull/68212


More information about the llvm-commits mailing list