[llvm] r312234 - [GlobalISel][X86] Refactor X86LegalizerInfo. NFC.
Igor Breger via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 31 04:40:03 PDT 2017
Author: ibreger
Date: Thu Aug 31 04:40:03 2017
New Revision: 312234
URL: http://llvm.org/viewvc/llvm-project?rev=312234&view=rev
Log:
[GlobalISel][X86] Refactor X86LegalizerInfo. NFC.
Modified:
llvm/trunk/lib/Target/X86/X86LegalizerInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86LegalizerInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86LegalizerInfo.cpp?rev=312234&r1=312233&r2=312234&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86LegalizerInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86LegalizerInfo.cpp Thu Aug 31 04:40:03 2017
@@ -42,10 +42,7 @@ X86LegalizerInfo::X86LegalizerInfo(const
void X86LegalizerInfo::setLegalizerInfo32bit() {
- if (Subtarget.is64Bit())
- return;
-
- const LLT p0 = LLT::pointer(0, 32);
+ const LLT p0 = LLT::pointer(0, TM.getPointerSize() * 8);
const LLT s1 = LLT::scalar(1);
const LLT s8 = LLT::scalar(8);
const LLT s16 = LLT::scalar(16);
@@ -116,65 +113,33 @@ void X86LegalizerInfo::setLegalizerInfo6
if (!Subtarget.is64Bit())
return;
- const LLT p0 = LLT::pointer(0, TM.getPointerSize() * 8);
- const LLT s1 = LLT::scalar(1);
- const LLT s8 = LLT::scalar(8);
- const LLT s16 = LLT::scalar(16);
const LLT s32 = LLT::scalar(32);
const LLT s64 = LLT::scalar(64);
- for (auto Ty : {p0, s1, s8, s16, s32, s64})
- setAction({G_IMPLICIT_DEF, Ty}, Legal);
+ setAction({G_IMPLICIT_DEF, s64}, Legal);
for (unsigned BinOp : {G_ADD, G_SUB, G_MUL, G_AND, G_OR, G_XOR})
- for (auto Ty : {s8, s16, s32, s64})
- setAction({BinOp, Ty}, Legal);
+ setAction({BinOp, s64}, Legal);
for (unsigned MemOp : {G_LOAD, G_STORE}) {
- for (auto Ty : {s8, s16, s32, s64, p0})
- setAction({MemOp, Ty}, Legal);
-
- setAction({MemOp, s1}, WidenScalar);
- // And everything's fine in addrspace 0.
- setAction({MemOp, 1, p0}, Legal);
+ setAction({MemOp, s64}, Legal);
}
// Pointer-handling
- setAction({G_FRAME_INDEX, p0}, Legal);
- setAction({G_GLOBAL_VALUE, p0}, Legal);
-
- setAction({G_GEP, p0}, Legal);
- setAction({G_GEP, 1, s32}, Legal);
setAction({G_GEP, 1, s64}, Legal);
- for (auto Ty : {s1, s8, s16})
- setAction({G_GEP, 1, Ty}, WidenScalar);
-
- // Control-flow
- setAction({G_BRCOND, s1}, Legal);
-
// Constants
- for (auto Ty : {s8, s16, s32, s64, p0})
- setAction({TargetOpcode::G_CONSTANT, Ty}, Legal);
-
- setAction({TargetOpcode::G_CONSTANT, s1}, WidenScalar);
+ setAction({TargetOpcode::G_CONSTANT, s64}, Legal);
// Extensions
- for (auto Ty : {s8, s16, s32, s64}) {
- setAction({G_ZEXT, Ty}, Legal);
- setAction({G_SEXT, Ty}, Legal);
- }
+ setAction({G_ZEXT, s64}, Legal);
+ setAction({G_SEXT, s64}, Legal);
- for (auto Ty : {s1, s8, s16, s32}) {
- setAction({G_ZEXT, 1, Ty}, Legal);
- setAction({G_SEXT, 1, Ty}, Legal);
- }
+ setAction({G_ZEXT, 1, s32}, Legal);
+ setAction({G_SEXT, 1, s32}, Legal);
// Comparison
- setAction({G_ICMP, s1}, Legal);
-
- for (auto Ty : {s8, s16, s32, s64, p0})
- setAction({G_ICMP, 1, Ty}, Legal);
+ setAction({G_ICMP, 1, s64}, Legal);
}
void X86LegalizerInfo::setLegalizerInfoSSE1() {
More information about the llvm-commits
mailing list