From: Craig Topper Date: Thu, 11 Jun 2020 05:31:21 +0000 (-0700) Subject: [X86] Use X86AS enum constants to replace hardcoded numbers in more places. NFC X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1385ab356ab5d155af4cfa3ab9af7f3dbe7d3bea;p=platform%2Fupstream%2Fllvm.git [X86] Use X86AS enum constants to replace hardcoded numbers in more places. NFC --- diff --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp index ee2c524..171ffa2 100644 --- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -1574,13 +1574,13 @@ bool X86DAGToDAGISel::matchLoadInAddress(LoadSDNode *N, X86ISelAddressMode &AM){ (Subtarget->isTargetGlibc() || Subtarget->isTargetAndroid() || Subtarget->isTargetFuchsia())) switch (N->getPointerInfo().getAddrSpace()) { - case 256: + case X86AS::GS: AM.Segment = CurDAG->getRegister(X86::GS, MVT::i16); return false; - case 257: + case X86AS::FS: AM.Segment = CurDAG->getRegister(X86::FS, MVT::i16); return false; - // Address space 258 is not handled here, because it is not used to + // Address space X86AS::SS is not handled here, because it is not used to // address TLS areas. } @@ -2458,12 +2458,11 @@ bool X86DAGToDAGISel::selectAddr(SDNode *Parent, SDValue N, SDValue &Base, Parent->getOpcode() != X86ISD::EH_SJLJ_LONGJMP) { // longjmp unsigned AddrSpace = cast(Parent)->getPointerInfo().getAddrSpace(); - // AddrSpace 256 -> GS, 257 -> FS, 258 -> SS. - if (AddrSpace == 256) + if (AddrSpace == X86AS::GS) AM.Segment = CurDAG->getRegister(X86::GS, MVT::i16); - if (AddrSpace == 257) + if (AddrSpace == X86AS::FS) AM.Segment = CurDAG->getRegister(X86::FS, MVT::i16); - if (AddrSpace == 258) + if (AddrSpace == X86AS::SS) AM.Segment = CurDAG->getRegister(X86::SS, MVT::i16); }