[PATCH] Removing unnecessary addrspacecasts from non-generic address spaces to the generic address space
Jingyue Wu
jingyue at google.com
Mon Mar 31 21:21:20 PDT 2014
================
Comment at: lib/Target/NVPTX/NVPTXFavorNonGenericAddrSpaces.cpp:80-85
@@ +79,8 @@
+
+// Decides whether removing Cast is valid and beneficial. Cast can be an
+// instruction or a constant expression.
+static bool IsEliminableAddrSpaceCast(Operator *Cast) {
+ // Returns false if not even an addrspacecast.
+ if (Cast->getOpcode() != Instruction::AddrSpaceCast)
+ return false;
+
----------------
Matt Arsenault wrote:
> Why not make this take an AddrSpaceCastInst?
because <Cast> can also be a ConstantExpr
http://llvm-reviews.chandlerc.com/D3235
More information about the llvm-commits
mailing list