summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2018-08-10 18:58:49 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2018-08-10 18:58:49 +0000
commitd35f46caf10bcf366569793bb1d24a6e82e917f7 (patch)
treebeada65af98990c085517a9cc6d245955db9070a /llvm/lib/Transforms
parent8ad00d30faad798dc62fa39ffe24125c3c57f9c7 (diff)
downloadbcm5719-llvm-d35f46caf10bcf366569793bb1d24a6e82e917f7.tar.gz
bcm5719-llvm-d35f46caf10bcf366569793bb1d24a6e82e917f7.zip
AMDGPU: Turn class x, p_zero|n_zero into fcmp oeq x, 0
The library does use this for some reason. llvm-svn: 339461
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 310b87e931c..f0c4cebd7fd 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -3195,6 +3195,15 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
return replaceInstUsesWith(*II, FCmp);
}
+ if (Mask == (N_ZERO | P_ZERO)) {
+ // Equivalent of == 0.
+ Value *FCmp = Builder.CreateFCmpOEQ(
+ Src0, ConstantFP::get(Src0->getType(), 0.0));
+
+ FCmp->takeName(II);
+ return replaceInstUsesWith(*II, FCmp);
+ }
+
const ConstantFP *CVal = dyn_cast<ConstantFP>(Src0);
if (!CVal) {
if (isa<UndefValue>(Src0))
OpenPOWER on IntegriCloud