[llvm] b0ea210 - [TTI] Evaluate cost of experimental_widenable_condition as zero
Max Kazantsev via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 14 03:11:24 PDT 2023
Author: Max Kazantsev
Date: 2023-03-14T17:11:07+07:00
New Revision: b0ea210b351bcb6ac1dc25678e546fd55cf952d8
URL: https://github.com/llvm/llvm-project/commit/b0ea210b351bcb6ac1dc25678e546fd55cf952d8
DIFF: https://github.com/llvm/llvm-project/commit/b0ea210b351bcb6ac1dc25678e546fd55cf952d8.diff
LOG: [TTI] Evaluate cost of experimental_widenable_condition as zero
This intrinsic is not supposed to live through lowering, eventually it should turn
into `true` constant and be optimized away.
Differential Revision: https://reviews.llvm.org/D146027
Reviewed By: skatkov
Added:
Modified:
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/test/Transforms/LoopUnroll/guard-cost-for-unrolling.ll
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
index 649b781035e7..7ebfa054818b 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
@@ -681,6 +681,7 @@ class TargetTransformInfoImplBase {
case Intrinsic::coro_suspend:
case Intrinsic::coro_subfn_addr:
case Intrinsic::threadlocal_address:
+ case Intrinsic::experimental_widenable_condition:
// These intrinsics don't actually represent code after lowering.
return 0;
}
diff --git a/llvm/test/Transforms/LoopUnroll/guard-cost-for-unrolling.ll b/llvm/test/Transforms/LoopUnroll/guard-cost-for-unrolling.ll
index 542f73a9b1c8..37f5e3a8649d 100644
--- a/llvm/test/Transforms/LoopUnroll/guard-cost-for-unrolling.ll
+++ b/llvm/test/Transforms/LoopUnroll/guard-cost-for-unrolling.ll
@@ -30,8 +30,8 @@ exit:
define void @test_guard_as_branch(ptr %arr, i64 %n, i64 %bound) {
; CHECK-LABEL: Loop Unroll: F[test_guard_as_branch] Loop %loop
-; CHECK-NEXT: Loop Size = 10
-; CHECK-NEXT: runtime unrolling with count: 1
+; CHECK-NEXT: Loop Size = 9
+; CHECK-NEXT: runtime unrolling with count: 2
entry:
br label %loop
More information about the llvm-commits
mailing list