llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

llvm::SelectionDAGISel crash when using __builtin_copysign() with -march=armv8-a+nosimd

Open llvmbot opened this issue 5 years ago • 4 comments

Bugzilla Link 51806
Version 12.0
OS All
Reporter LLVM Bugzilla Contributor
CC @Arnaud-de-Grandmaison-ARM,@DMG862,@fhahn,@LebedevRI,@RKSimon,@arsenm,@smithp35

Extended Description

See https://gcc.godbolt.org/z/917z95e7W

$ cat crash.c double crash(double a, double b) { return __builtin_copysign(a, b); }

$ clang -O2 -march=armv8-a+nosimd --target=arm64 -S crash.c -o /dev/null fatal error: error in backend: Cannot select: 0x7fae361bb4e8: v2i64 = AArch64ISD::BIT 0x7fae361bb210, 0x7fae361bb278, 0x7fae361bb480 ...

Others FP related builtins doesn't seem to have problems with nosimd.

llvmbot avatar Sep 09 '21 12:09 llvmbot

So, I worked on the issue, I don't know why are you trying nosimd for armv8. armv8 doesn't support nosimd. armv7 supports it. you can rather use nofp if you want. Correct me if I am wrong. Furthermore, you can check the other options you can use here; https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html

llvmbot avatar Oct 06 '21 11:10 llvmbot

I think this is broken somewhere inside AArch64TargetLowering::LowerFCOPYSIGN

Given that its armv8-a+nosimd suggests some type/opcode legality is broken resulting in the AArch64ISD::BIT node being created.

RKSimon avatar Oct 04 '21 18:10 RKSimon

I am trying to debug this error. I gone through https://llvm.org/docs/CodeGenerator.html It will be really helpful if I can get any suggestion for where to begin.

llvmbot avatar Oct 04 '21 14:10 llvmbot

fixed by https://github.com/llvm/llvm-project/commit/6f61fe7de97c78adc8fac528239260122fb83be5

akshaykumars614 avatar Jan 18 '22 06:01 akshaykumars614