[PATCH] D58096: [LowerSwitch][AMDGPU] Do not handle impossible values

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 12 04:58:41 PST 2019


arsenm added a comment.

I'm not sure I see why LowerSwitch needs to worry about this optimization. Why doesn't SimplifyCFG or DCE or one of some other control flow optimization pass handle this so LowerSwitch doesn't have to worry about it?



================
Comment at: lib/Transforms/Utils/LowerSwitch.cpp:83
+    void getAnalysisUsage(AnalysisUsage &AU) const override {
+      AU.addRequired<LazyValueInfoWrapperPass>();
+    }
----------------
Does this need to use the default Function analysis usage?


================
Comment at: test/Transforms/LowerSwitch/do-not-handle-impossible-values.ll:6-9
+; CHECK-LABEL: @test1
+; CHECK: cmp
+; CHECK: cmp
+; CHECK-NOT: cmp
----------------
The test checks are pretty thin. I think it would be better to explicitly check for what comparisons are done (if not just generate these)


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58096/new/

https://reviews.llvm.org/D58096





More information about the llvm-commits mailing list