r205436 - Extend the SSE2 comment lexing to AVX2. Only 16byte align when not on AVX2.
Stephen Canon
scanon at apple.com
Thu Apr 3 04:04:33 PDT 2014
On Apr 2, 2014, at 3:14 PM, Chris Lattner <clattner at apple.com> wrote:
> On Apr 2, 2014, at 12:14 PM, Chris Lattner <clattner at apple.com> wrote:
>
>> On Apr 2, 2014, at 10:27 AM, Roman Divacky <rdivacky at freebsd.org> wrote:
>>
>>> Author: rdivacky
>>> Date: Wed Apr 2 12:27:03 2014
>>> New Revision: 205436
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=205436&view=rev
>>> Log:
>>> Extend the SSE2 comment lexing to AVX2. Only 16byte align when not on AVX2.
>>>
>>> This provides some 3% speedup when preprocessing gcc.c as a single file.
>>
>> Nice!
>
> I haven’t looked closely at them, but would any of the SSE 4.2 “string processing” instructions be helpful here?
For simply scanning for '/', SSE4.2 won't be a win; it's usually not significantly faster than PCMPEQB + PMOVMSKB in strchr-type loops.
One could use it to search for "*/" instead, which would be somewhat more interesting. There's no 32B VPCMPESTRI however, so if there aren't many false-positive '/' characters in block comments (I expect this to be the case), then using AVX2 to scan for '/' should still win.
– Steve
More information about the cfe-commits
mailing list