comparison lib/Target/NVPTX/NVPTXImageOptimizer.cpp @ 121:803732b1fca8

LLVM 5.0
author kono
date Fri, 27 Oct 2017 17:07:41 +0900
parents 1172e4bd9c6f
children c2174574ed3a
comparison
equal deleted inserted replaced
120:1172e4bd9c6f 121:803732b1fca8
94 Value *TexHandle = cleanupValue(I.getOperand(0)); 94 Value *TexHandle = cleanupValue(I.getOperand(0));
95 if (isSampler(*TexHandle)) { 95 if (isSampler(*TexHandle)) {
96 // This is an OpenCL sampler, so it must be a samplerref 96 // This is an OpenCL sampler, so it must be a samplerref
97 replaceWith(&I, ConstantInt::getTrue(I.getContext())); 97 replaceWith(&I, ConstantInt::getTrue(I.getContext()));
98 return true; 98 return true;
99 } else if (isImageWriteOnly(*TexHandle) || 99 } else if (isImage(*TexHandle)) {
100 isImageReadWrite(*TexHandle) ||
101 isImageReadOnly(*TexHandle)) {
102 // This is an OpenCL image, so it cannot be a samplerref 100 // This is an OpenCL image, so it cannot be a samplerref
103 replaceWith(&I, ConstantInt::getFalse(I.getContext())); 101 replaceWith(&I, ConstantInt::getFalse(I.getContext()));
104 return true; 102 return true;
105 } else { 103 } else {
106 // The image type is unknown, so we cannot eliminate the intrinsic 104 // The image type is unknown, so we cannot eliminate the intrinsic