[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-06-03 Thread via cfe-commits
mikaelholmen wrote: > @mikaelholmen Thanks for the report, should be fixed by > [bda8d1a](https://github.com/llvm/llvm-project/commit/bda8d1ad72fc72f21f6c536692594376d00db8b6). Yep, thanks! That was fast! :) https://github.com/llvm/llvm-project/pull/92885

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-06-03 Thread Nikita Popov via cfe-commits
nikic wrote: @mikaelholmen Thanks for the report, should be fixed by https://github.com/llvm/llvm-project/commit/bda8d1ad72fc72f21f6c536692594376d00db8b6. https://github.com/llvm/llvm-project/pull/92885 ___ cfe-commits mailing list

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-06-03 Thread via cfe-commits
mikaelholmen wrote: Hi @nikic The following starts crashing with this patch: ``` opt ic2.ll -S -o /dev/null -passes=instcombine ``` It hits ``` opt: ../include/llvm/Support/Casting.h:578: decltype(auto) llvm::cast(From *) [To = llvm::TruncInst, From = llvm::Value]: Assertion `isa(Val) &&

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-28 Thread Nikita Popov via cfe-commits
nikic wrote: Okay, I managed to get access to a MacOS machine (turns out the GCC compile farm has one!) and figured out what the problem is. Basically, the presence of the constant expression meant that we previously always fell back to JIT and now we use the IR interpreter instead, which

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-23 Thread Nikita Popov via cfe-commits
nikic wrote: Unfortunately this is a Darwin-only test, and I don't have access to any MacOS systems. @JDevlieghere Could you please help me debug this issue? The test fails when trying to evaluate this expression:

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-22 Thread Daniel Thornburgh via cfe-commits
mysterymath wrote: This broke the Mac LLDB builders for Fuchsia as well. I'm going to revert to unblock CI. https://github.com/llvm/llvm-project/pull/92885 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-22 Thread Jonas Devlieghere via cfe-commits
JDevlieghere wrote: The LLDB bots are still failing: https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/as-lldb-cmake/4342/ https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/lldb-cmake/2244/ https://github.com/llvm/llvm-project/pull/92885

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-22 Thread Nikita Popov via cfe-commits
nikic wrote: @antmox Already fixed in https://github.com/llvm/llvm-project/commit/c609c04e32ef43f63a6ee54025fadf649c3247cc. https://github.com/llvm/llvm-project/pull/92885 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-22 Thread antoine moynault via cfe-commits
antmox wrote: Hello, some bots are broken after this patch: - https://lab.llvm.org/buildbot/#/builders/245/builds/24889 - https://lab.llvm.org/buildbot/#/builders/188/builds/46161 FAIL: Clang::weak-external.cpp Could you look at this ? https://github.com/llvm/llvm-project/pull/92885

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-21 Thread Nikita Popov via cfe-commits
https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/92885 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-21 Thread Nicolai Hähnle via cfe-commits
https://github.com/nhaehnle approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/92885 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-21 Thread Nicolai Hähnle via cfe-commits
@@ -84,28 +84,30 @@ long double ld = -1.0L; // CHECK-LE-LABEL: define dso_local void @_Z12test_signbitv( // CHECK-LE-SAME: ) #[[ATTR0:[0-9]+]] { // CHECK-LE-NEXT: entry: -// CHECK-LE-NEXT:[[FROMBOOL:%.*]] = zext i1 icmp slt (i64 trunc (i128 bitcast (ppc_fp128

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-21 Thread Nicolai Hähnle via cfe-commits
https://github.com/nhaehnle edited https://github.com/llvm/llvm-project/pull/92885 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-21 Thread Nikita Popov via cfe-commits
@@ -8,7 +8,8 @@ // CHECK: entry: // CHECK-NEXT: %retval = alloca i32 // CHECK-NEXT: store i32 0, ptr %retval -// CHECK-NEXT: [[ZEXT:%.*]] = zext i1 true to i32 +// CHECK-NEXT: [[CMP:%.*]] = icmp ne ptr @b, @a +// CHECK-NEXT: [[ZEXT:%.*]] = zext i1 [[CMP]] to i32

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-21 Thread Philip Reames via cfe-commits
@@ -8,7 +8,8 @@ // CHECK: entry: // CHECK-NEXT: %retval = alloca i32 // CHECK-NEXT: store i32 0, ptr %retval -// CHECK-NEXT: [[ZEXT:%.*]] = zext i1 true to i32 +// CHECK-NEXT: [[CMP:%.*]] = icmp ne ptr @b, @a +// CHECK-NEXT: [[ZEXT:%.*]] = zext i1 [[CMP]] to i32

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-21 Thread Philip Reames via cfe-commits
@@ -8,7 +8,8 @@ // CHECK: entry: // CHECK-NEXT: %retval = alloca i32 // CHECK-NEXT: store i32 0, ptr %retval -// CHECK-NEXT: [[ZEXT:%.*]] = zext i1 true to i32 +// CHECK-NEXT: [[CMP:%.*]] = icmp ne ptr @b, @a +// CHECK-NEXT: [[ZEXT:%.*]] = zext i1 [[CMP]] to i32

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-21 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/92885 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-21 Thread Nikita Popov via cfe-commits
@@ -1422,7 +1417,7 @@ define i1 @user_of_not_called() { ; CHECK-LABEL: define {{[^@]+}}@user_of_not_called() { ; CHECK-NEXT:call void @useFnDecl(ptr addrspace(42) noundef nonnull addrspacecast (ptr @not_called1 to ptr addrspace(42))) ; CHECK-NEXT:call void

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-21 Thread Nikita Popov via cfe-commits
@@ -43,9 +43,9 @@ ; CHECK: @mul = global ptr null ; CHECK: @xor = global ptr @A ; CHECK: @B = external global %Ty -; CHECK: @icmp_ult1 = global i1 icmp ugt (ptr getelementptr inbounds (i64, ptr @A, i64 1), ptr @A) +; CHECK: @icmp_ult1 = global i1 icmp ult (ptr @A, ptr

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-analysis Author: Nikita Popov (nikic) Changes Do not create icmp/fcmp constant expressions in IRBuilder etc anymore, i.e. treat them as "undesirable". This is in preparation for removing them entirely. Part of:

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-ir Author: Nikita Popov (nikic) Changes Do not create icmp/fcmp constant expressions in IRBuilder etc anymore, i.e. treat them as "undesirable". This is in preparation for removing them entirely. Part of:

[clang] [llvm] [IR] Avoid creating icmp/fcmp constant expressions (PR #92885)

2024-05-21 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/92885 Do not create icmp/fcmp constant expressions in IRBuilder etc anymore, i.e. treat them as "undesirable". This is in preparation for removing them entirely. Part of: