diff options
author | Michael Liao <michael.hliao@gmail.com> | 2019-02-01 19:53:44 +0000 |
---|---|---|
committer | Michael Liao <michael.hliao@gmail.com> | 2019-02-01 19:53:44 +0000 |
commit | 8b323f53eb4037e06c61f4b3479959056a4ca166 (patch) | |
tree | 43082d7bdb4e2c68a7082cb752a1a32a10ec2715 /llvm/lib/Transforms | |
parent | 6e75c7e337751f490917024122edacda6afc2495 (diff) | |
download | bcm5719-llvm-8b323f53eb4037e06c61f4b3479959056a4ca166.tar.gz bcm5719-llvm-8b323f53eb4037e06c61f4b3479959056a4ca166.zip |
[InstCombine] Extra null-checking on TFE/LWE support
- If that operand is not ConstantInt, skip enabling TFE/LWE.
Differential Revision: https://reviews.llvm.org/D57539
llvm-svn: 352904
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp index b2863b0c865..e62faab1308 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp @@ -975,12 +975,11 @@ Value *InstCombiner::simplifyAMDGCNMemoryIntrinsicDemanded(IntrinsicInst *II, return nullptr; // Need to change to new instruction format - ConstantInt *TFC = nullptr; bool TFELWEEnabled = false; if (TFCIdx > 0) { - TFC = dyn_cast<ConstantInt>(II->getArgOperand(TFCIdx)); - TFELWEEnabled = TFC->getZExtValue() & 0x1 // TFE - || TFC->getZExtValue() & 0x2; // LWE + if (ConstantInt *TFC = dyn_cast<ConstantInt>(II->getArgOperand(TFCIdx))) + TFELWEEnabled = TFC->getZExtValue() & 0x1 // TFE + || TFC->getZExtValue() & 0x2; // LWE } if (TFELWEEnabled) |