Changing rounding mode will not work on UT699 processors. This pass will detect the relevant call to fesetround, and issue a user warning that this has happened.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/Sparc/LeonFeatures.td | ||
---|---|---|
67 | There is a trailing whitespace here. | |
lib/Target/Sparc/LeonPasses.cpp | ||
369 | I do not think there is a reason to remove the call, a warning should be enough for what you are trying to achieve. If the program was written to use a special rounding mode then dropping the call would introduce strange errors, so it is better to leave that to the user. Also, what happens if the user is checking the return value of the function? It seems better to just warn, and leave it to the user to remove the call at the C level. | |
test/CodeGen/SPARC/LeonPreventRoundChangePassUT.ll | ||
2 | Is there a reason optimizations are disabled? | |
25–53 | This seems very complex for a test that only checks if a call instruction has been remove or not. |
Per comments in review, converted this to detect a rounding change only. It issues an error with a message that this is an erratum on the processor that the user will need to handle in a source code change. The unit test tests that the error message is produced.
Now it looks good to me.
I've noticed that some of the source files you have committed previously have accidentally been marked as executable. Perhaps you could change that for the files touched in this patch?
lib/Target/Sparc/LeonPasses.cpp | ||
---|---|---|
319 | Modified is always false now, so you could return false directly to make it clearer that the pass does not change anything. |
There is a trailing whitespace here.