[llvm-dev] BSWAP matching in codegen

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Thu Dec 8 10:31:23 PST 2016


On 12/8/2016 10:01 AM, Jim Lewis via llvm-dev wrote:
>
> I’m looking into problems with the function 
> DAGCombiner::MatchBSwapHWord and had a couple questions on how to 
> proceed (I’m new here, and to llvm). It looks like there was never any 
> test coverage for this code, and it doesn’t match the patterns it 
> claims to be looking for. I found a fix for this in our fork, but the 
> fix is even worse in that it matches a whole bunch of invalid patterns 
> as well as the canonical patterns. I have simple test cases that break 
> both the existing code and our local fix.
>

Are you sure there isn't any test coverage?  As far as I can tell, the 
tests from https://reviews.llvm.org/rL133503 are still in the tree.

> I see equivalent matching code upstream in InstCombiner::MatchBSwap() 
>  (InstCombineAndOrXor.cpp), but not an easy way to re-use it AFAICT. 
> Questions:
>
> --Is this functionality even worth fixing in DAGCombiner (ie, what is 
> the probability that this complex pattern would re-emerge in codegen 
> after the InstCombiner transform, weighed against the obviously 
> error-prone nature of the matching code)?
>

I don't think there is any existing code to match this particular 
pattern in instcombine.  I guess it wouldn't be hard to add, though.

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161208/83819c36/attachment.html>


More information about the llvm-dev mailing list