This is an archive of the discontinued LLVM Phabricator instance.

Check shouldReduceLoadWidth from SimplifySetCC
ClosedPublic

Authored by rampitec on Oct 29 2018, 3:51 PM.

Details

Summary

SimplifySetCC could shrink a load without checking for
profitability or legality of such shink with a target.

Added checks to prevent shrinking of aligned scalar loads
in AMDGPU below dword as scalar engine does not support it.

Diff Detail

Repository
rL LLVM

Event Timeline

rampitec created this revision.Oct 29 2018, 3:51 PM
arsenm added inline comments.Oct 29 2018, 4:02 PM
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
676–677 ↗(On Diff #171602)

What about the load from uniform global that uses a scalar load?

arsenm added inline comments.Oct 29 2018, 4:04 PM
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
676–677 ↗(On Diff #171602)

Also the address space check should go before the isUNiformMMO

rampitec marked 2 inline comments as done.Oct 29 2018, 4:20 PM
rampitec added inline comments.
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
676–677 ↗(On Diff #171602)

Something else prevents it, but I have added a check for completeness.

rampitec updated this revision to Diff 171610.Oct 29 2018, 4:30 PM

Added global address check and changed order of checks.

arsenm accepted this revision.Oct 31 2018, 11:40 AM

LGTM

This revision is now accepted and ready to land.Oct 31 2018, 11:40 AM
This revision was automatically updated to reflect the committed changes.