Created attachment 21896 [details] bugpoint-reduced-simplified.bc Clang 7 as well as Clang 8 ran into errors while compiling the respective compiler-rt. Tracing the bug led me to a crashing llc: > llc -asm-show-inst -asm-verbose bugpoint-reduced-simplified.bc LLVM ERROR: Cannot select: 0x55d58830cbf0: f80 = ConstantFP<APFloat(604462909807314587353088)> In function: __mulxc3 The .bc file is attached.
; ModuleID = 'bugpoint-reduced-simplified.bc' source_filename = "mulxc3-1a6977-min.i" target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" define dso_local void @__mulxc3() #0 { %1 = call x86_fp80 @llvm.copysign.f80(x86_fp80 0xK00000000000000000000, x86_fp80 undef) store x86_fp80 %1, x86_fp80* undef, align 16 ret void } ; Function Attrs: nounwind readnone speculatable declare x86_fp80 @llvm.copysign.f80(x86_fp80, x86_fp80) #1 attributes #0 = { "use-soft-float"="false" } attributes #1 = { nounwind readnone speculatable } !llvm.ident = !{!0} !0 = !{!"clang version 8.0.0 (tags/RELEASE_800/final)"}
I'm not able to reproduce this. I've tried trunk and building from the 8.0 source. This is the pattern in X86InstrFPStack.td that this should correspond to def : Pat<(f80 fpimmneg0), (CHS_Fp80 (LD_Fp080))>; This line hasn't been edited in years. Simon, did you reproduce this or just disassemble the bugpoint bitcode?
(In reply to Craig Topper from comment #2) > Simon, did you reproduce this or just disassemble the bugpoint bitcode? I just dissembled it - I can't repro it either (from the bc or the ir) but I forgot to mention that when I pasted the IR. Constantin - please can you give us some more context to your build?
> Constantin - please can you give us some more context to your build? Hmm.. Not sure what you need/what helps you. It's a Gentoo Linux machine with a Haswell CPU. I can see if playing around with some optimization flags during clang/llvm build changes the behavior.
Ok, compiling llvm and clang with CFLAGS="-pipe -march=native -O2" CXXFLAGS="${CFLAGS}" LDFLAGS="-Wl,-O1 -Wl,--as-needed" works (ie is not reproducible). Whereas with CFLAGS="-pipe -march=native -O3 -fomit-frame-pointer -fstack-protector-strong -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -freciprocal-math -floop-parallelize-all -fgraphite-identity -floop-nest-optimize -flto=8" CXXFLAGS="-pipe -march=native -O3 -fomit-frame-pointer -fstack-protector-strong -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -freciprocal-math -floop-parallelize-all -fgraphite-identity -floop-nest-optimize -flto=8 -fvisibility-inlines-hidden" LDFLAGS="-pipe -march=native -O3 -fomit-frame-pointer -fstack-protector-strong -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -freciprocal-math -floop-parallelize-all -fgraphite-identity -floop-nest-optimize -flto=8 -Wl,-O1,--as-needed,--hash-style=gnu,--sort-common,-z,relro,-z,now" I get the bug. Probably I can isolate the flag.