diff options
author | Nikita Popov <npopov@redhat.com> | 2025-08-28 15:51:01 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2025-08-28 15:53:37 +0200 |
commit | 24924a8be1bb7c6083303330ecc0e7dc647247d3 (patch) | |
tree | bd7e116d36ef9f4524516ac5baf6bcddad4acf29 /llvm/lib/Transforms/Utils/Local.cpp | |
parent | a01933d586343b7006bf354dc6557ba65621072e (diff) | |
download | llvm-24924a8be1bb7c6083303330ecc0e7dc647247d3.zip llvm-24924a8be1bb7c6083303330ecc0e7dc647247d3.tar.gz llvm-24924a8be1bb7c6083303330ecc0e7dc647247d3.tar.bz2 |
[SimplifyCFG] Move token type check into canReplaceOperandWithVariable()
We cannot form phis/selects of token type, so this should be checked
inside canReplaceOperandWithVariable().
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index ac34490..9d759bc 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -3838,8 +3838,8 @@ void llvm::maybeMarkSanitizerLibraryCallNoBuiltin( bool llvm::canReplaceOperandWithVariable(const Instruction *I, unsigned OpIdx) { const auto *Op = I->getOperand(OpIdx); - // We can't have a PHI with a metadata type. - if (Op->getType()->isMetadataTy()) + // We can't have a PHI with a metadata or token type. + if (Op->getType()->isMetadataTy() || Op->getType()->isTokenTy()) return false; // swifterror pointers can only be used by a load, store, or as a swifterror |