diff options
author | Tim Northover <tnorthover@apple.com> | 2016-08-31 21:24:02 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2016-08-31 21:24:02 +0000 |
commit | 11a235467088c800fe0a7323cb18a55fe9fe0cd3 (patch) | |
tree | b8a59758a42fd6d569adfd9b48779a935c3337fe /llvm/lib/CodeGen/GlobalISel/MachineLegalizeHelper.cpp | |
parent | 7caf48cc5bd762a1a5a363c73ec31184cf89e9bc (diff) | |
download | bcm5719-llvm-11a235467088c800fe0a7323cb18a55fe9fe0cd3.tar.gz bcm5719-llvm-11a235467088c800fe0a7323cb18a55fe9fe0cd3.zip |
GlobalISel: use G_TYPE to annotate physregs with a type.
More preparation for dropping source types from MachineInstrs: regsters coming
out of already-selected code (i.e. non-generic instructions) don't have a type,
but that information is needed so we must add it manually.
This is done via a new G_TYPE instruction.
llvm-svn: 280292
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/MachineLegalizeHelper.cpp')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/MachineLegalizeHelper.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/MachineLegalizeHelper.cpp b/llvm/lib/CodeGen/GlobalISel/MachineLegalizeHelper.cpp index 9787227d284..18db91cbd28 100644 --- a/llvm/lib/CodeGen/GlobalISel/MachineLegalizeHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/MachineLegalizeHelper.cpp @@ -104,7 +104,8 @@ MachineLegalizeHelper::libcall(MachineInstr &MI) { default: return UnableToLegalize; case TargetOpcode::G_FREM: { - MVT Ty = MVT::getFloatingPointVT(MI.getType().getSizeInBits()); + auto &Ctx = MIRBuilder.getMF().getFunction()->getContext(); + Type *Ty = Size == 64 ? Type::getDoubleTy(Ctx) : Type::getFloatTy(Ctx); auto &CLI = *MIRBuilder.getMF().getSubtarget().getCallLowering(); auto &TLI = *MIRBuilder.getMF().getSubtarget().getTargetLowering(); const char *Name = |