Fix the removal of unnecessary stack checks
Fix the removal of unnecessary stack checks

The module CmmLayoutStack removes stack checks if a function does not
use stack space. However, it can only recognize checks of the form
Sp < SpLim. However, these checks get sometimes rewritten to
Sp >= SpLim (with both branches swapped), so we better recognize these
checks too.

Test Plan: ./validate

Reviewers: austin, bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, thomie

Differential Revision: https://phabricator.haskell.org/D1881

GHC Trac Issues: #11533

tjakway/ghcjvm,ezyang/ghc,oldmanmike/ghc,mettekou/ghc,tjakway/ghcjvm,mcschroeder/ghc,snoyberg/ghc,sgillespie/ghc,tjakway/ghcjvm,vTurbine/ghc,ezyang/ghc,vikraman/ghc,sgillespie/ghc,mcschroeder/ghc,vTurbine/ghc,olsner/ghc,shlevy/ghc,mettekou/ghc,vikraman/ghc,vikraman/ghc,snoyberg/ghc,mettekou/ghc,sdiehl/ghc,olsner/ghc,snoyberg/ghc,olsner/ghc,olsner/ghc,vikraman/ghc,oldmanmike/ghc,shlevy/ghc,tjakway/ghcjvm,oldmanmike/ghc,mcschroeder/ghc,vikraman/ghc,oldmanmike/ghc,sdiehl/ghc,ezyang/ghc,sdiehl/ghc,tjakway/ghcjvm,shlevy/ghc,olsner/ghc,mettekou/ghc,sgillespie/ghc,tjakway/ghcjvm,tjakway/ghcjvm,vTurbine/ghc,snoyberg/ghc,vikraman/ghc,oldmanmike/ghc,mettekou/ghc,sgillespie/ghc,mettekou/ghc,ezyang/ghc,sgillespie/ghc,oldmanmike/ghc,vTurbine/ghc,vTurbine/ghc,olsner/ghc,mcschroeder/ghc,sdiehl/ghc,snoyberg/ghc,ezyang/ghc,snoyberg/ghc,ezyang/ghc,sgillespie/ghc,vTurbine/ghc,mcschroeder/ghc,vikraman/ghc,shlevy/ghc,ezyang/ghc,sgillespie/ghc,shlevy/ghc,vTurbine/ghc,sdiehl/ghc,shlevy/ghc,mcschroeder/ghc,olsner/ghc,mcschroeder/ghc,oldmanmike/ghc,mettekou/ghc,snoyberg/ghc,shlevy/ghc,sdiehl/ghc,sdiehl/ghc