https://bugs.llvm.org/show_bug.cgi?id=39550
Bug ID: 39550
Summary: Miscompilations on AArch64 since "[SimplifyCFG] don't
sink common insts too soon"
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedb...@nondot.org
Reporter: mar...@martin.st
CC: dber...@dberlin.org, efrie...@codeaurora.org,
llvm-bugs@lists.llvm.org, spatel+l...@rotateright.com
Created attachment 21080
--> https://bugs.llvm.org/attachment.cgi?id=21080&action=edit
Reproduction code
I'm running into a case where code seems to miscompile after SVN r320749,
"[SimplifyCFG] don't sink common insts too soon (PR34603)" (part of LLVM 6.0,
but the same issues can be reproduced with the latest trunk version as well).
I can't (yet) point out exactly where the new generated code is wrong, but this
commit changed the outcome of the attached code.
To reproduce (somewhat), compile the attached sample with "clang -std=c99 -O3
-fvisibility=hidden -fomit-frame-pointer -ffast-math --target=aarch64-linux-gnu
-c ref_mvs-preproc.c". If compiled with clang built from before SVN r320749,
the compiled code does what it is supposed to, while if compiled with a later
version, it produces incorrect results.
I have tried looking at the output from compiling with `-mllvm
-print-after-all` to look at differences between before and after this commit,
and there obviously are differences, but nothing that I could spot that stands
out as obviously incorrect.
Surprisingly, the same code built for other architectures (both 32 and 64 bit
x86, and armv7) with newer clang/llvm versions run just fine without any of the
misbehaviour as I run into on AArch64.
Can someone spot what this SimplifyCFG change does wrt to this code sample, if
there's some overlooked case? Or are the transformations correct and it just
happens to trigger buggy codepaths in the AArch64 target after the
transformation?
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs