[llvm] [SelectionDAG] Fix and improve TargetLowering::SimplifySetCC (PR #87646)

Björn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 11 08:31:24 PDT 2024


bjope wrote:

@RKSimon , I see that you added yourself as reviewer for this one. Did you take a look already?

Since it currently is miscompiling for big-endian it would be nice with some way forward. Maybe it had been better to split it up in a quick fix, and a follow up with new optimizations (but sometime my miscompile fixes get stuck on causing regressions, so this time I tried to avoid regressions directly).
I also happend to notice that there seem to be some partial overlap between the TargetLowering::SimplifySetCC and some of the reduceLoadWidth optimizations in DAGCombiner. Not sure if there is a long term plan related to that. At this point I was mostly interested in getting rid of the miscompiles.

Btw, I think the miscompiles also only happens when there are load/stores with sizes that aren't a multiple of the byte size. That is probably limiting how likely the miscompiles would be for lots of targets a lot. Downstream we do get such load/stores, specially with the introduction of _BitInt. The problem was detected when using _BitInt in combination with a big-endian target.

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


More information about the llvm-commits mailing list