[llvm] [FastISel][AArch64] Compare Instruction Miscompilation Fix (PR #75993)

David Green via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 21 00:21:07 PST 2023


================
@@ -0,0 +1,33 @@
+; RUN: llc --global-isel=false -fast-isel -O0 -mtriple=aarch64-none-none < %s | FileCheck %s
+
+; Check that the shl instruction did not get folded in together with 
+; the cmp instruction. It would create a miscompilation 
+
+ at A = dso_local global [5 x i8] c"\C8\AA\C8\AA\AA"
+ at .str = private unnamed_addr constant [13 x i8] c"TRUE BRANCH\0A\00"
+ at .str.1 = private unnamed_addr constant [14 x i8] c"FALSE BRANCH\0A\00"
+
+define dso_local i32 @main() {
----------------
davemgreen wrote:

Is it possible to simplify the test? I think it could
 - remove dso_local
 - remove the globals
 - remove the loads
 - remove the calls
 - remove --global-isel=false and -O0?

There are some existing tests in llvm/test/CodeGen/AArch64/arm64-fast-isel-icmp.ll, but they don't seem to include any with shift amounts at the moment.

https://github.com/llvm/llvm-project/pull/75993


More information about the llvm-commits mailing list