llvm-project/llvm/lib/CodeGen/GlobalISel
Daniel Sanders 7e52367398 [globalisel][tablegen] Import signextload and zeroextload.
Allow a pattern rewriter to be installed in CodeGenDAGPatterns and use it to
correct situations where SelectionDAG and GlobalISel disagree on
representation. For example, it would rewrite:
  (sextload:i32 $ptr)<<unindexedload>><<sextload>><<sextloadi16>
to:
  (sext:i32 (load:i16 $ptr)<<unindexedload>>)

I'd have preferred to replace the fragments and have the expansion happen
naturally as part of PatFrag expansion but the type inferencing system can't
cope with loads of types narrower than those mentioned in register classes.
This is because the SDTCisInt's on the sext constrain both the result and
operand to the 'legal' integer types (where legal is defined as 'a register
class can contain the type') which immediately rules the narrower types out.
Several targets (those with only one legal integer type) would then go on to
crash on the SDTCisOpSmallerThanOp<> when it removes all the possible types
for the result of the extend.

Also, improve isObviouslySafeToFold() slightly to automatically return true for
neighbouring instructions. There can't be any re-ordering problems if
re-ordering isn't happenning. We'll need to improve it further to handle
sign/zero-extending loads when the extend and load aren't immediate neighbours
though.

llvm-svn: 317971
2017-11-11 03:23:44 +00:00
..
CMakeLists.txt [GlobalISel] Remove a stall comment in CMake. 2017-08-04 20:15:41 +00:00
CallLowering.cpp [GISel]: Fix generation of illegal COPYs during CallLowering 2017-10-09 20:07:43 +00:00
GlobalISel.cpp [GlobalISel] Make GlobalISel a non-optional library. 2017-08-03 21:52:25 +00:00
IRTranslator.cpp Move TargetFrameLowering.h to CodeGen where it's implemented 2017-11-03 22:32:11 +00:00
InstructionSelect.cpp ARM: Compute MaxCallFrame size early 2017-05-05 22:04:05 +00:00
InstructionSelector.cpp [globalisel][tablegen] Import signextload and zeroextload. 2017-11-11 03:23:44 +00:00
LLVMBuild.txt Revert "Get GlobalISel to build on Linux after r286407" 2016-11-16 22:24:59 +00:00
Legalizer.cpp Target/TargetInstrInfo.h -> CodeGen/TargetInstrInfo.h to match layering 2017-11-08 01:01:31 +00:00
LegalizerHelper.cpp [GlobalISel] Enable legalizing non-power-of-2 sized types. 2017-11-07 10:34:34 +00:00
LegalizerInfo.cpp Mark intentional fall-through with LLVM_FALLTHROUGH. 2017-11-07 13:31:52 +00:00
Localizer.cpp GlobalISel: stop localizer putting constants before EH_LABELs 2017-07-20 22:58:26 +00:00
MachineIRBuilder.cpp Target/TargetInstrInfo.h -> CodeGen/TargetInstrInfo.h to match layering 2017-11-08 01:01:31 +00:00
RegBankSelect.cpp Reverting r315590; it did not include changes for llvm-tblgen, which is causing link errors for several people. 2017-10-15 14:32:27 +00:00
RegisterBank.cpp Reverting r315590; it did not include changes for llvm-tblgen, which is causing link errors for several people. 2017-10-15 14:32:27 +00:00
RegisterBankInfo.cpp Target/TargetInstrInfo.h -> CodeGen/TargetInstrInfo.h to match layering 2017-11-08 01:01:31 +00:00
Utils.cpp Target/TargetInstrInfo.h -> CodeGen/TargetInstrInfo.h to match layering 2017-11-08 01:01:31 +00:00