LegalizeDAG: Don't replace vector load with integer unless legal
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 30 Mar 2016 21:15:10 +0000 (21:15 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 30 Mar 2016 21:15:10 +0000 (21:15 +0000)
commita4b1b6ea05645c8baacd5770540cf8c57549632b
tree7745c7dfa588a62ace9eb7556e5fd1003c046ea3
parent5d518386b658f51e18e77d31e2f823c171572b71
LegalizeDAG: Don't replace vector load with integer unless legal

On AMDGPU we want to be able to promote i64/f64 loads to v2i32.
If the access is unaligned, this would conclude that since i64 is legal,
it would convert it back to i64 and there is an endless legalization
loop.

Extract the logic for scalarizing the load into a new TargetLowering
function, where this can also replace the custom function AMDGPU
has for this.

llvm-svn: 264927
llvm/include/llvm/Target/TargetLowering.h
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp