As swiftkick2dnuts already posted, when you use the phone app "*#0*#" to get the hardware test, it shows that the accelerometer is not functioning properly. It took me 2 days to figure it out but it is definitely hardware and no software/firmware will be able to fix this problem. My first unit was initially working, then failed after one day of use, but I didn't really notice it until day 2. My second unit failed in less than 2 hours, probably in about 1.5 hours. What is common with both was that the failure happened after a fast charge. So far my 3rd S6 edge is working after one day but it's too early to tell.
On my first unit, both the X and Y accelerometer values were stuck on 32767 and -32768, Z was working. On my second, only one was failing (I think Y). The hardware test is showing raw values that are coming directly from the accelerometer chip so there is no API, firmware (Android) or app that is causing the problem. If the values were off by some factor, they could fix it with a patch but the values are completely stuck and do not change. Therefore, no updates of any kind can fix this problem. Even a patch cannot fix the hardware.
It's only a theory but I suspect the fast charge heats up the battery to an extreme and the accelerometer chip is probably located close enough that it fails from the heat. This might only be on the edge and not the regular S6. I suspect it's a bad batch of chips from whoever makes them (Invensense?) and it's possible that once they go through the bad batch, the rest of the units will be okay.
What I did with my 3rd unit was simply fast charge and test. This is what I recommend for people who are swapping to a new one. That way, you won't have it happen after spending a day setting up your phone.