[X86] Separate imm from relocImm handling.
authorCraig Topper <craig.topper@intel.com>
Sat, 13 Jun 2020 18:29:28 +0000 (11:29 -0700)
committerCraig Topper <craig.topper@intel.com>
Sat, 13 Jun 2020 18:29:28 +0000 (11:29 -0700)
commit8885a7640b824c26e9ceb92297a3b45f9b8caa8b
tree114417cfbe200eedb07cea8ee9e3d30ea4cac96b
parent6973125cb746e185fc5e7823ec6422fc0670e15d
[X86] Separate imm from relocImm handling.

relocImm was a complexPattern that handled both ConstantSDNode
and X86Wrapper. But it was only applied selectively because using
it would cause patterns to be not importable into FastISel or
GlobalISel. So it only got applied to flag setting instructions,
stores, RMW arithmetic instructions, and rotates.

Most of the test changes are a result of making patterns available
to GlobalISel or FastISel. The absolute-cmp.ll change is due to
this fixing a pattern ordering issue to make an absolute symbol
match to an 8-bit immediate before trying a 32-bit immediate.

I tried to use PatFrags to reduce the repetition, but I was getting
errors from TableGen.
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/lib/Target/X86/X86InstrArithmetic.td
llvm/lib/Target/X86/X86InstrCompiler.td
llvm/lib/Target/X86/X86InstrInfo.td
llvm/lib/Target/X86/X86InstrShiftRotate.td
llvm/test/CodeGen/X86/GlobalISel/callingconv.ll
llvm/test/CodeGen/X86/GlobalISel/select-blsr.mir
llvm/test/CodeGen/X86/absolute-cmp.ll
llvm/test/CodeGen/X86/fast-isel-fneg-kill.ll