-
Notifications
You must be signed in to change notification settings - Fork 15.7k
Closed as not planned
Closed as not planned
Copy link
Labels
good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributellvm:analysisIncludes value tracking, cost tables and constant foldingIncludes value tracking, cost tables and constant foldingquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
This IR exhibits undefined behavior:
; RUN: opt -passes=lint %s
define float @noundef_with_fastmath_flags(float %x) {
%result = call nnan noundef float @llvm.sqrt.f32(float %x)
ret float %result
}
The sqrt will introduce poison if the input is negative or a nan due to the nnan flag. The lint utility pass should detect this anomaly and print a warning.
Probably need to introduce a cast to FPMathOperator, and check for poison generating flags around here
samurai-busido
Metadata
Metadata
Assignees
Labels
good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributellvm:analysisIncludes value tracking, cost tables and constant foldingIncludes value tracking, cost tables and constant foldingquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!