[PATCH] [Reassocate] Add support for vector instructions.

Chad Rosier mcrosier at codeaurora.org
Tue Sep 9 15:52:20 PDT 2014


>>! In D5222#5, @spatel wrote:
> Hi Chad -
> 
> Thanks for posting this patch. I wasn't able to apply the patch cleanly to r217455, so I'm not sure if that is affecting what I'm seeing. 

Argg... Like I said, the patch has been laying around for some time.  I'll see if I can't rebase it soon and upload a new diff.

> I think @test20 in test/Transforms/Reassociate/vector-basictests.ll should cover what I'm trying to do in DAGCombiner here:
> http://reviews.llvm.org/D5254

 
> It seems to work when there's a 'fast' directly on the fmuls, but not if I specify "unsafe-fp-math=true" as a function attribute or via the "enable-unsafe-fp-math" parameter to opt. I guess this a general question: what are we supposed to be using to detect -ffast-math and friends? Do we have to consider both the IR flags and the attributes/params?

Good question.  When I added support for unsafe-math I checked the instruction FPMath flags directly and not the function attributes.  That doesn't mean it couldn't work that way, I just didn't implement it that way.  Does this effect anything other than simplifying lit test creation?  If this is commonly done, please file a PR and I'll be happy to address it.

I also recall why I hadn't upstreamed the patch earlier.  My test cases are derived from the scalar tests and some of those rely on InstCombine and other passes to cleanup after the Reassociation pass.  Unfortunately, some of these optimizations are not supported in the vector versions, so those need to be investigated.

I'll try to update things in a few days.  Thanks for looking at the patch, Sanjay.

 Chad

http://reviews.llvm.org/D5222






More information about the llvm-commits mailing list