Revert the majority of the next patch in the address space series:
[oota-llvm.git] / lib / Target / NVPTX / NVPTXAsmPrinter.cpp
index c46094569e92bbaa46e1da8b9df856a691497c00..d3dfb35e2611f587376761114ccd280339b48621 100644 (file)
@@ -126,10 +126,8 @@ const MCExpr *nvptx::LowerConstant(const Constant *CV, AsmPrinter &AP) {
       return Base;
 
     // Truncate/sext the offset to the pointer size.
-    unsigned AS = PtrVal->getType()->isPointerTy() ?
-      cast<PointerType>(PtrVal->getType())->getAddressSpace() : 0;
-    if (TD.getPointerSizeInBits(AS) != 64) {
-      int SExtAmount = 64-TD.getPointerSizeInBits(AS);
+    if (TD.getPointerSizeInBits() != 64) {
+      int SExtAmount = 64-TD.getPointerSizeInBits();
       Offset = (Offset << SExtAmount) >> SExtAmount;
     }
 
@@ -1380,7 +1378,7 @@ getOpenCLAlignment(const DataLayout *TD,
 
   const FunctionType *FTy = dyn_cast<FunctionType>(Ty);
   if (FTy)
-    return TD->getPointerPrefAlignment(0);
+    return TD->getPointerPrefAlignment();
   return TD->getPrefTypeAlignment(Ty);
 }