https://bugs.llvm.org/show_bug.cgi?id=52156

            Bug ID: 52156
           Summary: Check for incompatible target features
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Target Description Classes
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

In https://llvm.org/PR52031 it was found that the module below passes the
verifier, despite the two functions main and new_function having incompatible
target-features.

If possible, we should have the verifier query the target to detect
incompatible features like this so that they can be quickly reported to users.

module.ll:

define i32 @main() #0 {
  br label %1
1:                                                ; preds = %1, %0
  %2 = phi i64 [ 0, %0 ], [ %6, %1 ]
  %3 = phi <4 x i64> [ <i64 -16, i64 -16, i64 -16, i64 -16>, %0 ], [ %5, %1 ]
  %4 = trunc <4 x i64> %3 to <4 x i32>
  %5 = call <4 x i64> @new_function(<4 x i64> %3)
  %6 = add i64 %2, 1
  %7 = icmp eq i64 %6, 2
  br i1 %7, label %8, label %1
8:                                                ; preds = %1
  %9 = extractelement <4 x i32> %4, i32 3
  ret i32 %9
}
define <4 x i64> @new_function(<4 x i64> %0) unnamed_addr {
  %2 = add <4 x i64> %0, <i64 16, i64 16, i64 16, i64 16>
  ret <4 x i64> %2
}
attributes #0 = { "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" }

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to