From c270aafb182c61123daa55ab53794af7f4ff9757 Mon Sep 17 00:00:00 2001 From: Max Kazantsev Date: Tue, 21 Mar 2023 17:11:10 +0700 Subject: [PATCH] Mark widenable condition as noundef This corresponds to its description in LangRef: The intrinsic @llvm.experimental.widenable.condition() returns either true or false. Differential Revision: https://reviews.llvm.org/D146508 Reviewed By: skatkov, nikic --- llvm/include/llvm/IR/Intrinsics.td | 2 +- .../InstCombine/freeze-integer-intrinsics.ll | 3 +-- .../Transforms/InstCombine/widenable-conditions.ll | 18 +++++++++--------- llvm/test/Transforms/SimpleLoopUnswitch/pr60736.ll | 5 +++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/llvm/include/llvm/IR/Intrinsics.td b/llvm/include/llvm/IR/Intrinsics.td index 0e32ca9..c24f53c 100644 --- a/llvm/include/llvm/IR/Intrinsics.td +++ b/llvm/include/llvm/IR/Intrinsics.td @@ -1376,7 +1376,7 @@ def int_experimental_guard : DefaultAttrsIntrinsic<[], [llvm_i1_ty, llvm_vararg_ // Supports widenable conditions for guards represented as explicit branches. def int_experimental_widenable_condition : DefaultAttrsIntrinsic<[llvm_i1_ty], [], - [IntrInaccessibleMemOnly, IntrWillReturn, IntrSpeculatable]>; + [IntrInaccessibleMemOnly, IntrWillReturn, IntrSpeculatable, NoUndef]>; // NOP: calls/invokes to this intrinsic are removed by codegen def int_donothing : DefaultAttrsIntrinsic<[], [], [IntrNoMem, IntrWillReturn]>; diff --git a/llvm/test/Transforms/InstCombine/freeze-integer-intrinsics.ll b/llvm/test/Transforms/InstCombine/freeze-integer-intrinsics.ll index 1d8d2a8..105bd28 100644 --- a/llvm/test/Transforms/InstCombine/freeze-integer-intrinsics.ll +++ b/llvm/test/Transforms/InstCombine/freeze-integer-intrinsics.ll @@ -419,8 +419,7 @@ define @sshl_sat_v2i32_scalable_zeroinitializer(