[llvm] [VPlan] Add SCEV support for abs intrinsic (PR #195678)
Madhur Amilkanthwar via llvm-commits
llvm-commits at lists.llvm.org
Tue May 5 00:42:24 PDT 2026
================
@@ -33,6 +34,47 @@ namespace {
} while (0)
using VPInstructionTest = VPlanTestBase;
+using VPlanSCEVTest = VPlanTestIRBase;
+
+TEST_F(VPlanSCEVTest, GetSCEVExprForVPValueAbs) {
+ const char *ModuleString = R"(
+define void @f(i32 %x) {
+entry:
+ br label %loop
+loop:
+ %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
+ %iv.next = add nuw nsw i32 %iv, 1
+ %exit = icmp eq i32 %iv.next, 4
+ br i1 %exit, label %exit.block, label %loop
+exit.block:
+ ret void
+}
+)";
----------------
madhur13490 wrote:
It is input to the recipe.
The IR fixture is scaffolding to materialize the `Loop *`, `ScalarEvolution`, `PredicatedScalarEvolution` triple that `getSCEVExprForVPValue` requires as inputs. We can't have a null loop because SCEV needs to build. Have a look at EXPECT_EQ line to see how I am asserting SCEVs from both side (one SE and other via the recipe) are same.
https://github.com/llvm/llvm-project/pull/195678
More information about the llvm-commits
mailing list