diff options
author | Nikita Popov <npopov@redhat.com> | 2023-12-12 11:42:20 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-12-12 11:43:52 +0100 |
commit | 696cc20d4e748f2619f7398dcfe8f4ed8d0863ab (patch) | |
tree | 367816550658769552acab82b891d39fb6778d22 /llvm/lib/Transforms/Utils/LowerSwitch.cpp | |
parent | a97028ac511c2cda607a1e93c3b11d654cbdbf72 (diff) | |
download | llvm-696cc20d4e748f2619f7398dcfe8f4ed8d0863ab.zip llvm-696cc20d4e748f2619f7398dcfe8f4ed8d0863ab.tar.gz llvm-696cc20d4e748f2619f7398dcfe8f4ed8d0863ab.tar.bz2 |
[LVI] Make UndefAllowed argument of getConstantRange() required
For the two remaining uses that did not explicitly specify it,
set UndefAllowed=false. In both cases, I believe that treating
undef as a full range is the correct behavior.
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerSwitch.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LowerSwitch.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerSwitch.cpp b/llvm/lib/Transforms/Utils/LowerSwitch.cpp index d1cdab7..4131d36 100644 --- a/llvm/lib/Transforms/Utils/LowerSwitch.cpp +++ b/llvm/lib/Transforms/Utils/LowerSwitch.cpp @@ -412,7 +412,8 @@ void ProcessSwitchInst(SwitchInst *SI, // TODO Shouldn't this create a signed range? ConstantRange KnownBitsRange = ConstantRange::fromKnownBits(Known, /*IsSigned=*/false); - const ConstantRange LVIRange = LVI->getConstantRange(Val, SI); + const ConstantRange LVIRange = + LVI->getConstantRange(Val, SI, /*UndefAllowed*/ false); ConstantRange ValRange = KnownBitsRange.intersectWith(LVIRange); // We delegate removal of unreachable non-default cases to other passes. In // the unlikely event that some of them survived, we just conservatively |