Ronald V. Huggins argues that the version of the Sermon on the Mount in 3 Nephi 12-14 is dependent upon the Gospel of Matthew in the KJV, not on a historical sermon Jesus presented in the Old, and later, New World.
Ronald V. Huggins, "Did the Author of 3 Nephi Know the Gospel of Matthew?" Dialogue: A Journal of Mormon Thought 30, no. 3 (Fall 1997): 137-148
CONCLUSION
The version of the SOM presented in 3 Nephi closely follows the form and arrangement in Matthew 5-7. The claim on the part of 3 Nephi to represent an independent witness to this teaching of Jesus rests on the assumption that it was Jesus who organized the material into the form in which we now find in both the gospel of Matthew and 3 Nephi. Current scholarship on Matthew, however, indicates that this is not the case, that indeed Matthew contributed significantly to the shaping of his version of the SOM. If this assessment is correct, it is no longer possible to regard 3 Nephi 12-14 as a record of an actual sermon that was delivered before first-century Nephites by the resurrected Jesus, since Nephi could not have known Matthew. Rather, the 3 Nephi SOM was derived from Matthew (in the particular form given by the KJV), after which certain minor changes were made with a view toward assimilating it to its New World setting.