Re: [GHC] #6158: GHC Causes opt to crash under LLVM 3.1 due to non const memcpy offset
#6158: GHC Causes opt to crash under LLVM 3.1 due to non const memcpy offset +--- Reporter: Axman6 | Owner: dterei Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (LLVM) | Version: 7.4.1 Keywords: llvm memcpy | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Compile-time crash Difficulty: Unknown |Testcase: Blockedby: |Blocking: Related: | +--- Comment(by davidterei@…): commit 41b37a233e92b3f7df07f1d8d4240e80643dff96 {{{ Author: David Terei davidte...@gmail.com Date: Mon Jun 25 00:51:47 2012 -0700 Fix #6158. LLVM 3.1 doesn't like certain constructions that 3.0 and earlier did, so we avoid them. compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 18 +++--- 1 files changed, 15 insertions(+), 3 deletions(-) }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/6158#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #6158: GHC Causes opt to crash under LLVM 3.1 due to non const memcpy offset
#6158: GHC Causes opt to crash under LLVM 3.1 due to non const memcpy offset -+-- Reporter: Axman6 | Owner: dterei Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (LLVM) |Version: 7.4.1 Resolution: fixed | Keywords: llvm memcpy Os: MacOS X | Architecture: x86_64 (amd64) Failure: Compile-time crash | Difficulty: Unknown Testcase: | Blockedby: Blocking: |Related: -+-- Changes (by dterei): * status: new = closed * resolution: = fixed Comment: OK fixed. Damn LLVM doesn't like this code anymore: {{{ %a = i32 1 call ccc llvm.memcpy.p0i8.p0i8.i64( i8* %x, i8* %y, i64 %z, i32 %a, i1 0) }}} As while the alignment (a) is constant the fact it's in a variable throws LLVM off in 3.1. A work around for now is to run LLVM's constant propigation pass at the very start to inline the variable. e.g do this: {{{ $ ghc --make testcase.hs -fllvm -O2 -optlo-constprop -optlo-O3 }}} and it should compile fine. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/6158#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #6158: GHC Causes opt to crash under LLVM 3.1 due to non const memcpy offset
#6158: GHC Causes opt to crash under LLVM 3.1 due to non const memcpy offset +--- Reporter: Axman6 | Owner: dterei Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (LLVM) | Version: 7.4.1 Keywords: llvm memcpy | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Compile-time crash Difficulty: Unknown |Testcase: Blockedby: |Blocking: Related: | +--- Comment(by dterei): Yes, not sure when but hopefully soon. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/6158#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #6158: GHC Causes opt to crash under LLVM 3.1 due to non const memcpy offset
#6158: GHC Causes opt to crash under LLVM 3.1 due to non const memcpy offset +--- Reporter: Axman6 | Owner: dterei Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (LLVM) | Version: 7.4.1 Keywords: llvm memcpy | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Compile-time crash Difficulty: Unknown |Testcase: Blockedby: |Blocking: Related: | +--- Comment(by simonmar): David, any chance you could look at this please? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/6158#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
[GHC] #6158: GHC Causes opt to crash under LLVM 3.1 due to non const memcpy offset
#6158: GHC Causes opt to crash under LLVM 3.1 due to non const memcpy offset +--- Reporter: Axman6 | Owner: dterei Type: bug | Status: new Priority: normal | Component: Compiler (LLVM) Version: 7.4.1 | Keywords: llvm memcpy Os: MacOS X | Architecture: x86_64 (amd64) Failure: Compile-time crash | Testcase: Blockedby: | Blocking: Related: | +--- Under LLVM 3.1, opt is crashing when compiling code produced by GHC which makes calls to memcpy. After talking to the guys in #llvm they informed me that memcpy needs its alignment argument to be a const value, not from a value in a register. An example of the crash log: alignment argument of memory intrinsics must be a constant int call void @llvm.memcpy.p0i8.p0i8.i64(i8* %lnfVC, i8* %lnfVE, i64 %lnfVF, i32 %lnfVG, i1 false) alignment argument of memory intrinsics must be a constant int call void @llvm.memcpy.p0i8.p0i8.i64(i8* %lnfWc, i8* %lnfWe, i64 %lnfWf, i32 %lnfWg, i1 false) alignment argument of memory intrinsics must be a constant int call void @llvm.memmove.p0i8.p0i8.i64(i8* %lnfWk, i8* %lnfWm, i64 %lnfWn, i32 %lnfWo, i1 false) alignment argument of memory intrinsics must be a constant int call void @llvm.memmove.p0i8.p0i8.i64(i8* %lnfWJ, i8* %lnfWL, i64 %lnfWM, i32 %lnfWN, i1 false) Broken module found, compilation aborted! 0 opt 0x00010cec4be7 llvm::sys::ThreadLocalllvm::PrettyStackTraceEntry const::~ThreadLocal() + 6113 1 opt 0x00010cec4eee llvm::sys::ThreadLocalllvm::PrettyStackTraceEntry const::~ThreadLocal() + 6888 2 libsystem_c.dylib 0x7fff8dabacfa _sigtramp + 26 3 libsystem_c.dylib 00 _sigtramp + 18446603338139325216 4 opt 0x00010cec4dfc llvm::sys::ThreadLocalllvm::PrettyStackTraceEntry const::~ThreadLocal() + 6646 5 opt 0x00010ce9865a llvm::StringMapllvm::Value*, llvm::MallocAllocator::clear() + 8942 6 opt 0x00010ce975cd llvm::StringMapllvm::Value*, llvm::MallocAllocator::clear() + 4705 7 opt 0x00010ce8b50b llvm::PassRegistrationListener::passEnumerate(llvm::PassInfo const*) + 12531 8 opt 0x00010ce8b704 llvm::PassRegistrationListener::passEnumerate(llvm::PassInfo const*) + 13036 9 opt 0x00010ce8b848 llvm::PassRegistrationListener::passEnumerate(llvm::PassInfo const*) + 13360 10 opt 0x00010ce8bb28 llvm::PassRegistrationListener::passEnumerate(llvm::PassInfo const*) + 14096 11 opt 0x00010ce8bf27 llvm::PassRegistrationListener::passEnumerate(llvm::PassInfo const*) + 15119 12 opt 0x00010cc7a708 llvm::DenseMapllvm::BasicBlock*, unsigned int, llvm::DenseMapInfollvm::BasicBlock*, llvm::DenseMapInfounsigned int ::init(unsigned int) + 4866 13 opt 0x00010cc76364 Stack dump: 0. Program arguments: opt mmulttest.ll -o /var/folders/0n/bjp22m948xlgtl006s6kwyj0gv/T/ghc87286_0/ghc87286_0.bc -O3 -std-compile-opts -time-passes -loop-unroll 1. Running pass 'Function Pass Manager' on module 'mmulttest.ll'. 2. Running pass 'Module Verifier' on function '@seo9_info' -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/6158 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #6158: GHC Causes opt to crash under LLVM 3.1 due to non const memcpy offset
#6158: GHC Causes opt to crash under LLVM 3.1 due to non const memcpy offset +--- Reporter: Axman6 | Owner: dterei Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (LLVM) | Version: 7.4.1 Keywords: llvm memcpy | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Compile-time crash Difficulty: Unknown |Testcase: Blockedby: |Blocking: Related: | +--- Changes (by simonmar): * difficulty: = Unknown Old description: Under LLVM 3.1, opt is crashing when compiling code produced by GHC which makes calls to memcpy. After talking to the guys in #llvm they informed me that memcpy needs its alignment argument to be a const value, not from a value in a register. An example of the crash log: alignment argument of memory intrinsics must be a constant int call void @llvm.memcpy.p0i8.p0i8.i64(i8* %lnfVC, i8* %lnfVE, i64 %lnfVF, i32 %lnfVG, i1 false) alignment argument of memory intrinsics must be a constant int call void @llvm.memcpy.p0i8.p0i8.i64(i8* %lnfWc, i8* %lnfWe, i64 %lnfWf, i32 %lnfWg, i1 false) alignment argument of memory intrinsics must be a constant int call void @llvm.memmove.p0i8.p0i8.i64(i8* %lnfWk, i8* %lnfWm, i64 %lnfWn, i32 %lnfWo, i1 false) alignment argument of memory intrinsics must be a constant int call void @llvm.memmove.p0i8.p0i8.i64(i8* %lnfWJ, i8* %lnfWL, i64 %lnfWM, i32 %lnfWN, i1 false) Broken module found, compilation aborted! 0 opt 0x00010cec4be7 llvm::sys::ThreadLocalllvm::PrettyStackTraceEntry const::~ThreadLocal() + 6113 1 opt 0x00010cec4eee llvm::sys::ThreadLocalllvm::PrettyStackTraceEntry const::~ThreadLocal() + 6888 2 libsystem_c.dylib 0x7fff8dabacfa _sigtramp + 26 3 libsystem_c.dylib 00 _sigtramp + 18446603338139325216 4 opt 0x00010cec4dfc llvm::sys::ThreadLocalllvm::PrettyStackTraceEntry const::~ThreadLocal() + 6646 5 opt 0x00010ce9865a llvm::StringMapllvm::Value*, llvm::MallocAllocator::clear() + 8942 6 opt 0x00010ce975cd llvm::StringMapllvm::Value*, llvm::MallocAllocator::clear() + 4705 7 opt 0x00010ce8b50b llvm::PassRegistrationListener::passEnumerate(llvm::PassInfo const*) + 12531 8 opt 0x00010ce8b704 llvm::PassRegistrationListener::passEnumerate(llvm::PassInfo const*) + 13036 9 opt 0x00010ce8b848 llvm::PassRegistrationListener::passEnumerate(llvm::PassInfo const*) + 13360 10 opt 0x00010ce8bb28 llvm::PassRegistrationListener::passEnumerate(llvm::PassInfo const*) + 14096 11 opt 0x00010ce8bf27 llvm::PassRegistrationListener::passEnumerate(llvm::PassInfo const*) + 15119 12 opt 0x00010cc7a708 llvm::DenseMapllvm::BasicBlock*, unsigned int, llvm::DenseMapInfollvm::BasicBlock*, llvm::DenseMapInfounsigned int ::init(unsigned int) + 4866 13 opt 0x00010cc76364 Stack dump: 0. Program arguments: opt mmulttest.ll -o /var/folders/0n/bjp22m948xlgtl006s6kwyj0gv/T/ghc87286_0/ghc87286_0.bc -O3 -std-compile-opts -time-passes -loop-unroll 1. Running pass 'Function Pass Manager' on module 'mmulttest.ll'. 2. Running pass 'Module Verifier' on function '@seo9_info' New description: Under LLVM 3.1, opt is crashing when compiling code produced by GHC which makes calls to memcpy. After talking to the guys in #llvm they informed me that memcpy needs its alignment argument to be a const value, not from a value in a register. An example of the crash log: {{{ alignment argument of memory intrinsics must be a constant int call void @llvm.memcpy.p0i8.p0i8.i64(i8* %lnfVC, i8* %lnfVE, i64 %lnfVF, i32 %lnfVG, i1 false) alignment argument of memory intrinsics must be a constant int call void @llvm.memcpy.p0i8.p0i8.i64(i8* %lnfWc, i8* %lnfWe, i64 %lnfWf, i32 %lnfWg, i1 false) alignment argument of memory intrinsics must be a constant int call void @llvm.memmove.p0i8.p0i8.i64(i8* %lnfWk, i8* %lnfWm, i64 %lnfWn, i32 %lnfWo, i1 false) alignment argument of memory intrinsics must be a constant int call void @llvm.memmove.p0i8.p0i8.i64(i8* %lnfWJ, i8* %lnfWL, i64 %lnfWM, i32 %lnfWN, i1 false) Broken module found, compilation aborted! 0 opt 0x00010cec4be7 llvm::sys::ThreadLocalllvm::PrettyStackTraceEntry const::~ThreadLocal() + 6113 1 opt 0x00010cec4eee llvm::sys::ThreadLocalllvm::PrettyStackTraceEntry const::~ThreadLocal() + 6888 2 libsystem_c.dylib 0x7fff8dabacfa
Re: [GHC] #6158: GHC Causes opt to crash under LLVM 3.1 due to non const memcpy offset
#6158: GHC Causes opt to crash under LLVM 3.1 due to non const memcpy offset +--- Reporter: Axman6 | Owner: dterei Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (LLVM) | Version: 7.4.1 Keywords: llvm memcpy | Os: MacOS X Architecture: x86_64 (amd64) | Failure: Compile-time crash Difficulty: Unknown |Testcase: Blockedby: |Blocking: Related: | +--- Changes (by Axman6): * cc: axman6@… (added) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/6158#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs