[llvm] r257875 - [InstCombine] Rewrite bswap/bitreverse handling completely.

Dimitry Andric via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 06:13:46 PST 2016


Hi Hans,

After this merge, the release_38 branch starts failing a bunch of tests for me, due to segfaults:

Failing Tests (7):
    LLVM :: CodeGen/AArch64/arm64-call-tailcalls.ll
    LLVM :: CodeGen/AArch64/cmpxchg-idioms.ll
    LLVM :: CodeGen/ARM/call-tc.ll
    LLVM :: CodeGen/ARM/cmpxchg-idioms.ll
    LLVM :: CodeGen/X86/2012-01-16-mfence-nosse-flags.ll
    LLVM :: CodeGen/X86/switch.ll
    LLVM :: CodeGen/X86/tailcall-returndup-void.ll

For example, with the AArch64 cmpxchg-idioms.ll test, it gives:

FAIL: LLVM :: CodeGen/AArch64/cmpxchg-idioms.ll (10056 of 24459)
******************** TEST 'LLVM :: CodeGen/AArch64/cmpxchg-idioms.ll' FAILED ********************
Script:
--
/home/dim/obj/llvm-258266-rel38-freebsd11-i386-ninja-rel-1/./bin/llc -mtriple=aarch64-apple-ios7.0 -o - /share/dim/src/llvm/release_38/test/CodeGen/AArch64/cmpxchg-idioms.ll | /home/dim/obj/llvm-258266-rel38-freebsd11-i386-ninja-rel-1/./bin/FileCheck /share/dim/src/llvm/release_38/test/CodeGen/AArch64/cmpxchg-idioms.ll
--
Exit Code: 2

Command Output (stderr):
--
FileCheck error: '-' is empty.

--

Running the above llc command separately shows the segfault:

$ gdb --args /home/dim/obj/llvm-258266-rel38-freebsd11-i386-ninja-rel-1/./bin/llc -mtriple=aarch64-apple-ios7.0 -o - /share/dim/src/llvm/release_38/test/CodeGen/AArch64/cmpxchg-idioms.ll
[...]
Starting program: /home/dim/obj/llvm-258266-rel38-freebsd11-i386-ninja-rel-1/bin/llc -mtriple=aarch64-apple-ios7.0 -o - /share/dim/src/llvm/release_38/test/CodeGen/AArch64/cmpxchg-idioms.ll
        .section        __TEXT,__text,regular,pure_instructions
        .ios_version_min 7, 0
[New Thread 2a012000 (LWP 100435)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 2a012000 (LWP 100435)]
0x08a92885 in (anonymous namespace)::CodeGenPrepare::runOnFunction(llvm::Function&) ()
(gdb) bt
#0  0x08a92885 in (anonymous namespace)::CodeGenPrepare::runOnFunction(llvm::Function&) ()
#1  0x08e50d4b in llvm::FPPassManager::runOnFunction(llvm::Function&) ()
#2  0x08e50ff2 in llvm::FPPassManager::runOnModule(llvm::Module&) ()
#3  0x08e51577 in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#4  0x08e51c08 in llvm::legacy::PassManager::run(llvm::Module&) ()
#5  0x081a2dd3 in compileModule(char**, llvm::LLVMContext&) ()
#6  0x0819fe9c in main ()

James, maybe you have an idea what is going wrong here?

-Dimitry

> On 19 Jan 2016, at 21:53, Hans Wennborg via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> Thanks! r258180.
> 
> On Tue, Jan 19, 2016 at 9:42 AM, David Majnemer
> <david.majnemer at gmail.com> wrote:
>> Yes.
>> 
>> On Tue, Jan 19, 2016 at 9:33 AM, Hans Wennborg <hans at chromium.org> wrote:
>>> 
>>> This should have baked on the buildbots for a while now.
>>> 
>>> David, OK to merge?
>>> 
>>> On Fri, Jan 15, 2016 at 10:25 AM, James Molloy <James.Molloy at arm.com>
>>> wrote:
>>>> Hi Hans,
>>>> 
>>>> Yes, as long as David is happy please merge this, along with the
>>>> followup that fixes msan.
>>>> 
>>>> I was waiting for it to soak through the stage2 bots before suggesting
>>>> it myself.
>>>> 
>>>> James
>>>> 
>>>> 
>>>> 
>>>>> On 15 Jan 2016, at 17:59, Hans Wennborg <hans at chromium.org> wrote:
>>>>> 
>>>>> It was suggested that this be merged to 3.8. David, I think you're the
>>>>> code owner here; OK for merge?
>>>>> 
>>>>> On Fri, Jan 15, 2016 at 1:20 AM, James Molloy via llvm-commits
>>>>> <llvm-commits at lists.llvm.org> wrote:
>>>>>> Author: jamesm
>>>>>> Date: Fri Jan 15 03:20:19 2016
>>>>>> New Revision: 257875
>>>>>> 
>>>>>> URL: http://llvm.org/viewvc/llvm-project?rev=257875&view=rev
>>>>>> Log:
>>>>>> [InstCombine] Rewrite bswap/bitreverse handling completely.
>>>>>> 
>>>>>> There are several requirements that ended up with this design;
>>>>>> 1. Matching bitreversals is too heavyweight for InstCombine and
>>>>>> doesn't really need to be done so early.
>>>>>> 2. Bitreversals and byteswaps are very related in their matching
>>>>>> logic.
>>>>>> 3. We want to implement support for matching more advanced
>>>>>> bswap/bitreverse patterns like partial bswaps/bitreverses.
>>>>>> 4. Bswaps are best matched early in InstCombine.
>>>>>> 
>>>>>> The result of these is that a new utility function is created in
>>>>>> Transforms/Utils/Local.h that can be configured to search for bswaps,
>>>>>> bitreverses or both. InstCombine uses it to find only bswaps, CGP uses it to
>>>>>> find only bitreversals.
>>>>>> 
>>>>>> We can then extend the matching logic in one place only.
>>>>> 
>>>> IMPORTANT NOTICE: The contents of this email and any attachments are
>>>> confidential and may also be privileged. If you are not the intended
>>>> recipient, please notify the sender immediately and do not disclose the
>>>> contents to any other person, use it for any purpose, or store or copy the
>>>> information in any medium. Thank you.
>>>> 
>> 
>> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160122/64b5d0e4/attachment.sig>


More information about the llvm-commits mailing list